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

CHECK failed: ((tsd_key_inited)) != (0) with dynamic runtime #123

Closed
ramosian-glider opened this issue Aug 31, 2015 · 4 comments
Closed

Comments

@ramosian-glider
Copy link
Member

Originally reported on Google Code with ID 123

$ cat p.c
int main() { 
  return 0;
}
$ /Users/glider/src/asan/llvm/build/Release+Asserts/bin/clang -faddress-sanitizer p.c
-o p
$ ASAN_OPTIONS=verbosity=1 ./p
==76928== Parsed ASAN_OPTIONS: verbosity=1
==76928== exec()-ing the program with
==76928== DYLD_INSERT_LIBRARIES=/Users/glider/src/asan/llvm/build/Release+Asserts/lib/clang/3.2/lib/darwin/libclang_rt.asan_osx_dynamic.dylib
==76928== to enable ASan wrappers.
==76928== Set ASAN_OPTIONS=allow_reexec=0 to disable this.
==76928== Parsed ASAN_OPTIONS: verbosity=1
|| `[0x200000000000, 0x7fffffffffff]` || HighMem    ||
|| `[0x140000000000, 0x1fffffffffff]` || HighShadow ||
|| `[0x120000000000, 0x13ffffffffff]` || ShadowGap  ||
|| `[0x100000000000, 0x11ffffffffff]` || LowShadow  ||
|| `[0x000000000000, 0x0fffffffffff]` || LowMem     ||
MemToShadow(shadow): 0x120000000000 0x123fffffffff 0x128000000000 0x13ffffffffff
red_zone=64
malloc_context_size=30
SHADOW_SCALE: 3
SHADOW_GRANULARITY: 8
SHADOW_OFFSET: 100000000000
==76928== Installed the sigaction for signal 11
==76928== Installed the sigaction for signal 10
==76928== T0: stack [0x7fff5b5b3000,0x7fff5bdb3000) size 0x800000; local=0x7fff5bdb1d40
==76928== AddressSanitizer Init done


$ DYLD_INSERT_LIBRARIES=/Users/glider/src/asan/llvm/build/Release+Asserts/lib/clang/3.2/lib/darwin/libclang_rt.asan_osx_dynamic.dylib
ASAN_OPTIONS=verbosity=1 ./p
=================================================================
==77666== Sanitizer CHECK failed: /Users/glider/src/asan/llvm/projects/compiler-rt/lib/asan/asan_posix.cc:109
((tsd_key_inited)) != (0) (0, 0)

Reported by ramosian.glider on 2012-10-25 14:52:24

@ramosian-glider
Copy link
Member Author

Regression range: r164900 (works) -- r166000 (does not)

Reported by ramosian.glider on 2012-10-26 08:59:34

@ramosian-glider
Copy link
Member Author

This has been caused by r165307, namely the following part:

=======================================================
@@ -382,9 +372,7 @@

 #if ASAN_INTERCEPT_STRDUP
 INTERCEPTOR(char*, strdup, const char *s) {
-#if MAC_INTERPOSE_FUNCTIONS
-  if (!asan_inited) return REAL(strdup)(s);
-#endif
+  if (!asan_inited) return internal_strdup(s);
   ENSURE_ASAN_INITED();
   if (flags()->replace_str) {
     uptr length = REAL(strlen)(s);
=======================================================

Because internal_strdup() calls malloc(), it may hit an assertion within the ASan allocator.

Reported by ramosian.glider on 2012-10-26 10:23:53

@ramosian-glider
Copy link
Member Author

Fixed in r166768

Reported by ramosian.glider on 2012-10-26 13:53:43

  • Status changed: Fixed

@ramosian-glider
Copy link
Member Author

Adding Project:AddressSanitizer as part of GitHub migration.

Reported by ramosian.glider on 2015-07-30 09:13:40

  • Labels added: ProjectAddressSanitizer

This issue was closed.
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