-
Notifications
You must be signed in to change notification settings - Fork 18k
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
runtime: MSAN failed to run on arm64 with non-PIE builds #33712
Comments
The below are some findings.
Run the command "clang -fsanitize=memory -fno-omit-frame-pointer -g -O2 -v test.cc", the log shows the program is linked with pie mode.
If I used PIE mode to build the msan program, the program can pass on arm64. I will post a fixing CL, using PIE link mode when using MSAN. |
Likely the fix should be to |
@ianlancetaylor Yes, I did that too. Thank you. 🙂 |
Change https://golang.org/cl/190482 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
the msan tests report errors:
--- FAIL: TestMSAN/msan (4.06s)
msan_test.go:53:
/tmp/TestMSAN490720188/msan
exited with exit status 77FATAL: Code 0x00000041d7a0 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'.
==20194==Process memory map follows:
0x000000400000-0x000000636000 /tmp/TestMSAN490720188/msan
0x000000646000-0x00000064b000 /tmp/TestMSAN490720188/msan
0x00000064b000-0x000000662000 /tmp/TestMSAN490720188/msan
0x000000662000-0x000002ba7000
0xffff905dc000-0xffff9094e000
0xffff9094e000-0xffff90a8e000 /lib/aarch64-linux-gnu/libc-2.27.so
0xffff90a8e000-0xffff90a9d000 /lib/aarch64-linux-gnu/libc-2.27.so
0xffff90a9d000-0xffff90aa1000 /lib/aarch64-linux-gnu/libc-2.27.so
0xffff90aa1000-0xffff90aa3000 /lib/aarch64-linux-gnu/libc-2.27.so
0xffff90aa3000-0xffff90aa7000
0xffff90aa7000-0xffff90aba000 /lib/aarch64-linux-gnu/libgcc_s.so.1
0xffff90aba000-0xffff90ac9000 /lib/aarch64-linux-gnu/libgcc_s.so.1
0xffff90ac9000-0xffff90aca000 /lib/aarch64-linux-gnu/libgcc_s.so.1
0xffff90aca000-0xffff90acb000 /lib/aarch64-linux-gnu/libgcc_s.so.1
0xffff90acb000-0xffff90ace000 /lib/aarch64-linux-gnu/libdl-2.27.so
0xffff90ace000-0xffff90ade000 /lib/aarch64-linux-gnu/libdl-2.27.so
0xffff90ade000-0xffff90adf000 /lib/aarch64-linux-gnu/libdl-2.27.so
0xffff90adf000-0xffff90ae0000 /lib/aarch64-linux-gnu/libdl-2.27.so
0xffff90ae0000-0xffff90b89000 /lib/aarch64-linux-gnu/libm-2.27.so
0xffff90b89000-0xffff90b98000 /lib/aarch64-linux-gnu/libm-2.27.so
0xffff90b98000-0xffff90b99000 /lib/aarch64-linux-gnu/libm-2.27.so
0xffff90b99000-0xffff90b9a000 /lib/aarch64-linux-gnu/libm-2.27.so
0xffff90b9a000-0xffff90ba0000 /lib/aarch64-linux-gnu/librt-2.27.so
0xffff90ba0000-0xffff90baf000 /lib/aarch64-linux-gnu/librt-2.27.so
0xffff90baf000-0xffff90bb0000 /lib/aarch64-linux-gnu/librt-2.27.so
0xffff90bb0000-0xffff90bb1000 /lib/aarch64-linux-gnu/librt-2.27.so
0xffff90bb1000-0xffff90bc8000 /lib/aarch64-linux-gnu/libpthread-2.27.so
0xffff90bc8000-0xffff90bd7000 /lib/aarch64-linux-gnu/libpthread-2.27.so
0xffff90bd7000-0xffff90bd8000 /lib/aarch64-linux-gnu/libpthread-2.27.so
0xffff90bd8000-0xffff90bd9000 /lib/aarch64-linux-gnu/libpthread-2.27.so
0xffff90bd9000-0xffff90bdd000
0xffff90bdf000-0xffff90bf3000
0xffff90bf3000-0xffff90c10000 /lib/aarch64-linux-gnu/ld-2.27.so
0xffff90c10000-0xffff90c1d000
0xffff90c1d000-0xffff90c1e000 [vvar]
0xffff90c1e000-0xffff90c1f000 [vdso]
0xffff90c1f000-0xffff90c20000 /lib/aarch64-linux-gnu/ld-2.27.so
0xffff90c20000-0xffff90c22000 /lib/aarch64-linux-gnu/ld-2.27.so
0xffffeace2000-0xffffead12000 [stack]
==20194==End of process memory map.
What did you see instead?
pass
The text was updated successfully, but these errors were encountered: