public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/61095] New: tsan is broken in gcc trunk, works in 4.9
@ 2014-05-07 11:16 kcc at gcc dot gnu.org
  2014-05-07 12:03 ` [Bug sanitizer/61095] " kcc at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: kcc at gcc dot gnu.org @ 2014-05-07 11:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61095

            Bug ID: 61095
           Summary: tsan is broken in gcc trunk, works in 4.9
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kcc at gcc dot gnu.org
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org

tsan seems to be broken in the current gcc trunk
(Tested r210145 on Linux ubuntu 12.04). 
gcc 4.9.0 works fine. 

There have been no recent libsanitizer merges from upstream so the problem
was likely introduced somewhere in the buildfiles, etc


% /usr/local/gcc-4.9.0/bin/g++ -g -fsanitize=thread -fPIE -pie -static-libtsan
simple_race.cc  && ./a.out 
==================
WARNING: ThreadSanitizer: data race (pid=31025)
...

% ../gcc-inst/bin/g++ -g -fsanitize=thread -fPIE -pie -static-libtsan
simple_race.cc  && ./a.out 
FATAL: ThreadSanitizer CHECK failed:
../../../../gcc/libsanitizer/tsan/tsan_rtl.cc:587 "((IsShadowMem((uptr)(p +
size * kShadowCnt / kShadowCell - 1)))) != (0)" (0x0, 0x0)
    #0 __tsan::PrintCurrentStackSlow()
../../../../gcc/libsanitizer/tsan/tsan_rtl_report.cc:710 (a.out+0x00000005840c)
    #1 __tsan::TsanCheckFailed(char const*, int, char const*, unsigned long
long, unsigned long long)
../../../../gcc/libsanitizer/tsan/tsan_rtl_report.cc:39 (a.out+0x0000000584e2)
    #2 __sanitizer::CheckFailed(char const*, int, char const*, unsigned long
long, unsigned long long)
../../../../gcc/libsanitizer/sanitizer_common/sanitizer_common.cc:74
(a.out+0x00000005ea93)
    #3 MemoryRangeSet ../../../../gcc/libsanitizer/tsan/tsan_rtl.cc:587
(a.out+0x00000001e1d6)
    #4 __tsan::user_alloc(__tsan::ThreadState*, unsigned long, unsigned long,
unsigned long) ../../../../gcc/libsanitizer/tsan/tsan_mman.cc:113
(a.out+0x00000005403a)
    #5 calloc ../../../../gcc/libsanitizer/tsan/tsan_interceptors.cc:500
(a.out+0x00000003d4d4)
    #6 _dl_allocate_tls <null>:0 (ld-linux-x86-64.so.2+0x000000012074)
    #7 __pthread_create_2_1 <null>:0 (libpthread.so.0+0x000000008abc)
    #8 pthread_create
../../../../gcc/libsanitizer/tsan/tsan_interceptors.cc:891
(a.out+0x00000003b758)
    #9 main /home/kcc/tmp/simple_race.cc:23 (a.out+0x000000079473)
    #10 __libc_start_main <null>:0 (libc.so.6+0x00000002176c)
    #11 <null> <null>:0 (a.out+0x000000010694)


% cat simple_race.cc 
#include <pthread.h>
int Global;
void *Thread1(void *x) {
  Global++;
  return NULL;
}
int main() {
  pthread_t t;
  pthread_create(&t, NULL, Thread1, NULL);
  Global++;
  pthread_join(t, NULL);
}
%


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2014-05-08 19:29 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-07 11:16 [Bug sanitizer/61095] New: tsan is broken in gcc trunk, works in 4.9 kcc at gcc dot gnu.org
2014-05-07 12:03 ` [Bug sanitizer/61095] " kcc at gcc dot gnu.org
2014-05-07 12:50 ` [Bug sanitizer/61095] [4.10 Regression] " rguenth at gcc dot gnu.org
2014-05-07 12:55 ` [Bug sanitizer/61095] miscompile: " kcc at gcc dot gnu.org
2014-05-07 13:04 ` [Bug sanitizer/61095] [4.10 Regression] " kcc at gcc dot gnu.org
2014-05-07 13:25 ` rguenth at gcc dot gnu.org
2014-05-07 13:27 ` jakub at gcc dot gnu.org
2014-05-07 13:27 ` rguenth at gcc dot gnu.org
2014-05-07 13:29 ` rguenth at gcc dot gnu.org
2014-05-07 16:28 ` rsandifo at gcc dot gnu.org
2014-05-07 18:01 ` rsandifo at gcc dot gnu.org
2014-05-08  4:35 ` kcc at gcc dot gnu.org
2014-05-08  4:39 ` kcc at gcc dot gnu.org
2014-05-08  7:19 ` kcc at gcc dot gnu.org
2014-05-08  7:34 ` rsandifo at gcc dot gnu.org
2014-05-08  8:01 ` rsandifo at gcc dot gnu.org
2014-05-08 19:29 ` rsandifo at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).