Bug #118185 Non-specific ASan error on TestLoaderGood/LoaderReadTest.load_wrong_version/0
Submitted: 13 May 2025 14:43 Modified: 17 Jun 13:05
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:Tests Severity:S3 (Non-critical)
Version:8.0.46, 8.4.9 OS:MacOS (15.4.1)
Assigned to: CPU Architecture:ARM

[13 May 2025 14:43] Laurynas Biveinis
Description:
Server built with

-DCMAKE_BUILD_TYPE=Debug -DWITH_DEBUG=ON -DMYSQL_MAINTAINER_MODE=ON -DWITH_SYSTEM_LIBS=ON -DWITH_NDBCLUSTER_STORAGE_ENGINE=OFF -DDOWNLOAD_BOOST=ON -DWITH_BOOST=path -DCMAKE_CXX_FLAGS=-g -DCMAKE_CXX_FLAGS_DEBUG=-g -DCMAKE_CXX_FLAGS_RELEASE=-g -O2 -DNDEBUG -DWITH_ASAN=ON -DWITH_ASAN_SCOPE=ON -DWITH_UBSAN=ON -DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm@14/bin/clang -DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm@14/bin/clang++ -DCMAKE_AR=/opt/homebrew/opt/llvm@14/bin/llvm-ar

ASan ODR violation detection disabled or bug 116372 will hit instead:

$ ASAN_OPTIONS="detect_odr_violation=0" runtime_output_directory/routertest_harness_loader
...
[ RUN      ] TestLoaderGood/LoaderReadTest.load_wrong_version/0
2025-05-13 17:41:06 main DEBUG [0x20b1a8c80]   loading 'routertestplugin_bad_two'.
=================================================================
AddressSanitizer:DEADLYSIGNAL
AddressSanitizer: nested bug in the same thread, aborting.

How to repeat:
See above
[13 May 2025 16:04] MySQL Verification Team
Hello Laurynas,

Thank you for the report and feedback.

regards,
Umesh
[27 Oct 2025 16:24] Laurynas Biveinis
Same on 8.0.44
[28 Oct 2025 9:21] Laurynas Biveinis
No longer reproduces with 8.0.44 / 8.4.7 / 9.5.0. Leaving it for you to close in the case you want to update release notes etc.
[21 Jan 12:02] Laurynas Biveinis
On 8.0.45, a non-sanitizer error but only happens with the sanitizer build:

[ RUN      ] TestLoaderGood/LoaderReadTest.Available/0
unknown file: Failure
C++ exception with description "Path './router/tests/data/./tests-good-1.cfg' does not exist" thrown in SetUp().

[  FAILED  ] TestLoaderGood/LoaderReadTest.Available/0, where GetParam() = "tests-good-1.cfg" (0 ms)
[ RUN      ] TestLoaderGood/LoaderReadTest.Available/1
unknown file: Failure
C++ exception with description "Path './router/tests/data/./tests-good-2.cfg' does not exist" thrown in SetUp().

[  FAILED  ] TestLoaderGood/LoaderReadTest.Available/1, where GetParam() = "tests-good-2.cfg" (0 ms)
[ RUN      ] TestLoaderGood/LoaderReadTest.load_non_existant_fails/0
unknown file: Failure
C++ exception with description "Path './router/tests/data/./tests-good-1.cfg' does not exist" thrown in SetUp().

[  FAILED  ] TestLoaderGood/LoaderReadTest.load_non_existant_fails/0, where GetParam() = "tests-good-1.cfg" (0 ms)
[ RUN      ] TestLoaderGood/LoaderReadTest.load_non_existant_fails/1
unknown file: Failure
C++ exception with description "Path './router/tests/data/./tests-good-2.cfg' does not exist" thrown in SetUp().

[  FAILED  ] TestLoaderGood/LoaderReadTest.load_non_existant_fails/1, where GetParam() = "tests-good-2.cfg" (0 ms)
[ RUN      ] TestLoaderGood/LoaderReadTest.load_missing_dep_fails/0
unknown file: Failure
C++ exception with description "Path './router/tests/data/./tests-good-1.cfg' does not exist" thrown in SetUp().

[  FAILED  ] TestLoaderGood/LoaderReadTest.load_missing_dep_fails/0, where GetParam() = "tests-good-1.cfg" (2 ms)
[ RUN      ] TestLoaderGood/LoaderReadTest.load_missing_dep_fails/1
unknown file: Failure
C++ exception with description "Path './router/tests/data/./tests-good-2.cfg' does not exist" thrown in SetUp().

