ramosian-glider / sanitizer-issues

test
0 stars 0 forks source link

ASAN build binaries on fedora-17 x86_64 segfault #85

Closed ramosian-glider closed 9 years ago

ramosian-glider commented 9 years ago

Originally reported on Google Code with ID 85

I tried to build various libraries using the latest version of ASAN from the repo, they
build fine, but when the compiled binaries/libraries are run, they segfault.

One common example is firefox ASAN builds from http://people.mozilla.org/~choller/firefox/asan/

When i run them i get the following:
==28728== AddressSanitizer CHECK failed: /builds/slave/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_interceptors.cc:744
"((was_called_once == false)) != (0)" (0, 0)
==28728== AddressSanitizer CHECK failed: /builds/slave/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_interceptors.cc:744
"((was_called_once == false)) != (0)" (0, 0)
==28728== AddressSanitizer CHECK failed: /builds/slave/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_interceptors.cc:744
"((was_called_once == false)) != (0)" (0, 0)
Segmentation fault

Christian Holler looked into this and his binaries are running well on other distributions.

Here are my machine details:
$ uname -a
Linux some.host.name 3.4.0-1.fc17.x86_64 #1 SMP Sun Jun 3 06:35:17 UTC 2012 x86_64
x86_64 x86_64 GNU/Linux

For my local builds i use the following clang version:
$clang --version
clang version 3.2 (trunk 159332)
Target: x86_64-unknown-linux-gnu
Thread model: posix

Reported by sidhpurwala.huzaifa on 2012-06-29 11:06:50

ramosian-glider commented 9 years ago
Do you have a small reproducer? 

Reported by konstantin.s.serebryany on 2012-06-29 11:12:54

ramosian-glider commented 9 years ago
Can you run the program under GDB and provide the backtrace?

Reported by ramosian.glider on 2012-06-29 11:13:10

ramosian-glider commented 9 years ago
I reproduced this in a VM with Fedora 17 (64 bit) and one of the Firefox Debug+Asan
builds. The GDB trace is here (partial): http://decoder.pastebin.mozilla.org/1683698

The full trace is very long, I suspect it's some recursion repeating on the stack.

Reported by decoder.oh on 2012-06-29 11:45:34

ramosian-glider commented 9 years ago
got it. sscanf is hurting us. 
Will fix. 

Reported by konstantin.s.serebryany on 2012-06-29 12:00:07

ramosian-glider commented 9 years ago
I hope this is fixed in LLVM r159424.
Please let us know whether it is actually fixed on your side.
You don't need to rebuild the entire firefox, just re-link it with fresh asan run-time.

Reported by konstantin.s.serebryany on 2012-06-29 13:09:23

ramosian-glider commented 9 years ago
Yeah, we had this problem in DR on Fedora too.  Some genius in glibc decided it would
be good for sscanf to call malloc.  =P

Reported by rnk@google.com on 2012-06-29 14:41:04

ramosian-glider commented 9 years ago
Adding Project:AddressSanitizer as part of GitHub migration.

Reported by ramosian.glider on 2015-07-30 09:12:59