I have a set of unit tests that I know more or less "work" on this code base I'm working on. No null pointers get dereferenced during normal execution, system memory usage doesn't exceed 8GB or so out of 16 in a 64-bit address space....
When I compile with Address Sanitizer, I get a crash. Okay, I was expecting that, it's an ugly code base. But I've worked with ASan before and it gave me output pointing to where bad memory is being dereferenced and where it was last freed and allocated.
Now, before anyone jumps down my throat about answered questions regarding the use of llvm-symbolizer, that is not what I mean and does not help me. The llvm-symbolizer is relevant when you see "lines of code from your binary, not your source". I'm see no lines referenced at all. It just looks like:
Stats: LargeMmapAllocator: allocated 0 times, remains 0 (0 K) max 0 M; by size logs: Stats: 1M malloced (0M for red zones) by 18495 calls Stats: 0M realloced by 3 calls Stats: 0M freed by 7871 calls Stats: 0M really freed by 0 calls Stats: 5M (5M-0M) mmaped; 71 maps, 0 unmaps mmaps by size class: mallocs by size class: 2:6421; 3:2411; 4:5634; 6:2135; 7:614; 8:138; 11:74; 12:111; 13:182; 14:36; 15:126; 16:14; 17:25; 18:32; 19:9; 20:8; 21:6; 22:2; 23:1; 24:1; 26:228; 27:50; 29:3; 33:5; 34:10; 36:2; 37:1; 38:190; 41:4; 42:1; 43:4; 45:4; 49:1; 53:3; 57:6; 62:2; 65:1; frees by size class: rfrees by size class: Stats: malloc large: 0 small slow: 0 Stats: StackDepot: 5128 ids; 0M mapped Stats: SizeClassAllocator64: 5M mapped in 25115 allocations; remains 25115 02 (32): total: 256 K allocs: 6656 remains: 6656 03 (48): total: 192 K allocs: 3584 remains: 3584 04 (64): total: 448 K allocs: 6400 remains: 6400 06 (96): total: 320 K allocs: 3072 remains: 3072 07 (112): total: 128 K allocs: 768 remains: 768 08 (128): total: 64 K allocs: 256 remains: 256 11 (176): total: 64 K allocs: 256 remains: 256 12 (192): total: 64 K allocs: 256 remains: 256 13 (208): total: 64 K allocs: 256 remains: 256 14 (224): total: 64 K allocs: 256 remains: 256 15 (240): total: 64 K allocs: 256 remains: 256 16 (256): total: 128 K allocs: 256 remains: 256 17 (288): total: 128 K allocs: 227 remains: 227 18 (320): total: 128 K allocs: 204 remains: 204 19 (352): total: 128 K allocs: 186 remains: 186 20 (384): total: 128 K allocs: 170 remains: 170 21 (416): total: 128 K allocs: 157 remains: 157 22 (448): total: 128 K allocs: 146 remains: 146 23 (480): total: 128 K allocs: 136 remains: 136 24 (512): total: 128 K allocs: 128 remains: 128 26 (640): total: 192 K allocs: 306 remains: 306 27 (704): total: 320 K allocs: 372 remains: 372 29 (832): total: 128 K allocs: 78 remains: 78 33 (1152): total: 128 K allocs: 56 remains: 56 34 (1280): total: 128 K allocs: 51 remains: 51 36 (1536): total: 128 K allocs: 42 remains: 42 37 (1664): total: 128 K allocs: 39 remains: 39 38 (1792): total: 576 K allocs: 324 remains: 324 41 (2304): total: 192 K allocs: 84 remains: 84 42 (2560): total: 128 K allocs: 25 remains: 25 43 (2816): total: 128 K allocs: 23 remains: 23 45 (3328): total: 128 K allocs: 19 remains: 19 49 (4608): total: 128 K allocs: 14 remains: 14 53 (6656): total: 128 K allocs: 9 remains: 9 57 (9216): total: 448 K allocs: 42 remains: 42 62 (14336): total: 128 K allocs: 4 remains: 4 65 (18432): total: 64 K allocs: 1 remains: 1 Stats: LargeMmapAllocator: allocated 0 times, remains 0 (0 K) max 0 M; by size logs: ERROR: Failed to mmap
There are also a bunch more similar "stats" lines, including the long blocks of SizeClassAllocator64 data, before all of this, but none of it points to my error as far as I can tell, so I just copy-pasted the error and the most recent page of stats.
A bit of googling makes it sound like it thinks I'm out of memory, but like I said, when I'm running this program without asan I don't get close to OOM.
Edit: and this crash happens within seconds, before we should have even allocated 3GB or so.
Aucun commentaire:
Enregistrer un commentaire