gcc does not support leak sanitizer

Bug #1522423 reported by jeremad
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gcc-4.9 (Ubuntu)
Confirmed
Undecided
Unassigned

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)

Revision history for this message
jeremad (j2jey) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gcc-4.9 (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.