[Bug 1858794] Re: AddressSanitizer with LTO does not show file name and line number in backtrace

Abhay Sachan 1858794 at bugs.launchpad.net
Wed Jan 8 13:52:37 UTC 2020


** Description changed:

  Using ASan/UBSan with LTO leads to printing of only hex offsets in the
  stacktraces. The issue seems to be fixed in gcc-9 on Eoan, but it doesnt
  work with bionic gcc-8.
  
  There is a GCC bug for this, which was fixed an year ago, but it is not
- there in bionin gcc-8.
+ there in bionic gcc-8.
  
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78063
  
  I have attached a simple test program to demonstrate the problem, which
  is compiled with following options:
  
  $ gcc -flto -g -fsanitize=address -o leak leak.c
- 
  
  With bionic, gcc-8 gives:
  
  Direct leak of 4 byte(s) in 1 object(s) allocated from:
      #0 0x7f35f6106f00 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:86
      #1 0x56193a9fb7f6 in leak (/home/asachan/leak+0x7f6)
      #2 0x56193a9fb812 in main (/home/asachan/leak+0x812)
      #3 0x7f35f5c49b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
  
  With Eoan, gcc-9 gives:
  
  Direct leak of 4 byte(s) in 1 object(s) allocated from:
      #0 0x7fb3baa7eae8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dae8)
      #1 0x55c775c2e16a in leak /home/asachan/kachra/leak.c:7
      #2 0x55c775c2e186 in main /home/asachan/kachra/leak.c:13
      #3 0x7fb3ba7a71e2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x271e2)
  
  The fix seems to be in libbacktrace, which gets picked up in
  libsanitizer as well:
  
  https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=268663

** Description changed:

  Using ASan/UBSan with LTO leads to printing of only hex offsets in the
  stacktraces. The issue seems to be fixed in gcc-9 on Eoan, but it doesnt
  work with bionic gcc-8.
  
  There is a GCC bug for this, which was fixed an year ago, but it is not
  there in bionic gcc-8.
  
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78063
  
  I have attached a simple test program to demonstrate the problem, which
  is compiled with following options:
  
  $ gcc -flto -g -fsanitize=address -o leak leak.c
  
  With bionic, gcc-8 gives:
  
  Direct leak of 4 byte(s) in 1 object(s) allocated from:
      #0 0x7f35f6106f00 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:86
      #1 0x56193a9fb7f6 in leak (/home/asachan/leak+0x7f6)
      #2 0x56193a9fb812 in main (/home/asachan/leak+0x812)
      #3 0x7f35f5c49b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
  
  With Eoan, gcc-9 gives:
  
  Direct leak of 4 byte(s) in 1 object(s) allocated from:
      #0 0x7fb3baa7eae8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dae8)
      #1 0x55c775c2e16a in leak /home/asachan/kachra/leak.c:7
      #2 0x55c775c2e186 in main /home/asachan/kachra/leak.c:13
      #3 0x7fb3ba7a71e2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x271e2)
  
  The fix seems to be in libbacktrace, which gets picked up in
  libsanitizer as well:
  
  https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=268663
+ 
+ In case you are trying to reproduce this issue in Eoan with gcc-8, it wont be visible because libasan is same for gcc-8 and gcc-9, and libasan
+ for gcc-9 has the fix which works for gcc-8 as well.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-8 in Ubuntu.
https://bugs.launchpad.net/bugs/1858794

Title:
  AddressSanitizer with LTO does not show file name and line number in
  backtrace

Status in gcc-8 package in Ubuntu:
  New

Bug description:
  Using ASan/UBSan with LTO leads to printing of only hex offsets in the
  stacktraces. The issue seems to be fixed in gcc-9 on Eoan, but it
  doesnt work with bionic gcc-8.

  There is a GCC bug for this, which was fixed an year ago, but it is
  not there in bionic gcc-8.

  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78063

  I have attached a simple test program to demonstrate the problem,
  which is compiled with following options:

  $ gcc -flto -g -fsanitize=address -o leak leak.c

  With bionic, gcc-8 gives:

  Direct leak of 4 byte(s) in 1 object(s) allocated from:
      #0 0x7f35f6106f00 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:86
      #1 0x56193a9fb7f6 in leak (/home/asachan/leak+0x7f6)
      #2 0x56193a9fb812 in main (/home/asachan/leak+0x812)
      #3 0x7f35f5c49b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

  With Eoan, gcc-9 gives:

  Direct leak of 4 byte(s) in 1 object(s) allocated from:
      #0 0x7fb3baa7eae8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dae8)
      #1 0x55c775c2e16a in leak /home/asachan/kachra/leak.c:7
      #2 0x55c775c2e186 in main /home/asachan/kachra/leak.c:13
      #3 0x7fb3ba7a71e2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x271e2)

  The fix seems to be in libbacktrace, which gets picked up in
  libsanitizer as well:

  https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=268663

  In case you are trying to reproduce this issue in Eoan with gcc-8, it wont be visible because libasan is same for gcc-8 and gcc-9, and libasan
  for gcc-9 has the fix which works for gcc-8 as well.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-8/+bug/1858794/+subscriptions



More information about the foundations-bugs mailing list