odyaka341 / thread-sanitizer

Automatically exported from code.google.com/p/thread-sanitizer
0 stars 0 forks source link

unable to run base_unittests from chromium #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

following instructions from:
http://www.chromium.org/developers/testing/threadsanitizer-tsan-v2

GYP_GENERATORS=ninja GYP_DEFINES='tsan=1 linux_use_tcmalloc=0 
release_extra_cflags="-gline-tables-only" disable_nacl=1' gclient runhooks
ninja -C out/Release base_unittests
export G_SLICE=always-malloc
export NSS_DISABLE_ARENA_FREE_LIST=1
export NSS_DISABLE_UNLOAD=1
TSAN_OPTIONS="suppressions=tools/valgrind/tsan_v2/suppressions.txt 
report_signal_unsafe=0 report_thread_leaks=0" out/Release/base_unittests 
--gtest_filter=-ProcessUtilTest.GetAppOutputRestrictedNoZombies 2>&1 | tee log

What is the expected output? What do you see instead?

actual:

FATAL: ThreadSanitizer can not mmap the shadow memory (something is mapped at 
0x555555554000 < 0x7cf000000000)
FATAL: Make sure to compile with -fPIE and to link with -pie.

expected:
tests run

What version of the product are you using? On what operating system?

trunk (r173381 of chromium)

ubuntu 12.04
Linux 3.2.0-35-generic #55-Ubuntu SMP Wed Dec 5 17:42:16 UTC 2012 x86_64 x86_64 
x86_64 GNU/Linux

Original issue reported on code.google.com by miaubiz@gmail.com on 17 Dec 2012 at 9:52

GoogleCodeExporter commented 9 years ago
Try to prefix the command with
$ setarch x86_64 -R
i.e. 
$ TSAN_OPTIONS="..." setarch x86_64 -R out/Release/base_unittests ...
it must be due to address space randomization.

Original comment by dvyu...@google.com on 17 Dec 2012 at 9:57

GoogleCodeExporter commented 9 years ago
same output :|

Original comment by miaubiz@gmail.com on 17 Dec 2012 at 10:02

GoogleCodeExporter commented 9 years ago
0x55555555 happens when ASRL is *on*, so we need to turn in *off*.
Hmmm. How? 

Original comment by konstant...@gmail.com on 17 Dec 2012 at 10:05

GoogleCodeExporter commented 9 years ago
I am confused. Let me try again. 
0x55555555 happens when ASRL is *off*, so we need to turn in *on*. 
grrrrrrrr

Original comment by konstant...@gmail.com on 17 Dec 2012 at 10:06

GoogleCodeExporter commented 9 years ago
You need to *enable* ASLR:
http://linux.derkeiler.com/Mailing-Lists/Kernel/2010-11/msg13003.html
http://stackoverflow.com/questions/11238457/disable-and-re-enable-address-space-
layout-randomization-only-for-mysef

Original comment by dvyu...@google.com on 17 Dec 2012 at 10:13

GoogleCodeExporter commented 9 years ago
@dvyukov: ok thanks got it now :D

it 'works' now.
it says this instead of the original:

GLib (gthread-posix.c): Unexpected error from C library during 
'pthread_cond_init': Invalid argument.  Aborting.
zsh: abort (core dumped)  TSAN_OPTIONS= out/Release/base_unittests 

Original comment by miaubiz@gmail.com on 17 Dec 2012 at 10:16

GoogleCodeExporter commented 9 years ago
This is fixed in upstream ThreadSanitizer in llvm, but Chrome updates tsan 
~every 2 weeks. We will be able to iterate much faster if you switch to 
upstream llvm tsan.

http://code.google.com/p/thread-sanitizer/wiki/Development
http://clang.llvm.org/docs/ThreadSanitizer.html

Original comment by dvyu...@google.com on 17 Dec 2012 at 10:20

GoogleCodeExporter commented 9 years ago
ok. thanks for the help <3

Original comment by miaubiz@gmail.com on 17 Dec 2012 at 10:28

GoogleCodeExporter commented 9 years ago
We are currently in process of deploying it for Chrome. It may be easier for 
you to try when at least basic tests are green:
http://build.chromium.org/p/chromium.fyi/builders/Chromium%20Linux%20TSan%20v2

Original comment by dvyu...@google.com on 17 Dec 2012 at 3:12

GoogleCodeExporter commented 9 years ago
Should be fixed by now.

Original comment by dvyu...@google.com on 10 Jun 2013 at 1:03