[  FAILED  ] TestLoaderGood/LoaderReadTest.load_missing_dep_fails/1, where GetParam() = "tests-good-2.cfg" (0 ms)
[ RUN      ] TestLoaderGood/LoaderReadTest.load_wrong_version/0
unknown file: Failure
C++ exception with description "Path './router/tests/data/./tests-good-1.cfg' does not exist" thrown in SetUp().

[  FAILED  ] TestLoaderGood/LoaderReadTest.load_wrong_version/0, where GetParam() = "tests-good-1.cfg" (0 ms)
[ RUN      ] TestLoaderGood/LoaderReadTest.load_wrong_version/1
unknown file: Failure
C++ exception with description "Path './router/tests/data/./tests-good-2.cfg' does not exist" thrown in SetUp().

[  FAILED  ] TestLoaderGood/LoaderReadTest.load_wrong_version/1, where GetParam() = "tests-good-2.cfg" (0 ms)
[ RUN      ] TestLoaderGood/LoaderReadTest.load_example_succeeds/0
unknown file: Failure
C++ exception with description "Path './router/tests/data/./tests-good-1.cfg' does not exist" thrown in SetUp().

[  FAILED  ] TestLoaderGood/LoaderReadTest.load_example_succeeds/0, where GetParam() = "tests-good-1.cfg" (0 ms)
[ RUN      ] TestLoaderGood/LoaderReadTest.load_example_succeeds/1
unknown file: Failure
C++ exception with description "Path './router/tests/data/./tests-good-2.cfg' does not exist" thrown in SetUp().

[  FAILED  ] TestLoaderGood/LoaderReadTest.load_example_succeeds/1, where GetParam() = "tests-good-2.cfg" (0 ms)
[ RUN      ] TestLoaderGood/LoaderReadTest.load_example_section_two_succeeds/0
unknown file: Failure
C++ exception with description "Path './router/tests/data/./tests-good-1.cfg' does not exist" thrown in SetUp().

[  FAILED  ] TestLoaderGood/LoaderReadTest.load_example_section_two_succeeds/0, where GetParam() = "tests-good-1.cfg" (0 ms)
[ RUN      ] TestLoaderGood/LoaderReadTest.load_example_section_two_succeeds/1
unknown file: Failure
C++ exception with description "Path './router/tests/data/./tests-good-2.cfg' does not exist" thrown in SetUp().

[  FAILED  ] TestLoaderGood/LoaderReadTest.load_example_section_two_succeeds/1, where GetParam() = "tests-good-2.cfg" (0 ms)
[ RUN      ] TestLoaderGood/LoaderReadTest.load_magic_succeeds/0
unknown file: Failure
C++ exception with description "Path './router/tests/data/./tests-good-1.cfg' does not exist" thrown in SetUp().

[  FAILED  ] TestLoaderGood/LoaderReadTest.load_magic_succeeds/0, where GetParam() = "tests-good-1.cfg" (0 ms)
[ RUN      ] TestLoaderGood/LoaderReadTest.load_magic_succeeds/1
unknown file: Failure
C++ exception with description "Path './router/tests/data/./tests-good-2.cfg' does not exist" thrown in SetUp().

[  FAILED  ] TestLoaderGood/LoaderReadTest.load_magic_succeeds/1, where GetParam() = "tests-good-2.cfg" (0 ms)
[----------] 14 tests from TestLoaderGood/LoaderReadTest (3 ms total)

[----------] 3 tests from TestLoaderBad/LoaderTest
[ RUN      ] TestLoaderBad/LoaderTest.BadSection/0
/Users/laurynas/vilniusdb/mysql-8.0.45/router/src/harness/tests/test_loader.cc:154: Failure
Expected: loader->get_config().read(Path(test_data_dir_).join(GetParam())) throws an exception of type bad_section.
  Actual: it throws std::runtime_error with description "Path './router/tests/data/./tests-bad-1.cfg' does not exist".

[  FAILED  ] TestLoaderBad/LoaderTest.BadSection/0, where GetParam() = "tests-bad-1.cfg" (0 ms)
[ RUN      ] TestLoaderBad/LoaderTest.BadSection/1
/Users/laurynas/vilniusdb/mysql-8.0.45/router/src/harness/tests/test_loader.cc:154: Failure
Expected: loader->get_config().read(Path(test_data_dir_).join(GetParam())) throws an exception of type bad_section.
  Actual: it throws std::runtime_error with description "Path './router/tests/data/./tests-bad-2.cfg' does not exist".

[  FAILED  ] TestLoaderBad/LoaderTest.BadSection/1, where GetParam() = "tests-bad-2.cfg" (0 ms)
[ RUN      ] TestLoaderBad/LoaderTest.BadSection/2
/Users/laurynas/vilniusdb/mysql-8.0.45/router/src/harness/tests/test_loader.cc:154: Failure
Expected: loader->get_config().read(Path(test_data_dir_).join(GetParam())) throws an exception of type bad_section.
  Actual: it throws std::runtime_error with description "Path './router/tests/data/./tests-bad-3.cfg' does not exist".

[  FAILED  ] TestLoaderBad/LoaderTest.BadSection/2, where GetParam() = "tests-bad-3.cfg" (0 ms)
[22 Jan 4:24] Laurynas Biveinis
Same on 8.4.8:

$ ASAN_OPTIONS="detect_odr_violation=0" ./runtime_output_directory/routertest_harness_loader
[==========] Running 19 tests from 4 test suites.
[----------] Global test environment set-up.
[----------] 1 test from TestStart
[ RUN      ] TestStart.StartFailure
2026-01-22 06:23:46 main DEBUG [0x1f7fcac40] Loading plugins: routertestplugin_magic.
2026-01-22 06:23:46 main DEBUG [0x1f7fcac40]   loading 'routertestplugin_magic'.
2026-01-22 06:23:46 main DEBUG [0x1f7fcac40] Initializing plugins: routertestplugin_magic.
2026-01-22 06:23:46 main DEBUG [0x1f7fcac40]   init 'routertestplugin_magic' succeeded.
2026-01-22 06:23:46 main WARNING [0x1f7fcac40] option 'DEFAULT.prefix' is not supported
2026-01-22 06:23:46 main WARNING [0x1f7fcac40] option 'routertestplugin_magic.message' is not supported
2026-01-22 06:23:46 main WARNING [0x1f7fcac40] option 'routertestplugin_magic.suki' is not supported
2026-01-22 06:23:46 main DEBUG [0x1f7fcac40] Starting: routertestplugin_magic.
2026-01-22 06:23:46 main DEBUG [0x1f7fcac40] Service ready!
2026-01-22 06:23:46 main DEBUG [0x1f7fcac40] NOTIFY_SOCKET is empty, skipping sending 'READY=1' notification
2026-01-22 06:23:46 main DEBUG [0x1f7fcac40] NOTIFY_SOCKET is empty, skipping sending 'STATUS=running' notification
2026-01-22 06:23:46 main ERROR [0x16dcbf000]   start 'routertestplugin_magic' failed: The suki was bad, please throw away
2026-01-22 06:23:46 main DEBUG [0x1f7fcac40] Shutting down.
2026-01-22 06:23:46 main DEBUG [0x1f7fcac40] NOTIFY_SOCKET is empty, skipping sending 'STOPPING=1
STATUS=Router shutdown in progress
' notification
2026-01-22 06:23:46 main DEBUG [0x1f7fcac40] Unloading all plugins.
[       OK ] TestStart.StartFailure (13 ms)
[----------] 1 test from TestStart (13 ms total)

[----------] 1 test from TestPlugin
[ RUN      ] TestPlugin.ArchDescriptor
[       OK ] TestPlugin.ArchDescriptor (0 ms)
[----------] 1 test from TestPlugin (0 ms total)

[----------] 14 tests from TestLoaderGood/LoaderReadTest
[ RUN      ] TestLoaderGood/LoaderReadTest.Available/0
[       OK ] TestLoaderGood/LoaderReadTest.Available/0 (0 ms)
[ RUN      ] TestLoaderGood/LoaderReadTest.Available/1
[       OK ] TestLoaderGood/LoaderReadTest.Available/1 (0 ms)
[ RUN      ] TestLoaderGood/LoaderReadTest.load_non_existant_fails/0
2026-01-22 06:23:46 main DEBUG [0x1f7fcac40]   loading 'nonexistant-plugin'.
[       OK ] TestLoaderGood/LoaderReadTest.load_non_existant_fails/0 (0 ms)
[ RUN      ] TestLoaderGood/LoaderReadTest.load_non_existant_fails/1
2026-01-22 06:23:46 main DEBUG [0x1f7fcac40]   loading 'nonexistant-plugin'.
[       OK ] TestLoaderGood/LoaderReadTest.load_non_existant_fails/1 (0 ms)
[ RUN      ] TestLoaderGood/LoaderReadTest.load_missing_dep_fails/0
2026-01-22 06:23:46 main DEBUG [0x1f7fcac40]   loading 'routertestplugin_bad_one'.
2026-01-22 06:23:46 main DEBUG [0x1f7fcac40]   loading 'routertestplugin_foobar'.
2026-01-22 06:23:46 main ERROR [0x1f7fcac40] Plugin 'routertestplugin_bad_one' needs plugin 'routertestplugin_foobar' which is missing in the configuration
[       OK ] TestLoaderGood/LoaderReadTest.load_missing_dep_fails/0 (6 ms)
[ RUN      ] TestLoaderGood/LoaderReadTest.load_missing_dep_fails/1
2026-01-22 06:23:46 main DEBUG [0x1f7fcac40]   loading 'routertestplugin_bad_one'.
2026-01-22 06:23:46 main DEBUG [0x1f7fcac40]   loading 'routertestplugin_foobar'.
2026-01-22 06:23:46 main ERROR [0x1f7fcac40] Plugin 'routertestplugin_bad_one' needs plugin 'routertestplugin_foobar' which is missing in the configuration
[       OK ] TestLoaderGood/LoaderReadTest.load_missing_dep_fails/1 (0 ms)
[ RUN      ] TestLoaderGood/LoaderReadTest.load_wrong_version/0
2026-01-22 06:23:46 main DEBUG [0x1f7fcac40]   loading 'routertestplugin_bad_two'.
=================================================================
AddressSanitizer:DEADLYSIGNAL
AddressSanitizer: nested bug in the same thread, aborting.
[11 Jun 3:55] Laurynas Biveinis
8.0.46 shows specific global-buffer-overflow:

[ RUN      ] TestLoaderGood/LoaderReadTest.load_wrong_version/0
2026-06-11 06:54:44 main DEBUG [0x1fc0f1e80]   loading 'routertestplugin_bad_two'.
=================================================================
==18902==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00010524ac38 at pc 0x0001065f671c bp 0x00016b044c80 sp 0x00016b044450
READ of size 33 at 0x00010524ac38 thread T0
    #0 0x0001065f6718 in strlen+0x22c (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x16718)
    #1 0x000105acd8e0 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::basic_string[abi:nqe210106]<0>(char const*) string:1063
    #2 0x000105ab03d4 in mysql_harness::Loader::load_from(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) loader.cc:421
    #3 0x000105ab225c in mysql_harness::Loader::load(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) loader.cc:527
    #4 0x000104dbd5e4 in LoaderReadTest_load_wrong_version_Test::TestBody() test_loader.cc:122
    #5 0x000104e5163c in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) gtest.cc:2700
    #6 0x000104e513d0 in testing::Test::Run() gtest.cc:2739
    #7 0x000104e52fc4 in testing::TestInfo::Run() gtest.cc:2885
    #8 0x000104e558dc in testing::TestSuite::Run() gtest.cc:3063
    #9 0x000104e6f4ac in testing::internal::UnitTestImpl::RunAllTests() gtest.cc:6054
    #10 0x000104e6e5b4 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) gtest.cc:2700
    #11 0x000104e6e29c in testing::UnitTest::Run() gtest.cc:5594
    #12 0x000104dc4080 in main test_loader.cc:228
    #13 0x00018fbb3dfc in start+0x1b4c (dyld:arm64e+0x1fdfc)

0x00010524ac41 is located 0 bytes after global variable '.str.2' defined in '/Users/laurynas/vilniusdb/mysql-8.0.46/router/src/harness/tests/plugins/bad_two.cc' (0x00010524ac20) of size 33
  '.str.2' is ascii string 'routertestplugin_magic (>>1.2.3)'
0x00010524ac41 is located 0 bytes after global variable '.str.2' defined in '/Users/laurynas/vilniusdb/mysql-8.0.46/router/src/harness/tests/plugins/bad_two.cc' (0x00010524ac20) of size 33
  '.str.2' is ascii string 'routertestplugin_magic (>>1.2.3)'
0x00010524ac41 is located 0 bytes after global variable '.str.2' defined in '/Users/laurynas/vilniusdb/mysql-8.0.46/router/src/harness/tests/plugins/bad_two.cc' (0x00010524ac20) of size 33
  '.str.2' is ascii string 'routertestplugin_magic (>>1.2.3)'
SUMMARY: AddressSanitizer: global-buffer-overflow string:1063 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::basic_string[abi:nqe210106]<0>(char const*)
Shadow bytes around the buggy address:
  0x00010524a980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00010524aa00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00010524aa80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00010524ab00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00010524ab80: 00 00 00 00 00 00 00 00 00 02 f9 f9 f9 f9 f9 f9
=>0x00010524ac00: 00 05 f9 f9 00 00 00[f9]01 f9 f9 f9 f9 f9 f9 f9
  0x00010524ac80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00010524ad00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00010524ad80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00010524ae00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x00010524ae80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==18902==ABORTING
[1]    18902 abort      ASAN_OPTIONS="detect_odr_violation=0"
[17 Jun 13:05] Laurynas Biveinis
Same under 8.4.9