1 // This test-case exposes a bug that was present in the compressed V bit
2 // handling for a while. The problem was that when
3 // copy_address_range_state() copied a VA_BITS2_OTHER value, it failed to
4 // also copy the corresponding entry in the sec-V-bits table. Then later on
5 // when we searched for the sec-V-bits entry for the copied-to location, it
8 // Memcheck: mc_main.c:766 (get_sec_vbits8): Assertion 'n' failed.
9 // Memcheck: get_sec_vbits8: no node for address 0x4017440 (0x4017441)
16 char* x
= malloc(1000);
18 // Write some PDBs (partially defined bytes)
19 for (i
= 0; i
< 1000; i
++)
22 // realloc them, invoking copy_address_range_state()
23 x
= realloc(x
, 10000);
25 // Read the PDBs -- this caused a sec-V-bits lookup failure.
26 for (i
= 0; i
< 1000; i
++)