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

tokudb release builds compiled with debug code on

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.5.38, 10.0.12
    • 5.5.39, 10.0.13
    • None
    • None
    • ubuntu 14.04 (and probably others)

    Description

      TokuDB (ft-index) uses the TOKU_DEBUG_PARANOID cmake variable (default ON) to control whether or not debug code is compiled into TokuDB. Release builds should build with this variable OFF. One way is to change the default in TokuDB's CMakeLists.txt file.

      Attachments

        Activity

          I could switch it to off when CMAKE_BUILD_TYPE is not Debug, but generally it's not a good idea. With VS and Xcode one can configure once and then compile for different configurations, that's why one should normally use, say, CMAKE_CXX_FLAGS_DEBUG, etc instead of adding options to CMAKE_CXX_FLAGS when CMAKE_BUILD_TYPE is Debug.

          While TokuDB doesn't compile on Windows, it can be compiled on Mac OS X, right?

          I'd suggest the following fix: rename the option (in cmakefiles) to, say, TOKUDB_DEBUG_PARANOID. And if it's set, add -DTOKU_DEBUG_PARANOID (old name) to CMAKE_CXX_FLAGS_DEBUG. This way you won't need to change source files, and cmake will automatically enable debug flag in the correct configuration.

          In the server we use a somewhat more complex approach. For safemalloc, for example, the values are ON, OFF, AUTO, meaning "always enable", "always disable", "enable in debug builds only". And -DSAFEMALLOC is added, respectively, to CMAKE_CXX_FLAGS, nowhere, to CMAKE_CXX_FLAGS_DEBUG.

          serg Sergei Golubchik added a comment - I could switch it to off when CMAKE_BUILD_TYPE is not Debug, but generally it's not a good idea. With VS and Xcode one can configure once and then compile for different configurations, that's why one should normally use, say, CMAKE_CXX_FLAGS_DEBUG, etc instead of adding options to CMAKE_CXX_FLAGS when CMAKE_BUILD_TYPE is Debug. While TokuDB doesn't compile on Windows, it can be compiled on Mac OS X, right? I'd suggest the following fix: rename the option (in cmakefiles) to, say, TOKUDB_DEBUG_PARANOID. And if it's set, add -DTOKU_DEBUG_PARANOID (old name) to CMAKE_CXX_FLAGS_DEBUG. This way you won't need to change source files, and cmake will automatically enable debug flag in the correct configuration. In the server we use a somewhat more complex approach. For safemalloc, for example, the values are ON, OFF, AUTO, meaning "always enable", "always disable", "enable in debug builds only". And -DSAFEMALLOC is added, respectively, to CMAKE_CXX_FLAGS, nowhere, to CMAKE_CXX_FLAGS_DEBUG.

          I've simply forced TOKU_PARANOID_ASSERT to be OFF

          serg Sergei Golubchik added a comment - I've simply forced TOKU_PARANOID_ASSERT to be OFF

          People

            serg Sergei Golubchik
            prohaska7 Rich Prohaska
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.