GCC 5.3.0: ASAN gives "unknown-crash" error

Paul Smith paul@mad-scientist.net
Mon Jan 11 05:28:00 GMT 2016


On Sun, 2016-01-10 at 22:45 -0500, Paul Smith wrote:
> On Sun, 2016-01-10 at 22:04 -0500, Paul Smith wrote:
> > ==7750==ERROR: AddressSanitizer: unknown-crash on address
> > 0x7f8522ce3850 
> >   at pc 0x0000008a3784 bp 0x7fff20876dd0 sp 0x7fff20876dc8
> >   WRITE of size 800008 at 0x7f8522ce3850 thread T0
> 
> FWIW I just rebuilt my code with the system compiler that comes with my
> system (Ubuntu GNOME 15.10), "gcc (Ubuntu 5.2.1-22ubuntu2) 5.2.1
> 20151010" and I see identical behavior to this there as well.

More info: if I recompile my code without -O2 then it no longer displays
this error.  I was using -O2 because I was getting linker errors without
it in 4.9.0 but that may have been some other issue.

Also, the shadow map printed when I see this error (with -O2) looks
clean:

Shadow bytes around the buggy address:
  0x0ff49ab216b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ff49ab216c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ff49ab216d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ff49ab216e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ff49ab216f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0ff49ab21700: 00 00 00 00 00 00 00 00 00 00[00]00 00 00 00 00
  0x0ff49ab21710: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ff49ab21720: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ff49ab21730: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ff49ab21740: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ff49ab21750: 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

To me this looks like a bug, maybe a mismatch between ASAN and the
optimizer.



More information about the Gcc-help mailing list