Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix address sanitizer error when storing metadata in destructor #473

Merged
merged 4 commits into from
Aug 2, 2024

Conversation

jparismorgan
Copy link
Collaborator

@jparismorgan jparismorgan commented Aug 1, 2024

What

Previously when running with:

cmake -S ./src -B ./src/build -DCMAKE_BUILD_TYPE=Debug -DTILEDB_SANITIZER="address"
cmake --build ./src/build -j3
cmake --build ./src/build --target check > address_sanitizer_results.txt

We would get:

28/53 Test #28: unit_ivf_pq_group_test ...............Subprocess aborted***Exception:   6.51 sec
=================================================================
==32117==ERROR: AddressSanitizer: stack-use-after-scope on address 0x00016fbc6a58 at pc 0x0001015fac38 bp 0x00016fbc4d90 sp 0x00016fbc4540
READ of size 8 at 0x00016fbc6a58 thread T0
    #0 0x1015fac34 in wrap_memcpy+0x3fc (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x1ac34)
    #1 0x10371bd9c in tiledb::sm::Metadata::put(char const*, tiledb::sm::Datatype, unsigned int, void const*)+0x98 (libtiledb.dylib:arm64+0x257d9c)
    #2 0x103d8ca0c in tiledb::api::tiledb_group_put_metadata(tiledb_group_handle_t*, char const*, tiledb_datatype_t, unsigned int, void const*)+0x48 (libtiledb.dylib:arm64+0x8c8a0c)
    #3 0x103d91f40 in tiledb::api::CAPIFunction<&tiledb::api::tiledb_group_put_metadata(tiledb_group_handle_t*, char const*, tiledb_datatype_t, unsigned int, void const*), tiledb::api::detail::ExceptionActionDetailCtx, tiledb::api::CAPIFunctionNullAspect<&tiledb::api::tiledb_group_put_metadata(tiledb_group_handle_t*, char const*, tiledb_datatype_t, unsigned int, void const*)>>::function(tiledb::api::detail::ExceptionActionDetailCtx&, tiledb_group_handle_t*, char const*, tiledb_datatype_t, unsigned int, void const*)+0x54 (libtiledb.dylib:arm64+0x8cdf40)
    #4 0x103d8fa54 in tiledb_group_put_metadata+0x30 (libtiledb.dylib:arm64+0x8cba54)
    #5 0x10034d7d4 in tiledb::Group::put_metadata(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, tiledb_datatype_t, unsigned int, void const*) group.h:246
    #6 0x10032cd60 in base_index_metadata<ivf_pq_metadata>::store_metadata(tiledb::Group&) index_metadata.h:331
    #7 0x10027bf9c in base_index_group<dummy_index>::~base_index_group() index_group.h:388
    #8 0x1003638b4 in ivf_pq_group<dummy_index>::~ivf_pq_group() ivf_pq_group.h:63
    #9 0x100270cb8 in ivf_pq_group<dummy_index>::~ivf_pq_group() ivf_pq_group.h:63
    #10 0x100241f90 in CATCH2_INTERNAL_TEST_8() unit_ivf_pq_group.cc:485
    #11 0x100661ab4 in Catch::TestInvokerAsFunction::invoke() const catch_test_case_registry_impl.cpp:149
    #12 0x10061d928 in Catch::TestCaseHandle::invoke() const catch_test_case_info.hpp:115
    #13 0x10061d6e4 in Catch::RunContext::invokeActiveTestCase() catch_run_context.cpp:538
    #14 0x100616d30 in Catch::RunContext::runCurrentTest(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&) catch_run_context.cpp:501
    #15 0x1006153d4 in Catch::RunContext::runTest(Catch::TestCaseHandle const&) catch_run_context.cpp:232
    #16 0x10049bff8 in Catch::(anonymous namespace)::TestGroup::execute() catch_session.cpp:110
    #17 0x100499e9c in Catch::Session::runInternal() catch_session.cpp:332
    #18 0x100499390 in Catch::Session::run() catch_session.cpp:263
    #19 0x10039d778 in int Catch::Session::run<char>(int, char const* const*) catch_session.hpp:41
    #20 0x10039d47c in main catch_main.cpp:36
    #21 0x196aee0dc  (<unknown module>)

Address 0x00016fbc6a58 is located in stack of thread T0 at offset 4824 in frame
    #0 0x1002357d0 in CATCH2_INTERNAL_TEST_8() unit_ivf_pq_group.cc:185

  This frame has 330 object(s):
    [32, 56) 'tmp_uri' (line 186)
    [96, 120) 'ref.tmp' (line 186)
    [160, 184) 'ref.tmp1' (line 186)
    [224, 248) 'ref.tmp2' (line 186)
    [288, 336) 'ctx' (line 198)
    [368, 416) 'vfs' (line 199)
    [448, 1248) 'x' (line 207)
    [1376, 1392) 'agg.tmp'
    [1408, 1432) 'ref.tmp30' (line 207)
    [1472, 2272) 'x49' (line 221)
    [2400, 2416) 'agg.tmp50'
    [2432, 2456) 'ref.tmp54' (line 221)
    [2496, 2568) 'catchAssertionHandler' (line 230)
    [2608, 2624) 'agg.tmp65'
    [2640, 2656) 'ref.tmp67' (line 230)
    [2672, 2688) 'agg.tmp69'
    [2704, 2752) 'ref.tmp75' (line 230)
    [2784, 2792) 'ref.tmp76' (line 230)
    [2816, 2817) 'ref.tmp77' (line 230)
    [2832, 2920) 'ref.tmp102' (line 232)
    [2960, 2976) 'ref.tmp103' (line 232)
    [2992, 3008) 'agg.tmp105'
    [3024, 3112) 'ref.tmp115' (line 233)
    [3152, 3168) 'ref.tmp116' (line 233)
    [3184, 3200) 'agg.tmp118'
    [3216, 3304) 'ref.tmp134' (line 236)
    [3344, 3360) 'ref.tmp135' (line 236)
    [3376, 3392) 'agg.tmp137'
    [3408, 4208) 'ref.tmp147' (line 237)
    [4336, 4352) 'agg.tmp148'
    [4368, 4392) 'ref.tmp152' (line 237)
    [4432, 4520) 'ref.tmp176' (line 240)
    [4560, 4576) 'ref.tmp177' (line 240)
    [4592, 4608) 'agg.tmp179'
    [4624, 5424) 'ref.tmp189' (line 241) <== Memory access at offset 4824 is inside this variable
    [5552, 5568) 'agg.tmp190'
    [5584, 5608) 'ref.tmp194' (line 241)
    [5648, 5720) 'catchAssertionHandler213' (line 250)
    [5760, 5776) 'agg.tmp214'
    [5792, 5808) 'ref.tmp216' (line 250)
    [5824, 5840) 'agg.tmp218'
    [5856, 5904) 'ref.tmp224' (line 250)
    [5936, 5944) 'ref.tmp225' (line 250)
    [5968, 5969) 'ref.tmp226' (line 250)
    [5984, 6072) 'ref.tmp263' (line 253)
    [6112, 6128) 'ref.tmp264' (line 253)
    [6144, 6160) 'agg.tmp266'
    [6176, 6976) 'ref.tmp276' (line 254)
    [7104, 7120) 'agg.tmp277'
    [7136, 7160) 'ref.tmp281' (line 254)
    [7200, 7272) 'catchAssertionHandler300' (line 263)
    [7312, 7328) 'agg.tmp301'
    [7344, 7360) 'ref.tmp303' (line 263)
    [7376, 7392) 'agg.tmp305'
    [7408, 7456) 'ref.tmp311' (line 263)
    [7488, 7496) 'ref.tmp312' (line 263)
    [7520, 7521) 'ref.tmp313' (line 263)
    [7536, 8336) 'ref.tmp344' (line 264)
    [8464, 8480) 'agg.tmp345'
    [8496, 8520) 'ref.tmp349' (line 264)
    [8560, 8648) 'ref.tmp373' (line 267)
    [8688, 8704) 'ref.tmp374' (line 267)
    [8720, 8736) 'agg.tmp376'
    [8752, 9552) 'ref.tmp386' (line 268)
    [9680, 9696) 'agg.tmp387'
    [9712, 9736) 'ref.tmp391' (line 268)
    [9776, 10576) 'ref.tmp409' (line 269)
    [10704, 10720) 'agg.tmp410'
    [10736, 10760) 'ref.tmp414' (line 269)
    [10800, 10872) 'catchAssertionHandler433' (line 278)
    [10912, 10928) 'agg.tmp434'
    [10944, 10960) 'ref.tmp436' (line 278)
    [10976, 10992) 'agg.tmp438'
    [11008, 11056) 'ref.tmp444' (line 278)
    [11088, 11096) 'ref.tmp445' (line 278)
    [11120, 11121) 'ref.tmp446' (line 278)
    [11136, 11224) 'ref.tmp493' (line 288)
    [11264, 11280) 'ref.tmp494' (line 288)
    [11296, 11312) 'agg.tmp496'
    [11328, 11416) 'ref.tmp506' (line 289)
    [11456, 11472) 'ref.tmp507' (line 289)
    [11488, 11504) 'agg.tmp509'
    [11520, 11608) 'ref.tmp525' (line 292)
    [11648, 11664) 'ref.tmp526' (line 292)
    [11680, 11696) 'agg.tmp528'
    [11712, 12512) 'ref.tmp538' (line 293)
    [12640, 12656) 'agg.tmp539'
    [12672, 12696) 'ref.tmp543' (line 293)
    [12736, 12824) 'ref.tmp567' (line 296)
    [12864, 12880) 'ref.tmp568' (line 296)
    [12896, 12912) 'agg.tmp570'
    [12928, 13728) 'ref.tmp580' (line 297)
    [13856, 13872) 'agg.tmp581'
    [13888, 13912) 'ref.tmp585' (line 297)
    [13952, 14024) 'catchAssertionHandler604' (line 306)
    [14064, 14080) 'agg.tmp605'
    [14096, 14112) 'ref.tmp607' (line 306)
    [14128, 14144) 'agg.tmp609'
    [14160, 14208) 'ref.tmp615' (line 306)
    [14240, 14248) 'ref.tmp616' (line 306)
    [14272, 14273) 'ref.tmp617' (line 306)
    [14288, 14376) 'ref.tmp654' (line 309)
    [14416, 14432) 'ref.tmp655' (line 309)
    [14448, 14464) 'agg.tmp657'
    [14480, 15280) 'ref.tmp667' (line 310)
    [15408, 15424) 'agg.tmp668'
    [15440, 15464) 'ref.tmp672' (line 310)
    [15504, 15576) 'catchAssertionHandler691' (line 319)
    [15616, 15632) 'agg.tmp692'
    [15648, 15664) 'ref.tmp694' (line 319)
    [15680, 15696) 'agg.tmp696'
    [15712, 15760) 'ref.tmp702' (line 319)
    [15792, 15800) 'ref.tmp703' (line 319)
    [15824, 15825) 'ref.tmp704' (line 319)
    [15840, 16640) 'ref.tmp735' (line 320)
    [16768, 16784) 'agg.tmp736'
    [16800, 16824) 'ref.tmp740' (line 320)
    [16864, 16952) 'ref.tmp764' (line 323)
    [16992, 17008) 'ref.tmp765' (line 323)
    [17024, 17040) 'agg.tmp767'
    [17056, 17856) 'ref.tmp777' (line 324)
    [17984, 18000) 'agg.tmp778'
    [18016, 18040) 'ref.tmp782' (line 324)
    [18080, 18880) 'ref.tmp800' (line 325)
    [19008, 19024) 'agg.tmp801'
    [19040, 19064) 'ref.tmp805' (line 325)
    [19104, 19176) 'catchAssertionHandler824' (line 334)
    [19216, 19232) 'agg.tmp825'
    [19248, 19264) 'ref.tmp827' (line 334)
    [19280, 19296) 'agg.tmp829'
    [19312, 19360) 'ref.tmp835' (line 334)
    [19392, 19400) 'ref.tmp836' (line 334)
    [19424, 19425) 'ref.tmp837' (line 334)
    [19440, 19528) 'ref.tmp884' (line 344)
    [19568, 19584) 'ref.tmp885' (line 344)
    [19600, 19616) 'agg.tmp887'
    [19632, 19720) 'ref.tmp897' (line 345)
    [19760, 19776) 'ref.tmp898' (line 345)
    [19792, 19808) 'agg.tmp900'
    [19824, 19912) 'ref.tmp916' (line 348)
    [19952, 19968) 'ref.tmp917' (line 348)
    [19984, 20000) 'agg.tmp919'
    [20016, 20816) 'ref.tmp929' (line 349)
    [20944, 20960) 'agg.tmp930'
    [20976, 21000) 'ref.tmp934' (line 349)
    [21040, 21128) 'ref.tmp958' (line 352)
    [21168, 21184) 'ref.tmp959' (line 352)
    [21200, 21216) 'agg.tmp961'
    [21232, 22032) 'ref.tmp971' (line 353)
    [22160, 22176) 'agg.tmp972'
    [22192, 22216) 'ref.tmp976' (line 353)
    [22256, 22328) 'catchAssertionHandler995' (line 362)
    [22368, 22384) 'agg.tmp996'
    [22400, 22416) 'ref.tmp998' (line 362)
    [22432, 22448) 'agg.tmp1000'
    [22464, 22512) 'ref.tmp1006' (line 362)
    [22544, 22552) 'ref.tmp1007' (line 362)
    [22576, 22577) 'ref.tmp1008' (line 362)
    [22592, 22680) 'ref.tmp1045' (line 365)
    [22720, 22736) 'ref.tmp1046' (line 365)
    [22752, 22768) 'agg.tmp1048'
    [22784, 23584) 'ref.tmp1058' (line 366)
    [23712, 23728) 'agg.tmp1059'
    [23744, 23768) 'ref.tmp1063' (line 366)
    [23808, 23880) 'catchAssertionHandler1082' (line 375)
    [23920, 23936) 'agg.tmp1083'
    [23952, 23968) 'ref.tmp1085' (line 375)
    [23984, 24000) 'agg.tmp1087'
    [24016, 24064) 'ref.tmp1093' (line 375)
    [24096, 24104) 'ref.tmp1094' (line 375)
    [24128, 24129) 'ref.tmp1095' (line 375)
    [24144, 24944) 'ref.tmp1126' (line 376)
    [25072, 25088) 'agg.tmp1127'
    [25104, 25128) 'ref.tmp1131' (line 376)
    [25168, 25256) 'ref.tmp1155' (line 379)
    [25296, 25312) 'ref.tmp1156' (line 379)
    [25328, 25344) 'agg.tmp1158'
    [25360, 26160) 'ref.tmp1168' (line 380)
    [26288, 26304) 'agg.tmp1169'
    [26320, 26344) 'ref.tmp1173' (line 380)
    [26384, 27184) 'ref.tmp1191' (line 381)
    [27312, 27328) 'agg.tmp1192'
    [27344, 27368) 'ref.tmp1196' (line 381)
    [27408, 27480) 'catchAssertionHandler1215' (line 390)
    [27520, 27536) 'agg.tmp1216'
    [27552, 27568) 'ref.tmp1218' (line 390)
    [27584, 27600) 'agg.tmp1220'
    [27616, 27664) 'ref.tmp1226' (line 390)
    [27696, 27704) 'ref.tmp1227' (line 390)
    [27728, 27729) 'ref.tmp1228' (line 390)
    [27744, 27816) 'catchAssertionHandler1278' (line 407)
    [27856, 27872) 'agg.tmp1279'
    [27888, 27904) 'ref.tmp1281' (line 407)
    [27920, 27936) 'agg.tmp1283'
    [27952, 28000) 'ref.tmp1289' (line 407)
    [28032, 28040) 'ref.tmp1290' (line 407)
    [28064, 28065) 'ref.tmp1291' (line 407)
    [28080, 28104) 'ref.tmp1292' (line 407)
    [28144, 28216) 'catchAssertionHandler1330' (line 408)
    [28256, 28272) 'agg.tmp1331'
    [28288, 28304) 'ref.tmp1333' (line 408)
    [28320, 28336) 'agg.tmp1335'
    [28352, 28400) 'ref.tmp1341' (line 408)
    [28432, 28440) 'ref.tmp1342' (line 408)
    [28464, 28465) 'ref.tmp1343' (line 408)
    [28480, 28504) 'ref.tmp1344' (line 408)
    [28544, 28616) 'catchAssertionHandler1382' (line 409)
    [28656, 28672) 'agg.tmp1383'
    [28688, 28704) 'ref.tmp1385' (line 409)
    [28720, 28736) 'agg.tmp1387'
    [28752, 28800) 'ref.tmp1393' (line 409)
    [28832, 28840) 'ref.tmp1394' (line 409)
    [28864, 28865) 'ref.tmp1395' (line 409)
    [28880, 28904) 'ref.tmp1396' (line 409)
    [28944, 29032) 'ref.tmp1439' (line 412)
    [29072, 29088) 'ref.tmp1440' (line 412)
    [29104, 29120) 'agg.tmp1442'
    [29136, 29224) 'ref.tmp1452' (line 413)
    [29264, 29280) 'ref.tmp1453' (line 413)
    [29296, 29312) 'agg.tmp1455'
    [29328, 29416) 'ref.tmp1471' (line 416)
    [29456, 29472) 'ref.tmp1472' (line 416)
    [29488, 29504) 'agg.tmp1474'
    [29520, 30320) 'ref.tmp1484' (line 417)
    [30448, 30464) 'agg.tmp1485'
    [30480, 30504) 'ref.tmp1489' (line 417)
    [30544, 30632) 'ref.tmp1513' (line 420)
    [30672, 30688) 'ref.tmp1514' (line 420)
    [30704, 30720) 'agg.tmp1516'
    [30736, 31536) 'ref.tmp1526' (line 421)
    [31664, 31680) 'agg.tmp1527'
    [31696, 31720) 'ref.tmp1531' (line 421)
    [31760, 31832) 'catchAssertionHandler1550' (line 430)
    [31872, 31888) 'agg.tmp1551'
    [31904, 31920) 'ref.tmp1553' (line 430)
    [31936, 31952) 'agg.tmp1555'
    [31968, 32016) 'ref.tmp1561' (line 430)
    [32048, 32056) 'ref.tmp1562' (line 430)
    [32080, 32081) 'ref.tmp1563' (line 430)
    [32096, 32184) 'ref.tmp1600' (line 433)
    [32224, 32240) 'ref.tmp1601' (line 433)
    [32256, 32272) 'agg.tmp1603'
    [32288, 33088) 'ref.tmp1613' (line 434)
    [33216, 33232) 'agg.tmp1614'
    [33248, 33272) 'ref.tmp1618' (line 434)
    [33312, 33384) 'catchAssertionHandler1637' (line 443)
    [33424, 33440) 'agg.tmp1638'
    [33456, 33472) 'ref.tmp1640' (line 443)
    [33488, 33504) 'agg.tmp1642'
    [33520, 33568) 'ref.tmp1648' (line 443)
    [33600, 33608) 'ref.tmp1649' (line 443)
    [33632, 33633) 'ref.tmp1650' (line 443)
    [33648, 34448) 'ref.tmp1681' (line 444)
    [34576, 34592) 'agg.tmp1682'
    [34608, 34632) 'ref.tmp1686' (line 444)
    [34672, 34760) 'ref.tmp1710' (line 447)
    [34800, 34816) 'ref.tmp1711' (line 447)
    [34832, 34848) 'agg.tmp1713'
    [34864, 35664) 'ref.tmp1723' (line 448)
    [35792, 35808) 'agg.tmp1724'
    [35824, 35848) 'ref.tmp1728' (line 448)
    [35888, 36688) 'ref.tmp1746' (line 449)
    [36816, 36832) 'agg.tmp1747'
    [36848, 36872) 'ref.tmp1751' (line 449)
    [36912, 36984) 'catchAssertionHandler1770' (line 458)
    [37024, 37040) 'agg.tmp1771'
    [37056, 37072) 'ref.tmp1773' (line 458)
    [37088, 37104) 'agg.tmp1775'
    [37120, 37168) 'ref.tmp1781' (line 458)
    [37200, 37208) 'ref.tmp1782' (line 458)
    [37232, 37233) 'ref.tmp1783' (line 458)
    [37248, 37320) 'catchAssertionHandler1834' (line 475)
    [37360, 37376) 'agg.tmp1835'
    [37392, 37408) 'ref.tmp1837' (line 475)
    [37424, 37440) 'agg.tmp1839'
    [37456, 37504) 'ref.tmp1845' (line 475)
    [37536, 37544) 'ref.tmp1846' (line 475)
    [37568, 37569) 'ref.tmp1847' (line 475)
    [37584, 37608) 'ref.tmp1848' (line 475)
    [37648, 37720) 'catchAssertionHandler1886' (line 476)
    [37760, 37776) 'agg.tmp1887'
    [37792, 37808) 'ref.tmp1889' (line 476)
    [37824, 37840) 'agg.tmp1891'
    [37856, 37904) 'ref.tmp1897' (line 476)
    [37936, 37944) 'ref.tmp1898' (line 476)
    [37968, 37969) 'ref.tmp1899' (line 476)
    [37984, 38008) 'ref.tmp1900' (line 476)
    [38048, 38120) 'catchAssertionHandler1938' (line 477)
    [38160, 38176) 'agg.tmp1939'
    [38192, 38208) 'ref.tmp1941' (line 477)
    [38224, 38240) 'agg.tmp1943'
    [38256, 38304) 'ref.tmp1949' (line 477)
    [38336, 38344) 'ref.tmp1950' (line 477)
    [38368, 38369) 'ref.tmp1951' (line 477)
    [38384, 38408) 'ref.tmp1952' (line 477)
    [38448, 38520) 'catchAssertionHandler1996' (line 480)
    [38560, 38576) 'agg.tmp1997'
    [38592, 38608) 'ref.tmp1999' (line 480)
    [38624, 38640) 'agg.tmp2001'
    [38656, 38704) 'ref.tmp2007' (line 480)
    [38736, 38744) 'ref.tmp2008' (line 480)
    [38768, 38769) 'ref.tmp2009' (line 480)
    [38784, 38856) 'catchAssertionHandler2043' (line 481)
    [38896, 38912) 'agg.tmp2044'
    [38928, 38944) 'ref.tmp2046' (line 481)
    [38960, 38976) 'agg.tmp2048'
    [38992, 39040) 'ref.tmp2054' (line 481)
    [39072, 39080) 'ref.tmp2055' (line 481)
    [39104, 39105) 'ref.tmp2056' (line 481)
    [39120, 39192) 'catchAssertionHandler2090' (line 482)
    [39232, 39248) 'agg.tmp2091'
    [39264, 39280) 'ref.tmp2093' (line 482)
    [39296, 39312) 'agg.tmp2095'
    [39328, 39376) 'ref.tmp2101' (line 482)
    [39408, 39416) 'ref.tmp2102' (line 482)
    [39440, 39441) 'ref.tmp2103' (line 482)
    [39456, 39528) 'catchAssertionHandler2137' (line 483)
    [39568, 39584) 'agg.tmp2138'
    [39600, 39616) 'ref.tmp2140' (line 483)
    [39632, 39648) 'agg.tmp2142'
    [39664, 39712) 'ref.tmp2148' (line 483)
    [39744, 39752) 'ref.tmp2149' (line 483)
    [39776, 39777) 'ref.tmp2150' (line 483)
    [39792, 39864) 'catchAssertionHandler2184' (line 484)
    [39904, 39920) 'agg.tmp2185'
    [39936, 39952) 'ref.tmp2187' (line 484)
    [39968, 39984) 'agg.tmp2189'
    [40000, 40048) 'ref.tmp2195' (line 484)
    [40080, 40088) 'ref.tmp2196' (line 484)
    [40112, 40113) 'ref.tmp2197' (line 484)
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-use-after-scope (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x1ac34) in wrap_memcpy+0x3fc
Shadow bytes around the buggy address:
  0x00016fbc6780: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f2 f2
  0x00016fbc6800: f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 00 00
  0x00016fbc6880: f2 f2 f8 f8 f8 f2 f2 f2 f2 f2 f8 f8 f8 f8 f8 f8
  0x00016fbc6900: f8 f8 f8 f8 f8 f2 f2 f2 f2 f2 f8 f8 f2 f2 00 00
  0x00016fbc6980: f2 f2 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
=>0x00016fbc6a00: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8[f8]f8 f8 f8 f8
  0x00016fbc6a80: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
  0x00016fbc6b00: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
  0x00016fbc6b80: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
  0x00016fbc6c00: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
  0x00016fbc6c80: f8 f8 f8 f8 f8 f8 f2 f2 f2 f2 f2 f2 f2 f2 f2 f2
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
==32117==ABORTING

We fix this by moving the saving of metadata to be an explicit call. This is also a nicer pattern to reason about, as having it in the destructor was a somewhat strange pattern.

Testing

Tests pass.

@jparismorgan jparismorgan marked this pull request as ready for review August 2, 2024 12:20
Copy link
Collaborator

@NikolaosPapailiou NikolaosPapailiou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice change!

@jparismorgan jparismorgan merged commit 3488a50 into main Aug 2, 2024
6 checks passed
@jparismorgan jparismorgan deleted the joarismorgan/remove-dtor branch August 2, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants