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

jemalloc isn't used when it's built with a prefix

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.0.16, 10.1.2, 5.5
    • Fix Version/s: 10.0
    • Environment:

      Description

      Display an error to the lack jemalloc.
      After reconciliation with the environment, its presence exists in /usr/local/lib/libjemalloc*.
      `CMAKE_PREFIX_PATH: /usr/local/opt/openssl:/usr/local/opt/libressl:/usr/local`

      -- Performing Test TOKUDB_OK
      -- Performing Test TOKUDB_OK - Success
      CMake Warning at storage/tokudb/CMakeLists.txt:17 (MESSAGE):
        TokuDB is enabled, but jemalloc is not.  This configuration is not
        supported
      
      ~ ls /usr/local/lib/libjemalloc*
      /usr/local/lib/libjemalloc.1.dylib /usr/local/lib/libjemalloc.dylib
      /usr/local/lib/libjemalloc.a       /usr/local/lib/libjemalloc_pic.a
      ~ tree /usr/local/Cellar/jemalloc/3.6.0/{bin,include,lib}
      /usr/local/Cellar/jemalloc/3.6.0/bin
      ├── jemalloc-pprof
      └── jemalloc.sh
      /usr/local/Cellar/jemalloc/3.6.0/include
      └── jemalloc
          └── jemalloc.h
      /usr/local/Cellar/jemalloc/3.6.0/lib
      ├── libjemalloc.1.dylib
      ├── libjemalloc.a
      ├── libjemalloc.dylib -> libjemalloc.1.dylib
      └── libjemalloc_pic.a
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            serg Sergei Golubchik added a comment -

            I don't really understand why it fails for you. The command in the logs (thanks!) is

            clang -pipe -w -Os -march=native -pie -fPIC -fstack-protector --param=ssp-buffer-size=4 -DWITH_INNODB_DISALLOW_WRITES -DCHECK_FUNCTION_EXISTS=malloc_stats_print -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTryCompileExec3840902724.dir/CheckFunctionExists.c.o -o cmTryCompileExec3840902724 -ljemalloc -isystem/usr/local/include -isystem/usr/include/libxml2 -isystem/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers -I/usr/local/opt/openssl/include -I/usr/local/opt/libressl/include -L/usr/local/opt/openssl/lib -L/usr/local/opt/libressl/lib -L/usr/local/lib -L/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries -Wl,-headerpad_max_install_names

            that is

            clang ... -ljemalloc ... -L/usr/local/lib

            So it should've found libjemalloc.dylyb. Perhaps your OSX port of jemalloc doesn't have malloc_stats_print function?

            Anyway, I don't have the same environment so I cannot debug that, unfortunately. But you can try the following: remove these lines from your CMakeCache.txt file:

            //Have library jemalloc
            HAVE_DYNAMIC_JEMALLOC:INTERNAL=0
            

            Then run

            cmake --debug-trycompile

            It will fail to find jemalloc again. But inside CMakeFiles/ you fill see CMakeTmp/ which will have a normal cmake project structure — with a C file, Makefile, CMakeFiles/. Running make there will run this test for jemaloc. This way you can examine the test, see the compiler or a linker error and know exactly why it fails.

            Show
            serg Sergei Golubchik added a comment - I don't really understand why it fails for you. The command in the logs (thanks!) is clang -pipe -w -Os -march=native -pie -fPIC -fstack-protector --param=ssp-buffer-size=4 -DWITH_INNODB_DISALLOW_WRITES -DCHECK_FUNCTION_EXISTS=malloc_stats_print -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTryCompileExec3840902724.dir/CheckFunctionExists.c.o -o cmTryCompileExec3840902724 -ljemalloc -isystem/usr/local/include -isystem/usr/include/libxml2 -isystem/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers -I/usr/local/opt/openssl/include -I/usr/local/opt/libressl/include -L/usr/local/opt/openssl/lib -L/usr/local/opt/libressl/lib -L/usr/local/lib -L/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries -Wl,-headerpad_max_install_names that is clang ... -ljemalloc ... -L/usr/local/lib So it should've found libjemalloc.dylyb. Perhaps your OSX port of jemalloc doesn't have malloc_stats_print function? Anyway, I don't have the same environment so I cannot debug that, unfortunately. But you can try the following: remove these lines from your CMakeCache.txt file: //Have library jemalloc HAVE_DYNAMIC_JEMALLOC:INTERNAL=0 Then run cmake --debug-trycompile It will fail to find jemalloc again. But inside CMakeFiles/ you fill see CMakeTmp/ which will have a normal cmake project structure — with a C file, Makefile, CMakeFiles/. Running make there will run this test for jemaloc. This way you can examine the test, see the compiler or a linker error and know exactly why it fails.

              People

              • Assignee:
                Unassigned
                Reporter:
                denji Denis Denisov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: