[Bug 1522423] [NEW] gcc does not support leak sanitizer

jeremad j2jey at hotmail.com
Thu Dec 3 14:02:31 UTC 2015


Public bug reported:

I'm using ubuntu 15.04
I'm trying to use the "leak sanitizer" feature of address sanitizer in stand alone.

Here is the a simple code example:

#include <stdlib.h> 
 
int main(){ 
    malloc(1); 
    return 0; 
} 

Compiled with gcc-4.9 -g -fsanitize=leak and running the program, I observe no output, and the binary does not link to /usr/lib64/liblsan.so while it should.
With clang or the gcc-5 of ubuntu 15.04 (5.1.1) it works fine, I have the expected output:

=================================================================
==7779==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 1 byte(s) in 1 object(s) allocated from:
    #0 0x7f3d7f94f9a5 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/liblsan.so.0+0xc9a5)
    #1 0x4006b3 in main /home/tellaa/dev/clang_test/main.cpp:4
    #2 0x7f3d7f599a3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x20a3f)

SUMMARY: LeakSanitizer: 1 byte(s) leaked in 1 allocation(s).

For the record:
-the gcc of ubuntu 15.10 (gcc-5.2.1) does not work either.
- I compiled gcc from source, and it worked

http://stackoverflow.com/questions/31210053/gcc-and-fsanitize-leak

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: gcc-4.9 4.9.2-10ubuntu13
ProcVersionSignature: Ubuntu 3.19.0-18.18-generic 3.19.6
Uname: Linux 3.19.0-18-generic x86_64
NonfreeKernelModules: nvidia_uvm nvidia
ApportVersion: 2.17.2-0ubuntu1.1
Architecture: amd64
Date: Thu Dec  3 14:52:46 2015
InstallationDate: Installed on 2015-05-26 (191 days ago)
InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Release amd64 (20150422)
SourcePackage: gcc-4.9
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: gcc-4.9 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug third-party-packages vivid

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

Title:
  gcc does not support leak sanitizer

Status in gcc-4.9 package in Ubuntu:
  New

Bug description:
  I'm using ubuntu 15.04
  I'm trying to use the "leak sanitizer" feature of address sanitizer in stand alone.

  Here is the a simple code example:

  #include <stdlib.h> 
   
  int main(){ 
      malloc(1); 
      return 0; 
  } 

  Compiled with gcc-4.9 -g -fsanitize=leak and running the program, I observe no output, and the binary does not link to /usr/lib64/liblsan.so while it should.
  With clang or the gcc-5 of ubuntu 15.04 (5.1.1) it works fine, I have the expected output:

  =================================================================
  ==7779==ERROR: LeakSanitizer: detected memory leaks

  Direct leak of 1 byte(s) in 1 object(s) allocated from:
      #0 0x7f3d7f94f9a5 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/liblsan.so.0+0xc9a5)
      #1 0x4006b3 in main /home/tellaa/dev/clang_test/main.cpp:4
      #2 0x7f3d7f599a3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x20a3f)

  SUMMARY: LeakSanitizer: 1 byte(s) leaked in 1 allocation(s).

  For the record:
  -the gcc of ubuntu 15.10 (gcc-5.2.1) does not work either.
  - I compiled gcc from source, and it worked

  http://stackoverflow.com/questions/31210053/gcc-and-fsanitize-leak

  ProblemType: Bug
  DistroRelease: Ubuntu 15.04
  Package: gcc-4.9 4.9.2-10ubuntu13
  ProcVersionSignature: Ubuntu 3.19.0-18.18-generic 3.19.6
  Uname: Linux 3.19.0-18-generic x86_64
  NonfreeKernelModules: nvidia_uvm nvidia
  ApportVersion: 2.17.2-0ubuntu1.1
  Architecture: amd64
  Date: Thu Dec  3 14:52:46 2015
  InstallationDate: Installed on 2015-05-26 (191 days ago)
  InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Release amd64 (20150422)
  SourcePackage: gcc-4.9
  UpgradeStatus: No upgrade log present (probably fresh install)

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



More information about the foundations-bugs mailing list