public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/64265] New: r217669 broke tsan
@ 2014-12-11 11:47 bernd.edlinger at hotmail dot de
  2014-12-12 13:31 ` [Bug c++/64265] " bernd.edlinger at hotmail dot de
                   ` (26 more replies)
  0 siblings, 27 replies; 28+ messages in thread
From: bernd.edlinger at hotmail dot de @ 2014-12-11 11:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64265

            Bug ID: 64265
           Summary: r217669 broke tsan
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bernd.edlinger at hotmail dot de

Created attachment 34249
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34249&action=edit
test case

starting with r217669 tsan instrumentation gets wrong code:

g++ -g -fsanitize=thread test.cpp

./a.out

=> soaks all memory up.

reason is this function calls __tsan_func_entry in a loop:

_ZNSt12_Destroy_auxILb0EE9__destroyIN9__gnu_cxx17__normal_iteratorIPSsSt6vectorISsSaISsEEEEEEvT_S9_:
.LFB982:
        .loc 5 100 0
        .cfi_startproc
        pushq   %rbp
        .cfi_def_cfa_offset 16
        .cfi_offset 6, -16
        movq    %rsp, %rbp
        .cfi_def_cfa_register 6
        subq    $32, %rsp
        movq    %rdi, -16(%rbp)
        movq    %rsi, -32(%rbp)
.L153:
        movq    8(%rbp), %rax
        movq    %rax, %rdi
        call    __tsan_func_entry
        .loc 5 102 0 discriminator 2
        leaq    -32(%rbp), %rdx
        leaq    -16(%rbp), %rax
        movq    %rdx, %rsi
        movq    %rax, %rdi
        call   
_ZN9__gnu_cxxneIPSsSt6vectorISsSaISsEEEEbRKNS_17__normal_iteratorIT_T0_EESA_
        testb   %al, %al
        je      .L152
        .loc 5 103 0 discriminator 1
        leaq    -16(%rbp), %rax
        movq    %rax, %rdi
        call    _ZNK9__gnu_cxx17__normal_iteratorIPSsSt6vectorISsSaISsEEEdeEv
        movq    %rax, %rdi
        call    _ZSt11__addressofISsEPT_RS0_
        movq    %rax, %rdi
        call    _ZSt8_DestroyISsEvPT_
        .loc 5 102 0 discriminator 1
        leaq    -16(%rbp), %rax
        movq    %rax, %rdi
        call    _ZN9__gnu_cxx17__normal_iteratorIPSsSt6vectorISsSaISsEEEppEv
        jmp     .L153
.L152:
        .loc 5 104 0
        call    __tsan_func_exit
        leave
        .cfi_def_cfa 7, 8
        ret
        .cfi_endproc


it is generated from bits/stl_container.h, line 95-105:

template<bool>
  struct _Destroy_aux
  {
    template<typename _ForwardIterator>
      static void
      __destroy(_ForwardIterator __first, _ForwardIterator __last)
      {
        for (; __first != __last; ++__first)
          std::_Destroy(std::__addressof(*__first));
      }
  };


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

end of thread, other threads:[~2015-03-19  7:55 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-11 11:47 [Bug c++/64265] New: r217669 broke tsan bernd.edlinger at hotmail dot de
2014-12-12 13:31 ` [Bug c++/64265] " bernd.edlinger at hotmail dot de
2014-12-12 13:33 ` [Bug sanitizer/64265] [5 Regression] " rguenth at gcc dot gnu.org
2014-12-12 13:36 ` rguenth at gcc dot gnu.org
2014-12-12 13:39 ` bernd.edlinger at hotmail dot de
2014-12-12 15:58 ` edlinger at gcc dot gnu.org
2014-12-12 16:51 ` jakub at gcc dot gnu.org
2014-12-12 17:22 ` jakub at gcc dot gnu.org
2014-12-12 17:28 ` dvyukov at google dot com
2014-12-12 17:39 ` jakub at gcc dot gnu.org
2014-12-12 17:42 ` jakub at gcc dot gnu.org
2014-12-12 17:52 ` dvyukov at google dot com
2014-12-12 18:41 ` jakub at gcc dot gnu.org
2014-12-12 18:48 ` dvyukov at google dot com
2014-12-12 18:58 ` bernd.edlinger at hotmail dot de
2014-12-12 19:13 ` jakub at gcc dot gnu.org
2014-12-12 19:22 ` kcc at gcc dot gnu.org
2014-12-12 19:31 ` dvyukov at google dot com
2014-12-12 19:36 ` bernd.edlinger at hotmail dot de
2014-12-12 20:18 ` bernd.edlinger at hotmail dot de
2014-12-12 20:26 ` dvyukov at google dot com
2014-12-12 21:23 ` jakub at gcc dot gnu.org
2014-12-15  9:38 ` jakub at gcc dot gnu.org
2014-12-15  9:46 ` jakub at gcc dot gnu.org
2014-12-15  9:50 ` jakub at gcc dot gnu.org
2014-12-16 12:04 ` jakub at gcc dot gnu.org
2015-01-05 21:48 ` jakub at gcc dot gnu.org
2015-03-19  7:55 ` jakub 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).