Jeff-Lewis / address-sanitizer

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

remove the limit of the number of ever existed threads in asan #273

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Today asan will die after 4M threads are created, because we keep some 
small amount of metadata for every thread that ever lived. 
We should eventually remove this limitation. 

Original issue reported on code.google.com by konstant...@gmail.com on 11 Mar 2014 at 8:51

GoogleCodeExporter commented 9 years ago
One thing that limits us is the number of bits we can spend for thread id.
Currently it is 24:
struct ChunkHeader {
  // 1-st 8 bytes.
  u32 chunk_state       : 8;  // Must be first.
  u32 alloc_tid         : 24;

  u32 free_tid          : 24;
...

Original comment by konstant...@gmail.com on 12 Mar 2014 at 4:32

GoogleCodeExporter commented 9 years ago
I keep seeing such errors:

=================================================================
==26629==ERROR: AddressSanitizer: attempting free on address which was not 
malloc()-ed: 0x000001e28790 in thread T16777215
==26629==AddressSanitizer CHECK failed: 
/local/mar_/llvm-3.4/projects/compiler-rt/lib/asan/asan_report.cc:595 
"((free_stack->size)) > ((0))" (0x0, 0x0)

Can you confirm this is the same issue?

Is there some workaround possible?

Thanks,
Martin

Original comment by mric...@googlemail.com on 8 May 2014 at 3:52

GoogleCodeExporter commented 9 years ago
P.S. What pointed me to this bug was the thread id, which is always: T16777215 
(0xffffff).

Also, it looks like these crashes happen mostly on process shutdown.

Best regards,
Martin

Original comment by mric...@googlemail.com on 8 May 2014 at 3:55

GoogleCodeExporter commented 9 years ago
I don't think your crashes are related to this bug. It may be a real bug in the 
code. 
How many threads do you have? (run with ASAN_OPTIONS=verbosity=1 if you don't 
know). 
Do you have a reproducer? 

Original comment by konstant...@gmail.com on 8 May 2014 at 4:35

GoogleCodeExporter commented 9 years ago
Will try to reproduce it.

Original comment by mric...@googlemail.com on 9 May 2014 at 11:57

GoogleCodeExporter commented 9 years ago
I reproduced it with verbosity=1, attaching the log.

==61871==ERROR: AddressSanitizer: attempting free on address which was not 
malloc()-ed: 0x7f2192ae7010 in thread T16777215
==61871==AddressSanitizer CHECK failed: 
/local/mar_/llvm-3.4/projects/compiler-rt/lib/asan/asan_report.cc:595 
"((free_stack->size)) > ((0))" (0x0, 0x0) 

Unfortunately this is a complex test, so no reproducer yet. Let me know if I 
should enable some other trace. The error happens when a server is shutting 
down, and the process crashes with signal 11 (after the ASan report).

Original comment by mric...@googlemail.com on 1 Nov 2014 at 11:52

Attachments:

GoogleCodeExporter commented 9 years ago
Please create a separate bug for this issue, this one is about something 
completely different. 

Original comment by konstant...@gmail.com on 5 Nov 2014 at 1:18

GoogleCodeExporter commented 9 years ago

Original comment by ramosian.glider@gmail.com on 30 Jul 2015 at 9:05

GoogleCodeExporter commented 9 years ago
Adding Project:AddressSanitizer as part of GitHub migration.

Original comment by ramosian.glider@gmail.com on 30 Jul 2015 at 9:06