Skip to content
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

ThreadSanitizer dies with misaligned stack errors on Mac OS #49

Open
GoogleCodeExporter opened this issue Feb 5, 2016 · 2 comments
Open

Comments

@GoogleCodeExporter
Copy link

To reproduce, sync third_party/valgrind to r75, build TSan and run:

$ tsan_inst/bin/valgrind  --tool=tsan ls
==82415== ThreadSanitizer, a data race detector
==82415== Copyright (C) 2008-2010, and GNU GPL'd, by Google Inc.
==82415== Using Valgrind-3.7.0.SVN and LibVEX; rerun with -h for copyright info
==82415== Command: ls
==82415== 
==82415== ThreadSanitizerValgrind r2526: hybrid=no
==82415== INFO: Allocating 192Mb (24 * 8M) for Segments.
==82415== INFO: Will allocate up to 320Mb for 'previous' stack traces.
--82415-- 
/Users/glider/src/data-race-test/tsan/bin/vgpreload_tsan-x86-darwin.so:
--82415-- dSYM directory is missing; consider using --dsymutil=yes
==82415== 
==82415== Process terminating with default action of signal 11 (SIGSEGV)
==82415==  General Protection Fault
==82415==    at 0x8FE18C02: misaligned_stack_error (in /usr/lib/dyld)
==82415==    by 0xA16B2EB: _malloc_initialize (in /usr/lib/libSystem.B.dylib)
==82415==    by 0xA091803: calloc (in /usr/lib/libSystem.B.dylib)
==82415==    by 0xA01D88B: calloc (in 
/Users/glider/src/data-race-test/tsan/bin/vgpreload_tsan-x86-darwin.so)
==82415==    by 0xA091799: dwarf2_unwind_dyld_add_image_hook (in 
/usr/lib/libSystem.B.dylib)
==82415==    by 0x8FE03D61: dyld::registerAddCallback(void (*)(mach_header 
const*, long)) (in /usr/lib/dyld)
==82415==    by 0xA090B3A: _dyld_register_func_for_add_image (in 
/usr/lib/libSystem.B.dylib)
==82415==    by 0xA089CB5: __keymgr_initializer (in /usr/lib/libSystem.B.dylib)
==82415==    by 0xA0890C0: libSystem_initializer (in /usr/lib/libSystem.B.dylib)
==82415==    by 0x8FE12F35: 
ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) (in 
/usr/lib/dyld)
==82415==    by 0x8FE0E7E2: 
ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned 
int) (in /usr/lib/dyld)
==82415==    by 0x8FE0E774: 
ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned 
int) (in /usr/lib/dyld)
==82415== 
==82415== ThreadSanitizer summary: reported 0 warning(s) (0 race(s))
Segmentation fault

Original issue reported on code.google.com by gli...@google.com on 27 Oct 2010 at 8:03

@GoogleCodeExporter
Copy link
Author

VEX revision r2057 introduced explicit alignment checks for SSE instructions. 
Now those checks occasionally fire within our wrappers.
The same problem for Helgrind wrappers was fixed by changing valgrind.h in 
r11461, which is present in valgrind-variant r75. However, this seems to be 
still broken for TSan.

See also https://bugs.kde.org/show_bug.cgi?id=254646

Original comment by gli...@google.com on 27 Oct 2010 at 8:41

@GoogleCodeExporter
Copy link
Author

I've disabled the checks temporarily. Need to investigate the cause of 
unaligned accesses.

Original comment by gli...@google.com on 27 Oct 2010 at 9:32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant