ThreadSanitizer: clock allocator overflow (65536*1024). Dying.

283 views
Skip to first unread message

xfan

unread,
Feb 14, 2020, 11:30:33 AM2/14/20
to thread-sanitizer
I got this error "ThreadSanitizer: clock allocator overflow (65536*1024). Dying." at the end of TSan log, and process got terminated. 
Does anybody know what this error means? How to solve it? 
Thanks
Xingyan

Dmitry Vyukov

unread,
Feb 16, 2020, 11:36:58 PM2/16/20
to xfan, thread-sanitizer
Hi Xingyan,

This error means that the program uses too many synchronization
objects combined with lots of threads.
There is no simple solution for this on tsan side. The current tsan
algorithm needs a significant amount of memory per every sync object,
including e.g. each atomic flag.
One solution that we employed internally is trying to reduce workload
on the program (number of threads, size of data set, etc).

xfan

unread,
Feb 20, 2020, 10:07:19 AM2/20/20
to thread-sanitizer
Hi Dmitry,
Thank you for the reply! 
Is 65536*1024 memory size or the number of synchronization objects? How to print out those info? Currently I only see that number when it "Dying". 
And is it possible to configure the limit (65536*1024) to a larger number?  
Thanks,
Xingyan

Dmitry Vyukov

unread,
Feb 21, 2020, 11:41:56 AM2/21/20
to xfan, thread-sanitizer
On Thu, Feb 20, 2020 at 4:07 PM xfan <xin...@gmail.com> wrote:
>
> Hi Dmitry,
> Thank you for the reply!
> Is 65536*1024 memory size or the number of synchronization objects?

As far as I remember, it's neither. It's number of 512-byte blocks
used for sync object vector clocks.

> How to print out those info? Currently I only see that number when it "Dying".

Maybe running with TSAN_OPTIONS=verbosity=100 env var will make it
print more info. If not, then only by modifying tsan source code.

> And is it possible to configure the limit (65536*1024) to a larger number?

Not without recompiling tsan runtime.
With recompiling, it's these numbers:
https://github.com/llvm-mirror/compiler-rt/blob/master/lib/tsan/rtl/tsan_sync.h#L134

> Thanks,
> Xingyan
>
>
> On Sunday, February 16, 2020 at 11:36:58 PM UTC-5, Dmitry Vyukov wrote:
>>
>> On Fri, Feb 14, 2020 at 5:30 PM xfan <xin...@gmail.com> wrote:
>> >
>> > I got this error "ThreadSanitizer: clock allocator overflow (65536*1024). Dying." at the end of TSan log, and process got terminated.
>> > Does anybody know what this error means? How to solve it?
>> > Thanks
>> > Xingyan
>>
>> Hi Xingyan,
>>
>> This error means that the program uses too many synchronization
>> objects combined with lots of threads.
>> There is no simple solution for this on tsan side. The current tsan
>> algorithm needs a significant amount of memory per every sync object,
>> including e.g. each atomic flag.
>> One solution that we employed internally is trying to reduce workload
>> on the program (number of threads, size of data set, etc).
>
> --
> You received this message because you are subscribed to the Google Groups "thread-sanitizer" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to thread-sanitiz...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/thread-sanitizer/e4d1ef27-c015-437b-bbcc-727973650393%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages