[Bug sanitizer/77538] segmentation fault: thread sanitizer shadow stack overflow
coollpe at hotmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Nov 7 15:26:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77538
--- Comment #17 from peien luo <coollpe at hotmail dot com> ---
(In reply to Dmitry Vyukov from comment #16)
> > The stack size limit in my box is 8M. I have also checked /proc/<id>limits.
>
> So, is increasing stack size help?
> Tsan increases stack consumption. 8MB is not that much provided that you
> have 1MB frames.
>
> > By enabling -fstack-protector-all, in gdb it still may get segfault here (at function entry).
>
> Stack protector will not help to detect/prevent stack overflow. It only
> prevents PC overwrite on buffer overflows.
Increased to 80MB, no help.
In a 4.9.0 tsan case, I have come across a segfault in gdb with back trace:
23 void MutexSet::Add(u64 id, bool write, u64 epoch) {
24 // Look up existing mutex with the same id.
25 for (uptr i = 0; i < size_; i++) {
26 if (descs_[i].id == id) {
27 descs_[i].count++;
28 descs_[i].epoch = epoch;
29 return;
30 }
(gdb) p size_
$2 = 139907922088632
(gdb) bt
#0 0x00007f3ed9c5f37c in __tsan::MutexSet::Add
(this=this@entry=0x7f3ec6f63080, id=55166398195828824,
write=write@entry=true, epoch=1680548) at
../../../../libsanitizer/tsan/tsan_mutexset.cc:26
#1 0x00007f3ed9c555e5 in __tsan::MutexLock (thr=thr@entry=0x7f3ec6e78840,
pc=pc@entry=139907918263873,
addr=addr@entry=138040248895576) at
../../../../libsanitizer/tsan/tsan_rtl_mutex.cc:109
#2 0x00007f3ed9c4f6ae in __interceptor_pthread_mutex_lock (m=0x7d8c00000858)
at ../../../../libsanitizer/tsan/tsan_interceptors.cc:811
...
something overflowed?
More information about the Gcc-bugs
mailing list