Bug #112191 | When we compile MySQL 8.0 with DEBUG, we have some warning of memory leak | ||
---|---|---|---|
Submitted: | 28 Aug 2023 2:52 | Modified: | 29 Aug 2023 9:15 |
Reporter: | linkang zhang (OCA) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Compiling | Severity: | S3 (Non-critical) |
Version: | 8.0.31 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | compilation warning, Contribution |
[28 Aug 2023 2:52]
linkang zhang
[28 Aug 2023 2:54]
linkang zhang
The compiler think it maybe memory leak, but in fact there is no memory leak, so we add void* to avoid that. (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: bugfix_for_warning_of_compiler.diff (application/octet-stream, text), 511 bytes.
[28 Aug 2023 4:34]
linkang zhang
// You can repeat this by: cmake --DWITH_DEBUG=1 make -j `cat /proc/cpuinfo | grep processor| wc -l`
[29 Aug 2023 5:00]
MySQL Verification Team
Hello linkang zhang, Thank you for the report and contribution. I quickly attempted 8.0.34(even 8.0.31) source build on OL7 with the provided cmake(cmake 3.19, gcc 11 along with bundled boost with -DWITH_BOOST) but still not seeing the warnings that you mentioned. Could you please share exact cmake options used, gcc version and OS to reproduce the issue at our end? Thank you. regards, Umesh
[29 Aug 2023 5:39]
linkang zhang
// Can you repeat this problem by this option ? build_type=Debug GCOV=0 mach_tpye=x86_64 os_type=Linux cmake_version=3.25.1 gcc_version=11.2.1 gcc_path=/opt/rh/devtoolset-11/root/bin/gcc cxx_path=/opt/rh/devtoolset-11/root/bin/g++ CFLAGS=-O0 -g3 -gdwarf-2 -fexceptions -fno-strict-aliasing -fno-omit-frame-pointer -D_GLIBCXX_USE_CXX11_ABI=0 CXXFLAGS=-O0 -g3 -gdwarf-2 -fexceptions -fno-strict-aliasing -fno-omit-frame-pointer -D_GLIBCXX_USE_CXX11_ABI=0 cmake . \ -DFORCE_INSOURCE_BUILD=ON \ -DMINIMAL_RELWITHDEBINFO=0 \ -DWITH_DEBUG=$debug \ -DINSTALL_LAYOUT=STANDALONE \ -DMYSQL_MAINTAINER_MODE=0 \ -DWITH_EMBEDDED_SERVER=0 \ -DWITH_JEMALLOC=bundled \ -DWITH_MYISAM_STORAGE_ENGINE=1 \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_CSV_STORAGE_ENGINE=1 \ -DWITH_ARCHIVE_STORAGE_ENGINE=1 \ -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \ -DWITH_FEDERATED_STORAGE_ENGINE=1 \ -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \ -DWITH_TEMPTABLE_STORAGE_ENGINE=1 \ -DWITH_XENGINE_STORAGE_ENGINE=1 \ -DENABLED_PROFILING=1 \ -DENABLED_LOCAL_INFILE=1 \ -DWITH_BOOST="extra/boost/boost_1_77_0.tar.bz2"
[29 Aug 2023 6:01]
linkang zhang
// Maybe you can add some DCMAKE_C_FLAGS of gcc cmake . \ -DCMAKE_C_FLAGS="-O0 -g3 -gdwarf-2 -fexceptions -fno-strict-aliasing -fno-omit-frame-pointer -D_GLIBCXX_USE_CXX11_ABI=0" \ -DFORCE_INSOURCE_BUILD=ON \ -DCMAKE_BUILD_TYPE="debug" \ -DMINIMAL_RELWITHDEBINFO=0 \ -DWITH_UNIT_TESTS=0 \ -DWITH_DEBUG=1 \ -DINSTALL_LAYOUT=STANDALONE \ -DMYSQL_MAINTAINER_MODE=0 \ -DWITH_EMBEDDED_SERVER=0 \ -DWITH_EXTRA_CHARSETS=all \ -DWITH_MYISAM_STORAGE_ENGINE=1 \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_CSV_STORAGE_ENGINE=1 \ -DWITH_ARCHIVE_STORAGE_ENGINE=1 \ -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \ -DWITH_EXAMPLE_STORAGE_ENGINE=0 \ -DWITH_TEMPTABLE_STORAGE_ENGINE=1 \ -DWITH_XENGINE_STORAGE_ENGINE=1 \ -DWITH_QUERY_TRACE=1 \ -DWITH_EXTRA_CHARSETS=all \ -DDEFAULT_COLLATION=utf8mb4_0900_ai_ci \ -DENABLED_PROFILING=1 \ -DENABLED_LOCAL_INFILE=1 \ -DWITH_BOOST="extra/boost/boost_1_77_0.tar.bz2"
[29 Aug 2023 6:13]
MySQL Verification Team
Thank you for the details, let me give it a try and let you know if anything further needed. regards, Umesh Shastry
[29 Aug 2023 9:15]
MySQL Verification Team
Thank you for the report and contribution. regards, Umesh Shastry