-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Empty code randomly crashes with SEGV on unknown address #1724
Comments
I've encountered a similar problem in my project, where tests built with the address, undefined and leak sanitizers randomly crash at startup, showing the following error:
GDB output (the same for my tests and empty main function):
ldd output for binary
Hope this information will be useful |
I can't reproduce this with clang. Probably gcc problem? Compiled as follows:
For clang
|
I'm also hitting this (g++ crashes and clang++ works) with versions:
and
Files are compiled with: I'm testing using this shell snippet to run the binary until it crashes (or the The clang++ test works fine and runs as long as I want:
The g++ test crashes after a while:
Here it crashed on the 7th run but I've also seen lower and higher numbers. |
The Thread Sanitizer of ASAN doesn't seem to support randomized offsets from the VMA base address (`vm.mmap_rnd_bits`) if they are larger than 28 bits. This leads to ASAN compiled binaries to crash or endless loop with a `AddressSanitizer:DEADLYSIGNAL` before main is reached. Reference issues: google/sanitizers#1716 google/sanitizers#1724
The Thread Sanitizer of ASAN doesn't seem to support randomized offsets from the VMA base address (`vm.mmap_rnd_bits`) if they are larger than 28 bits. This leads to ASAN compiled binaries to crash or endless loop with a `AddressSanitizer:DEADLYSIGNAL` before main is reached. Reference issues: google/sanitizers#1716 google/sanitizers#1724
I was seeing about the same 20% DEADLYSIGNAL on startup in a program where I had no problems before. The problem occurred before main() was entered. What I gathered is that this is a problem of interactions between address sanitizer and the OS's address space layout randomization feature. So it may have started as a result of a conscious (or unconscious) upgrade of files in the OS. I was able to get the DEADLYSIGNAL to go away by invoking the program as:
|
Have the following code:
Compiled it with this command:
If I run it, I randomly (~20%) get an error like this:
Using latest Arch Linux. No such error appeared until recent update.
The text was updated successfully, but these errors were encountered: