Comment 1 for bug 1726816

Revision history for this message
Tim Burke (1-tim-z) wrote :

OK, finally got around to repro'ing! For anyone not familiar with -fsanitize=address (I wasn't), you'll need to install libasan and run something like

 CFLAGS=-fsanitize=address ./configure

when configuring. When running tests, I got

 ERROR: AddressSanitizer: odr-violation (0x7fcbcae09020):
   [1] size=8 'ilog_table_begin' builtin/rs_vand/rs_galois.c:46:6
   [2] size=8 'ilog_table_begin' rs_galois.c:46:6
 These globals were registered at these points:
   ...

but taking the hint and running with something like

 ASAN_OPTIONS=detect_odr_violation=0 make test

I could repro the reported issue. It took me a bit to make sense of what it was telling me -- when running the decode benchmark with k=6, m=6, hd=4 the array indexing at https://opendev.org/openstack/liberasurecode/src/branch/master/src/builtin/xor_codes/xor_hd_code.c#L159 could leave the bounds of g_6_6_4_hd_code_parity_bms. Specifically, you could have parity_index == -1, leading to the code trying to index with [-7] (which with 4-byte ints gets us the 28-byte offset mentioned).