Bug #109991 Compilation fails on Debug instruction
Submitted: 8 Feb 2023 17:34 Modified: 9 Feb 2023 5:28
Reporter: Marco Tusa Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Compiling Severity:S6 (Debug Builds)
Version:8.0.31, 8.0.32 OS:Any
Assigned to: CPU Architecture:Any

[8 Feb 2023 17:34] Marco Tusa
Description:
When using the flag for cmake WITH_INNODB_EXTRA_DEBUG compilation fails:
 96%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/page/page0zip.cc.o
In file included from /home/tusa/workspace2/mysql-8031/storage/innobase/include/os0thread.h:43,
                 from /home/tusa/workspace2/mysql-8031/storage/innobase/include/ut0counter.h:41,
                 from /home/tusa/workspace2/mysql-8031/storage/innobase/include/sync0sync.h:45,
                 from /home/tusa/workspace2/mysql-8031/storage/innobase/include/sync0types.h:39,
                 from /home/tusa/workspace2/mysql-8031/storage/innobase/include/univ.i:546,
                 from /home/tusa/workspace2/mysql-8031/storage/innobase/include/btr0types.h:36,
                 from /home/tusa/workspace2/mysql-8031/storage/innobase/include/btr0btr.h:37,
                 from /home/tusa/workspace2/mysql-8031/storage/innobase/page/page0page.cc:36:
/home/tusa/workspace2/mysql-8031/storage/innobase/page/page0page.cc: In function 'bool page_delete_rec(const dict_index_t*, page_cur_t*, const ulint*)':
/home/tusa/workspace2/mysql-8031/storage/innobase/page/page0page.cc:2523:11: error: 'page_zip' was not declared in this scope; did you mean 'page_zip_t'?
 2523 |     ut_a(!page_zip || page_zip_validate(page_zip, page, index));
      |           ^~~~~~~~
/home/tusa/workspace2/mysql-8031/storage/innobase/include/ut0dbg.h:58:34: note: in definition of macro 'ut_a'
   58 |     if (unlikely(false == (bool)(EXPR))) {                \
      |                                  ^~~~
/home/tusa/workspace2/mysql-8031/storage/innobase/page/page0page.cc:2529:11: error: 'page_zip' was not declared in this scope; did you mean 'page_zip_t'?
 2529 |     ut_a(!page_zip || page_zip_validate(page_zip, page, index));
      |           ^~~~~~~~
/home/tusa/workspace2/mysql-8031/storage/innobase/include/ut0dbg.h:58:34: note: in definition of macro 'ut_a'
   58 |     if (unlikely(false == (bool)(EXPR))) {                \
      |                                  ^~~~
make[2]: *** [storage/innobase/CMakeFiles/innobase.dir/build.make:1701: storage/innobase/CMakeFiles/innobase.dir/page/page0page.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:8072: storage/innobase/CMakeFiles/innobase.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

How to repeat:
take the mysql source and add the -DWITH_INNODB_EXTRA_DEBUG=1 flag to cmake
[8 Feb 2023 17:35] Marco Tusa
BTW not tested yet but I suspect it is the same for 8.0.32
[9 Feb 2023 5:28] MySQL Verification Team
Hello Marco Tusa,

Thank you for the report and feedback.

Thanks,
Umesh
[9 Feb 2023 5:30] MySQL Verification Team
-
scl enable devtoolset-11 bash
MYSQL_VERSION="8.0.32"
TARGET=/export/home/tmp/ushastry/src/$MYSQL_VERSION
rm -rf /export/home/tmp/ushastry/src/$MYSQL_VERSION
rm -rf bld/
mkdir bld && cd bld
rm -rf CMakeCache.txt
/home/umshastr/work/binaries/utils/cmake-3.19/bin/cmake .. -DWITH_BOOST=../boost -DCMAKE_C_COMPILER=/opt/rh/devtoolset-11/root/usr/bin/gcc -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-11/root/usr/bin/g++ -DWITH_PACKAGE_FLAGS=OFF  -DCMAKE_INSTALL_PREFIX=$TARGET -DWITH_DEBUG=1 -DWITH_INNODB_EXTRA_DEBUG=1
.
-- Running cmake version 3.19.0-rc1
-- Found Git: /usr/bin/git (found version "2.21.0")
-- CMAKE_MODULE_PATH is /export/home/tmp/ushastry/src/mysql-8.0.32/cmake
-- MySQL 8.0.32
-- The C compiler identification is GNU 11.2.1
-- The CXX compiler identification is GNU 11.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/rh/devtoolset-11/root/usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/rh/devtoolset-11/root/usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Source directory /export/home/tmp/ushastry/src/mysql-8.0.32
-- Binary directory /export/home/tmp/ushastry/src/mysql-8.0.32/bld
.
-- Found Doxygen: /usr/bin/doxygen (found version "1.9.2") found components: doxygen dot
-- CMAKE_BUILD_TYPE: Debug
-- COMPILE_DEFINITIONS: _GNU_SOURCE;_FILE_OFFSET_BITS=64;RAPIDJSON_NO_SIZETYPEDEFINE;RAPIDJSON_SCHEMA_USE_INTERNALREGEX=0;RAPIDJSON_SCHEMA_USE_STDREGEX=1;BOOST_NO_CXX98_FUNCTION_BASE;HAVE_CONFIG_H;__STDC_LIMIT_MACROS;__STDC_FORMAT_MACROS;_USE_MATH_DEFINES;LZ4_DISABLE_DEPRECATE_WARNINGS
-- CMAKE_C_FLAGS: -fno-omit-frame-pointer -ftls-model=initial-exec  -Wall -Wextra -Wformat-security -Wvla -Wundef -Wmissing-format-attribute -Wwrite-strings -Wjump-misses-init -Wstringop-truncation -Wmissing-include-dirs -Werror
-- CMAKE_CXX_FLAGS: -std=c++17 -fno-omit-frame-pointer -ftls-model=initial-exec  -Wall -Wextra -Wformat-security -Wvla -Wundef -Wmissing-format-attribute -Woverloaded-virtual -Wcast-qual -Wimplicit-fallthrough=5 -Wstringop-truncation -Wsuggest-override -Wmissing-include-dirs -Wextra-semi -Wlogical-op -Werror
-- CMAKE_CXX_FLAGS_DEBUG: -DSAFE_MUTEX -DENABLED_DEBUG_SYNC -g
-- CMAKE_CXX_FLAGS_RELWITHDEBINFO: -ffunction-sections -fdata-sections -O2 -g -DNDEBUG -g1
-- CMAKE_CXX_FLAGS_RELEASE: -ffunction-sections -fdata-sections -O3 -DNDEBUG
-- CMAKE_CXX_FLAGS_MINSIZEREL: -ffunction-sections -fdata-sections -Os -DNDEBUG
-- CMAKE_C_LINK_FLAGS:
-- CMAKE_CXX_LINK_FLAGS:
-- CMAKE_EXE_LINKER_FLAGS
-- CMAKE_MODULE_LINKER_FLAGS
-- CMAKE_SHARED_LINKER_FLAGS
-- Configuring done
-- Generating done
-- Build files have been written to: /export/home/tmp/ushastry/src/mysql-8.0.32/bld

make -j 16
.
[ 92%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/dict/dict0boot.cc.o
In file included from /export/home/tmp/ushastry/src/mysql-8.0.32/storage/innobase/include/os0thread.h:43,
                 from /export/home/tmp/ushastry/src/mysql-8.0.32/storage/innobase/include/ut0counter.h:41,
                 from /export/home/tmp/ushastry/src/mysql-8.0.32/storage/innobase/include/sync0sync.h:45,
                 from /export/home/tmp/ushastry/src/mysql-8.0.32/storage/innobase/include/sync0types.h:39,
                 from /export/home/tmp/ushastry/src/mysql-8.0.32/storage/innobase/include/univ.i:546,
                 from /export/home/tmp/ushastry/src/mysql-8.0.32/storage/innobase/include/os0event.h:37,
                 from /export/home/tmp/ushastry/src/mysql-8.0.32/storage/innobase/include/buf0types.h:36,
                 from /export/home/tmp/ushastry/src/mysql-8.0.32/storage/innobase/include/buf0lru.h:38,
                 from /export/home/tmp/ushastry/src/mysql-8.0.32/storage/innobase/buf/buf0lru.cc:33:
/export/home/tmp/ushastry/src/mysql-8.0.32/storage/innobase/buf/buf0lru.cc: In function ‘bool buf_LRU_block_remove_hashed(buf_page_t*, bool, bool)’:
/export/home/tmp/ushastry/src/mysql-8.0.32/storage/innobase/buf/buf0lru.cc:2154:60: error: ‘struct buf_block_t’ has no member named ‘index’
 2154 |                                    ((buf_block_t *)bpage)->index));
      |                                                            ^~~~~
/export/home/tmp/ushastry/src/mysql-8.0.32/storage/innobase/include/ut0dbg.h:58:34: note: in definition of macro ‘ut_a’
   58 |     if (unlikely(false == (bool)(EXPR))) {                \
      |                                  ^~~~
[ 92%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/dict/dict0crea.cc.o
[ 92%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/dict/dict0dict.cc.o
[ 92%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/dict/dict0dd.cc.o
make[2]: *** [storage/innobase/CMakeFiles/innobase.dir/buf/buf0lru.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [storage/innobase/CMakeFiles/innobase.dir/all] Error 2
make: *** [all] Error 2
[21 Mar 2023 12:11] MySQL Verification Team
Bug #110443 marked as duplicate of this one
[5 Jan 22:42] Jean-François Gagné
Also affects 8.2.0 (after all, still not marked as fixed).