Skip to content

misc/cgo/testsanitizers: for MemorySanitizer, Linux kernel ≥ 4.1 requires clang ≥ 3.8.0 #12898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mewmew opened this issue Oct 10, 2015 · 9 comments
Milestone

Comments

@mewmew
Copy link
Contributor

mewmew commented Oct 10, 2015

I get this error while running all.bash. It looks similar issue #12814, but as I've got GCC installed, I don't think it is related to Clang. (also, my installed version of Clang is above 3.6). Re-posting this in a separate issue, per Ian's request

[~]$ gcc --version
gcc (GCC) 5.2.0
[~]$ clang --version
clang version 3.7.0 (tags/RELEASE_370/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
[~]$ go version
go version devel +ae31599 Thu Oct 8 23:15:40 2015 +0000 linux/amd64
[~]$ uname -a
Linux x220 4.2.2-1-ARCH #1 SMP PREEMPT Tue Sep 29 22:21:33 CEST 2015 x86_64 GNU/Linux

And the error is as follows:

##### ../misc/cgo/testsanitizers
FATAL: Code 0x55b1cb4d8e20 is out of application range. Non-PIE build?
FATAL: MemorySanitizer can not mmap the shadow memory.
FATAL: Make sure to compile with -fPIE and to link with -pie.
FATAL: Disabling ASLR is known to cause this error.
FATAL: If running under GDB, try 'set disable-randomization off'.
==21153==Process memory map follows:
    0x55b1cb3f6000-0x55b1cb6fa000   /tmp/go-build208042185/command-line-arguments/_obj/exe/msan
    0x55b1cb8f9000-0x55b1cb901000   /tmp/go-build208042185/command-line-arguments/_obj/exe/msan
    0x55b1cb901000-0x55b1cdd9c000   
    0x7f0a2addf000-0x7f0a2b131000   
    0x7f0a2b131000-0x7f0a2b2cc000   /usr/lib/libc-2.22.so
    0x7f0a2b2cc000-0x7f0a2b4cb000   /usr/lib/libc-2.22.so
    0x7f0a2b4cb000-0x7f0a2b4cf000   /usr/lib/libc-2.22.so
    0x7f0a2b4cf000-0x7f0a2b4d1000   /usr/lib/libc-2.22.so
    0x7f0a2b4d1000-0x7f0a2b4d5000   
    0x7f0a2b4d5000-0x7f0a2b4eb000   /usr/lib/libgcc_s.so.1
    0x7f0a2b4eb000-0x7f0a2b6ea000   /usr/lib/libgcc_s.so.1
    0x7f0a2b6ea000-0x7f0a2b6eb000   /usr/lib/libgcc_s.so.1
    0x7f0a2b6eb000-0x7f0a2b6ee000   /usr/lib/libdl-2.22.so
    0x7f0a2b6ee000-0x7f0a2b8ed000   /usr/lib/libdl-2.22.so
    0x7f0a2b8ed000-0x7f0a2b8ee000   /usr/lib/libdl-2.22.so
    0x7f0a2b8ee000-0x7f0a2b8ef000   /usr/lib/libdl-2.22.so
    0x7f0a2b8ef000-0x7f0a2b9ec000   /usr/lib/libm-2.22.so
    0x7f0a2b9ec000-0x7f0a2bbeb000   /usr/lib/libm-2.22.so
    0x7f0a2bbeb000-0x7f0a2bbec000   /usr/lib/libm-2.22.so
    0x7f0a2bbec000-0x7f0a2bbed000   /usr/lib/libm-2.22.so
    0x7f0a2bbed000-0x7f0a2bbf4000   /usr/lib/librt-2.22.so
    0x7f0a2bbf4000-0x7f0a2bdf3000   /usr/lib/librt-2.22.so
    0x7f0a2bdf3000-0x7f0a2bdf4000   /usr/lib/librt-2.22.so
    0x7f0a2bdf4000-0x7f0a2bdf5000   /usr/lib/librt-2.22.so
    0x7f0a2bdf5000-0x7f0a2be0d000   /usr/lib/libpthread-2.22.so
    0x7f0a2be0d000-0x7f0a2c00c000   /usr/lib/libpthread-2.22.so
    0x7f0a2c00c000-0x7f0a2c00d000   /usr/lib/libpthread-2.22.so
    0x7f0a2c00d000-0x7f0a2c00e000   /usr/lib/libpthread-2.22.so
    0x7f0a2c00e000-0x7f0a2c012000   
    0x7f0a2c012000-0x7f0a2c034000   /usr/lib/ld-2.22.so
    0x7f0a2c216000-0x7f0a2c21b000   
    0x7f0a2c229000-0x7f0a2c233000   
    0x7f0a2c233000-0x7f0a2c234000   /usr/lib/ld-2.22.so
    0x7f0a2c234000-0x7f0a2c235000   /usr/lib/ld-2.22.so
    0x7f0a2c235000-0x7f0a2c236000   
    0x7ffdda888000-0x7ffdda8a9000   [stack]
    0x7ffdda9ba000-0x7ffdda9bc000   [vvar]
    0x7ffdda9bc000-0x7ffdda9be000   [vdso]
    0xffffffffff600000-0xffffffffff601000   [vsyscall]
==21153==End of process memory map.
exit status 77

Please let me know if any other information is required.

@bradfitz
Copy link
Contributor

Which distro?

@mewmew
Copy link
Contributor Author

mewmew commented Oct 10, 2015

Arch Linux.

@ianlancetaylor
Copy link
Member

What does cc --version print?

@mewmew
Copy link
Contributor Author

mewmew commented Oct 20, 2015

[~]$ cc --version
cc (GCC) 5.2.0

@rsc rsc changed the title cgo/testsanitizers: MemorySanitizer can not mmap the shadow memory. misc/cgo/testsanitizers: MemorySanitizer can not mmap the shadow memory. Oct 23, 2015
@rsc rsc added this to the Go1.6 milestone Oct 23, 2015
@0xmohit
Copy link
Contributor

0xmohit commented Oct 29, 2015

Also observing it on ubuntu 15.10.

$  gcc --version
gcc (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$  uname -a
Linux earth 4.2.0-16-generic #19-Ubuntu SMP Thu Oct 8 15:35:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Must add that I'd never run into this earlier (upgraded recently from ubuntu 15.04 which had gcc 4.9.x and kernel 3.19.0.31).

Relevant output from bash all.bash:

##### ../misc/cgo/testsanitizers
FATAL: Code 0x5631fe1914e0 is out of application range. Non-PIE build?
FATAL: MemorySanitizer can not mmap the shadow memory.
FATAL: Make sure to compile with -fPIE and to link with -pie.
FATAL: Disabling ASLR is known to cause this error.
FATAL: If running under GDB, try 'set disable-randomization off'.
==26340==Process memory map follows:
    0x5631fe08f000-0x5631fe3c4000   /tmp/go-build478133321/command-line-arguments/_obj/exe/msan
    0x5631fe5c4000-0x5631fe5cc000   /tmp/go-build478133321/command-line-arguments/_obj/exe/msan
    0x5631fe5cc000-0x563200a5d000   
    0x7f70c8f3e000-0x7f70c9290000   
    0x7f70c9290000-0x7f70c9450000   /lib/x86_64-linux-gnu/libc-2.21.so
    0x7f70c9450000-0x7f70c9650000   /lib/x86_64-linux-gnu/libc-2.21.so
    0x7f70c9650000-0x7f70c9654000   /lib/x86_64-linux-gnu/libc-2.21.so
    0x7f70c9654000-0x7f70c9656000   /lib/x86_64-linux-gnu/libc-2.21.so
    0x7f70c9656000-0x7f70c965a000   
    0x7f70c965a000-0x7f70c9670000   /lib/x86_64-linux-gnu/libgcc_s.so.1
    0x7f70c9670000-0x7f70c986f000   /lib/x86_64-linux-gnu/libgcc_s.so.1
    0x7f70c986f000-0x7f70c9870000   /lib/x86_64-linux-gnu/libgcc_s.so.1
    0x7f70c9870000-0x7f70c9871000   /lib/x86_64-linux-gnu/libgcc_s.so.1
    0x7f70c9871000-0x7f70c9874000   /lib/x86_64-linux-gnu/libdl-2.21.so
    0x7f70c9874000-0x7f70c9a73000   /lib/x86_64-linux-gnu/libdl-2.21.so
    0x7f70c9a73000-0x7f70c9a74000   /lib/x86_64-linux-gnu/libdl-2.21.so
    0x7f70c9a74000-0x7f70c9a75000   /lib/x86_64-linux-gnu/libdl-2.21.so
    0x7f70c9a75000-0x7f70c9b7c000   /lib/x86_64-linux-gnu/libm-2.21.so
    0x7f70c9b7c000-0x7f70c9d7b000   /lib/x86_64-linux-gnu/libm-2.21.so
    0x7f70c9d7b000-0x7f70c9d7c000   /lib/x86_64-linux-gnu/libm-2.21.so
    0x7f70c9d7c000-0x7f70c9d7d000   /lib/x86_64-linux-gnu/libm-2.21.so
    0x7f70c9d7d000-0x7f70c9d84000   /lib/x86_64-linux-gnu/librt-2.21.so
    0x7f70c9d84000-0x7f70c9f83000   /lib/x86_64-linux-gnu/librt-2.21.so
    0x7f70c9f83000-0x7f70c9f84000   /lib/x86_64-linux-gnu/librt-2.21.so
    0x7f70c9f84000-0x7f70c9f85000   /lib/x86_64-linux-gnu/librt-2.21.so
    0x7f70c9f85000-0x7f70c9f9d000   /lib/x86_64-linux-gnu/libpthread-2.21.so
    0x7f70c9f9d000-0x7f70ca19d000   /lib/x86_64-linux-gnu/libpthread-2.21.so
    0x7f70ca19d000-0x7f70ca19e000   /lib/x86_64-linux-gnu/libpthread-2.21.so
    0x7f70ca19e000-0x7f70ca19f000   /lib/x86_64-linux-gnu/libpthread-2.21.so
    0x7f70ca19f000-0x7f70ca1a3000   
    0x7f70ca1a3000-0x7f70ca1c7000   /lib/x86_64-linux-gnu/ld-2.21.so
    0x7f70ca3a1000-0x7f70ca3a6000   
    0x7f70ca3bf000-0x7f70ca3c6000   
    0x7f70ca3c6000-0x7f70ca3c7000   /lib/x86_64-linux-gnu/ld-2.21.so
    0x7f70ca3c7000-0x7f70ca3c8000   /lib/x86_64-linux-gnu/ld-2.21.so
    0x7f70ca3c8000-0x7f70ca3c9000   
    0x7ffd1a789000-0x7ffd1a7aa000   [stack]
    0x7ffd1a7e2000-0x7ffd1a7e4000   [vvar]
    0x7ffd1a7e4000-0x7ffd1a7e6000   [vdso]
    0xffffffffff600000-0xffffffffff601000   [vsyscall]
==26340==End of process memory map.
exit status 77
FAIL: msan
FATAL: Code 0x55e2d585c330 is out of application range. Non-PIE build?
FATAL: MemorySanitizer can not mmap the shadow memory.
FATAL: Make sure to compile with -fPIE and to link with -pie.
FATAL: Disabling ASLR is known to cause this error.
FATAL: If running under GDB, try 'set disable-randomization off'.
==26542==Process memory map follows:
    0x55e2d57ca000-0x55e2d5991000   /tmp/go-build391327895/command-line-arguments/_obj/exe/msan2
    0x55e2d5b91000-0x55e2d5b96000   /tmp/go-build391327895/command-line-arguments/_obj/exe/msan2
    0x55e2d5b96000-0x55e2d8027000   
    0x7f03bf845000-0x7f03bfb97000   
    0x7f03bfb97000-0x7f03bfd57000   /lib/x86_64-linux-gnu/libc-2.21.so
    0x7f03bfd57000-0x7f03bff57000   /lib/x86_64-linux-gnu/libc-2.21.so
    0x7f03bff57000-0x7f03bff5b000   /lib/x86_64-linux-gnu/libc-2.21.so
    0x7f03bff5b000-0x7f03bff5d000   /lib/x86_64-linux-gnu/libc-2.21.so
    0x7f03bff5d000-0x7f03bff61000   
    0x7f03bff61000-0x7f03bff77000   /lib/x86_64-linux-gnu/libgcc_s.so.1
    0x7f03bff77000-0x7f03c0176000   /lib/x86_64-linux-gnu/libgcc_s.so.1
    0x7f03c0176000-0x7f03c0177000   /lib/x86_64-linux-gnu/libgcc_s.so.1
    0x7f03c0177000-0x7f03c0178000   /lib/x86_64-linux-gnu/libgcc_s.so.1
    0x7f03c0178000-0x7f03c017b000   /lib/x86_64-linux-gnu/libdl-2.21.so
    0x7f03c017b000-0x7f03c037a000   /lib/x86_64-linux-gnu/libdl-2.21.so
    0x7f03c037a000-0x7f03c037b000   /lib/x86_64-linux-gnu/libdl-2.21.so
    0x7f03c037b000-0x7f03c037c000   /lib/x86_64-linux-gnu/libdl-2.21.so
    0x7f03c037c000-0x7f03c0483000   /lib/x86_64-linux-gnu/libm-2.21.so
    0x7f03c0483000-0x7f03c0682000   /lib/x86_64-linux-gnu/libm-2.21.so
    0x7f03c0682000-0x7f03c0683000   /lib/x86_64-linux-gnu/libm-2.21.so
    0x7f03c0683000-0x7f03c0684000   /lib/x86_64-linux-gnu/libm-2.21.so
    0x7f03c0684000-0x7f03c068b000   /lib/x86_64-linux-gnu/librt-2.21.so
    0x7f03c068b000-0x7f03c088a000   /lib/x86_64-linux-gnu/librt-2.21.so
    0x7f03c088a000-0x7f03c088b000   /lib/x86_64-linux-gnu/librt-2.21.so
    0x7f03c088b000-0x7f03c088c000   /lib/x86_64-linux-gnu/librt-2.21.so
    0x7f03c088c000-0x7f03c08a4000   /lib/x86_64-linux-gnu/libpthread-2.21.so
    0x7f03c08a4000-0x7f03c0aa4000   /lib/x86_64-linux-gnu/libpthread-2.21.so
    0x7f03c0aa4000-0x7f03c0aa5000   /lib/x86_64-linux-gnu/libpthread-2.21.so
    0x7f03c0aa5000-0x7f03c0aa6000   /lib/x86_64-linux-gnu/libpthread-2.21.so
    0x7f03c0aa6000-0x7f03c0aaa000   
    0x7f03c0aaa000-0x7f03c0ace000   /lib/x86_64-linux-gnu/ld-2.21.so
    0x7f03c0ca8000-0x7f03c0cad000   
    0x7f03c0cc6000-0x7f03c0ccd000   
    0x7f03c0ccd000-0x7f03c0cce000   /lib/x86_64-linux-gnu/ld-2.21.so
    0x7f03c0cce000-0x7f03c0ccf000   /lib/x86_64-linux-gnu/ld-2.21.so
    0x7f03c0ccf000-0x7f03c0cd0000   
    0x7ffc61aec000-0x7ffc61b0d000   [stack]
    0x7ffc61bed000-0x7ffc61bef000   [vvar]
    0x7ffc61bef000-0x7ffc61bf1000   [vdso]
    0xffffffffff600000-0xffffffffff601000   [vsyscall]
==26542==End of process memory map.
exit status 77
FAIL: msan2

@Lekensteyn
Copy link
Contributor

Looks like an upstream issue with LLVM/compiler-rt: https://llvm.org/bugs/show_bug.cgi?id=24155

A fix was pushed earlier this month (Oct 2015), it will likely be shipped with 3.8.0 (no backport to 3.7 given the API breakage). I've proposed a backport for Arch Linux users: https://bugs.archlinux.org/task/46913

I don't see any similar bug for Ubuntu at https://launchpad.net/ubuntu/+source/llvm-toolchain-3.6/+bugs, you could report it if you find it useful. I have not checked whether the patches apply to 3.6 though.

@ianlancetaylor ianlancetaylor self-assigned this Nov 18, 2015
@rsc rsc changed the title misc/cgo/testsanitizers: MemorySanitizer can not mmap the shadow memory. misc/cgo/testsanitizers: for MemorySanitizer, Linux kernel ≥ 4.1 requires clang ≥ 3.8.0 Nov 30, 2015
@rsc
Copy link
Contributor

rsc commented Nov 30, 2015

@Lekensteyn, thanks for those links.

@ianlancetaylor, sent you CL 17254.

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/17254 mentions this issue.

@rsc rsc closed this as completed in de5b386 Dec 3, 2015
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/17323 mentions this issue.

ianlancetaylor pushed a commit that referenced this issue Dec 3, 2015
Fix a typo in de5b386; using `$ver` to determine linux major/minor
versions would produce those for clang, use `$linuxver` instead.

Updates #12898.

Change-Id: I2c8e84ad02749fceaa958afd65e558bb0b08dddb
Reviewed-on: https://go-review.googlesource.com/17323
Reviewed-by: Ian Lance Taylor <[email protected]>
Run-TryBot: Ian Lance Taylor <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
@golang golang locked and limited conversation to collaborators Dec 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants