Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-7435

Windows debug: Run-Time Check Failure #3 - The variable 'unused' is being used without being initialized

    Details

      Description

      http://buildbot.askmonty.org/buildbot/builders/win32-debug2/builds/6784/steps/build/logs/stdio

      128>  CMake Error at C:/bzr/bb-win32/win32-debug2/build/sql/create_initial_db.cmake:84 (MESSAGE):
      
      128>    Could not create initial database
      
      128>CUSTOMBUILD : error : Run-Time Check Failure #3 - The variable 'unused' is being used without being initialized. At c:\bzr\bb-win32\win32-debug2\build\sql-common\client_plugin.c:258
      

      Started happening from this revision:

      revno: 4394
      revision-id: svoj@mariadb.org-20141219191759-zi3qaqyj0vvkh0ba
      parent: sergii@pisem.net-20141219104403-wo7bvoif9zii3ie5
      committer: Sergey Vojtovich <svoj@mariadb.org>
      branch nick: 5.5
      timestamp: Fri 2014-12-19 23:17:59 +0400
      message:
        Fixed a couple of compiler warnings.
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              svoj Sergey Vojtovich added a comment -

              Alexey Botchkov, could you have a look at this?

              This build failed on warnings. It seem to be enabled implicitly by "cmake --build . --config Debug", that is by Debug project configuration. See MSVC manual for build configurations description: http://msdn.microsoft.com/en-us/library/wx0123s5.aspx

              For such builds we should add definition of FORCE_INIT_OF_VARS. Probably the easiest way is to add set_property(GLOBAL APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG FORCE_INIT_OF_VARS) to cmake/Windows.cmake.

              Show
              svoj Sergey Vojtovich added a comment - Alexey Botchkov , could you have a look at this? This build failed on warnings. It seem to be enabled implicitly by "cmake --build . --config Debug", that is by Debug project configuration. See MSVC manual for build configurations description: http://msdn.microsoft.com/en-us/library/wx0123s5.aspx For such builds we should add definition of FORCE_INIT_OF_VARS. Probably the easiest way is to add set_property(GLOBAL APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG FORCE_INIT_OF_VARS) to cmake/Windows.cmake.
              Hide
              elenst Elena Stepanova added a comment -

              The problem was already fixed in 10.0.16 by the revision below; but on 5.5 the build still fails.

              revno: 4587
              revision-id: sergii@pisem.net-20150123131738-ia1mjsnd383fmmg0
              parent: knielsen@knielsen-hq.org-20150123125646-4lazb1074epizgyg
              committer: Sergei Golubchik <sergii@pisem.net>
              branch nick: 10.0
              timestamp: Fri 2015-01-23 14:17:38 +0100
              message:
                win32-debug build failure
              
              Show
              elenst Elena Stepanova added a comment - The problem was already fixed in 10.0.16 by the revision below; but on 5.5 the build still fails. revno: 4587 revision-id: sergii@pisem.net-20150123131738-ia1mjsnd383fmmg0 parent: knielsen@knielsen-hq.org-20150123125646-4lazb1074epizgyg committer: Sergei Golubchik <sergii@pisem.net> branch nick: 10.0 timestamp: Fri 2015-01-23 14:17:38 +0100 message: win32-debug build failure
              Hide
              holyfoot Alexey Botchkov added a comment -

              Same fix pushed to the 5.5.
              In the future though i think the nicer fix is to turn /nowarn:42024 switch on,
              so the VC won't warn the unused local variables.

              Show
              holyfoot Alexey Botchkov added a comment - Same fix pushed to the 5.5. In the future though i think the nicer fix is to turn /nowarn:42024 switch on, so the VC won't warn the unused local variables.
              Hide
              wlad Vladislav Vaintroub added a comment -

              The build does not fail on warnings. It is runtime error tells you that variable is used and its value was read. It makes sense to find out why it was so.

              Show
              wlad Vladislav Vaintroub added a comment - The build does not fail on warnings. It is runtime error tells you that variable is used and its value was read. It makes sense to find out why it was so.
              Hide
              holyfoot Alexey Botchkov added a comment - - edited

              Ah, of course i meant to switch it off for the Release build only. Debug should still fail on the uninitialized variables.

              Show
              holyfoot Alexey Botchkov added a comment - - edited Ah, of course i meant to switch it off for the Release build only. Debug should still fail on the uninitialized variables.
              Hide
              wlad Vladislav Vaintroub added a comment -

              Runtime checks (/RTC flags in Visual C++) are never enabled in optimized builds, since they are very expensive in terms of peformance.
              They are enabled by default in debug builds
              https://msdn.microsoft.com/en-us/library/162azb0k.aspx

              I guess a better solution would be to treat corresponding warnings C4701 and C4703 as errors (using /we4701 /we4703 or #pragma warning (error : 4701)), so that compilation fails rather than program crashes at runtime. Visual C++ compiler is pretty accurate on such warnings, not known for many false positives

              Show
              wlad Vladislav Vaintroub added a comment - Runtime checks (/RTC flags in Visual C++) are never enabled in optimized builds, since they are very expensive in terms of peformance. They are enabled by default in debug builds https://msdn.microsoft.com/en-us/library/162azb0k.aspx I guess a better solution would be to treat corresponding warnings C4701 and C4703 as errors (using /we4701 /we4703 or #pragma warning (error : 4701)), so that compilation fails rather than program crashes at runtime. Visual C++ compiler is pretty accurate on such warnings, not known for many false positives

                People

                • Assignee:
                  holyfoot Alexey Botchkov
                  Reporter:
                  elenst Elena Stepanova
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 4 hours
                    4h