From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26017 invoked by alias); 11 Dec 2014 11:47:50 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 25994 invoked by uid 48); 11 Dec 2014 11:47:47 -0000 From: "bernd.edlinger at hotmail dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/64265] New: r217669 broke tsan Date: Thu, 11 Dec 2014 11:47:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bernd.edlinger at hotmail dot de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-12/txt/msg01251.txt.bz2 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 struct _Destroy_aux { template static void __destroy(_ForwardIterator __first, _ForwardIterator __last) { for (; __first != __last; ++__first) std::_Destroy(std::__addressof(*__first)); } };