From: Thomas Rast <trast@student.ethz.ch>
To: Jim Meyering <jim@meyering.net>
Cc: "Richard W.M. Jones" <rjones@redhat.com>,
Markus Trippelsdorf <markus@trippelsdorf.de>,
<git@vger.kernel.org>, "Shawn O. Pearce" <spearce@spearce.org>,
Jeff King <peff@peff.net>, Nicolas Pitre <nico@fluxnic.net>
Subject: Re: general protection faults with "git grep" version 1.7.7.1
Date: Tue, 25 Oct 2011 18:54:43 +0200 [thread overview]
Message-ID: <201110251854.43369.trast@student.ethz.ch> (raw)
In-Reply-To: <87sjmhauyo.fsf@rho.meyering.net>
Jim Meyering wrote:
> Thomas Rast wrote:
> > Jim Meyering wrote:
> >> Thomas Rast wrote:
> >> > [GCC moves access to a file-static variable across pthread_mutex_lock()]
> >>
> >> Thanks for the investigation.
> >> Actually, isn't gcc -O2's code-motion justified?
> >> While we *know* that those globals may be modified asynchronously,
> >> builtin/grep.c forgot to tell gcc about that.
> >
> > I'm somewhat unwilling to believe that:
>
> You're right to be skeptical.
> I should have stuck with "using volatile works around the problem for me".
> The real problem seems to be in glibc, with its addition of
> the "leaf" attribute to those synchronization primitives:
>
> http://bugzilla.redhat.com/747377#c22
Aha. Glad you found it :-)
Meanwhile I read
http://www.hpl.hp.com/techreports/2004/HPL-2004-209.html
which discusses a similar issue in section 4.3, but is very
interesting on its own. It's funny how it says
We know of at least three optimizing compilers (two of them
production compilers) that performed this transformation at some
point during their lifetime; usually at least partially reversing
the decision when the implications on multi-threaded code became
known.
I guess that would be four now if it was literally the same problem.
--
Thomas Rast
trast@{inf,student}.ethz.ch
next prev parent reply other threads:[~2011-10-25 16:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-24 20:11 general protection faults with "git grep" version 1.7.7.1 Markus Trippelsdorf
2011-10-24 21:49 ` Richard W.M. Jones
2011-10-24 22:58 ` Markus Trippelsdorf
2011-10-25 0:00 ` Bernt Hansen
2011-10-25 5:53 ` Jeff King
2011-10-25 11:11 ` Bernt Hansen
2011-10-25 13:50 ` Thomas Rast
2011-10-25 15:17 ` Jim Meyering
2011-10-25 15:32 ` Markus Trippelsdorf
2011-10-25 16:00 ` Thomas Rast
2011-10-25 16:07 ` Thomas Rast
2011-10-25 16:37 ` Jim Meyering
2011-10-25 16:54 ` Thomas Rast [this message]
2011-10-25 20:24 ` Jim Meyering
2011-10-25 15:37 ` Jeff King
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=201110251854.43369.trast@student.ethz.ch \
--to=trast@student.ethz.ch \
--cc=git@vger.kernel.org \
--cc=jim@meyering.net \
--cc=markus@trippelsdorf.de \
--cc=nico@fluxnic.net \
--cc=peff@peff.net \
--cc=rjones@redhat.com \
--cc=spearce@spearce.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 NNTP newsgroup(s).