public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bernd.edlinger at hotmail dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/64265] New: r217669 broke tsan
Date: Thu, 11 Dec 2014 11:47:00 -0000	[thread overview]
Message-ID: <bug-64265-4@http.gcc.gnu.org/bugzilla/> (raw)

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));
      }
  };


             reply	other threads:[~2014-12-11 11:47 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-11 11:47 bernd.edlinger at hotmail dot de [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-64265-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).