3

I am profiling a program compiled with gcc 6.1 with -fsanitize=address option. The program is multi-threaded with clean exits for each thread (with pthread_exit).

Address Sanitizer fails with the message: ==16800==AddressSanitizer: Thread limit (4194304 threads) exceeded. Dying.

The thread count makes no sense (there is no way I am allocating that many threads). Is there a way I can instrument AddressSanitizer to see where and how the threads are being created?

Amitabha
  • 83
  • 5
  • 1
    Clean exit from thread routine is through return, and not `pthread_exit`. – SergeyA May 06 '16 at 13:26
  • @SergeyA: What? That's not true at all. I suspect missing `pthread_join()` or `pthread_detach()`. – EOF May 06 '16 at 13:28
  • 1
    @EOF, of course it is true. pthread_exit() will **not** call destructors of automatic objects created in thread function, so it can't be called 'clean' way of exiting. – SergeyA May 06 '16 at 13:33
  • I should note that this is on linux and /proc/pid/status does not show nearly as many threads (the maximum is 32 as expected). – Amitabha May 06 '16 at 13:34

0 Answers0