applications compiled with tsan (-fsanitize=thread) option fail to start with 3.19.0-41-generic kernel

Bug #1527599 reported by Dmitry
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-lts-vivid (Ubuntu)
New
Undecided
Unassigned

Bug Description

Consider the following code:
# cat test.c
int main()
{
        return 0;
}

Now compile it with clang-3.5 and -fsanitize=thread option and run:
# clang-3.5 -fsanitize=thread -fPIE -pie test.c
# ./a.out
FATAL: ThreadSanitizer can not mmap the shadow memory (something is mapped at 0x5650b0bb2000 < 0x7cf000000000)
FATAL: Make sure to compile with -fPIE and to link with -pie.
# cat /proc/sys/kernel/randomize_va_space
2
# uname -a
Linux mikhin2 3.19.0-41-generic #46~14.04.2-Ubuntu SMP Tue Dec 8 17:46:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

This regression appears in 3.19.0-41-generic kernel. The example above runs fine (without FATAL errors) with previous 3.19.0-39-generic kernel.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: linux-image-3.19.0-41-generic 3.19.0-41.46~14.04.2
ProcVersionSignature: Ubuntu 3.19.0-39.44~14.04.1-generic 3.19.8-ckt9
Uname: Linux 3.19.0-39-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.19
Architecture: amd64
CurrentDesktop: XFCE
Date: Fri Dec 18 14:53:45 2015
InstallationDate: Installed on 2015-12-14 (4 days ago)
InstallationMedia: Xubuntu 14.04.3 LTS "Trusty Tahr" - Beta amd64 (20150805)
SourcePackage: linux-lts-vivid
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Dmitry (mikhin) wrote :
Dmitry (mikhin)
description: updated
summary: - applications compiled with tsan (-fsanitize=thread) option fails to
- start with 3.19.0-41-generic kernel
+ applications compiled with tsan (-fsanitize=thread) option fail to start
+ with 3.19.0-41-generic kernel
Revision history for this message
Dmitry (mikhin) wrote :

The problem is still present in 3.19.0-42-generic kernel.
After bisecting code, I've found that problem was introduced by 06ec92f3bac598a7a9b9ecf451ab1915929a5980 commit - http://kernel.ubuntu.com/git/ubuntu/ubuntu-vivid.git/commit/?id=06ec92f3bac598a7a9b9ecf451ab1915929a5980

Revision history for this message
Dmitry (mikhin) wrote :

https://github.com/google/sanitizers/issues/503
Looks like I should update compiler and not use -pie option any more.

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.