public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Zan Lynx <zlynx@acm.org>
To: paul@mad-scientist.net,Paul Smith
	<paul@mad-scientist.net>,"gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: ICE with precompiled headers (GCC 8.1)
Date: Tue, 30 Apr 2019 15:34:00 -0000	[thread overview]
Message-ID: <534D0EB9-D26A-4DAB-851E-A1A09ADF88C9@acm.org> (raw)
In-Reply-To: <09c7773cd22879ca1f23b40103fc4d2c1c1293f7.camel@mad-scientist.net>

On April 30, 2019 7:43:47 AM MDT, Paul Smith <paul@mad-scientist.net> wrote:
>I have GCC 8.1.0 / binutils 2.30 on GNU/Linux 64bit (built locally). 
>My codebase is almost all C++.
>
>I'm implementing precompiled headers and it was going well.  However,
>sometimes a PCH file is generated that causes the compiler to ICE when
>trying to use it during a source file compilation:
>
>  <command-line>: internal compiler error: Segmentation fault
>  Please submit a full bug report,
>  with preprocessed source if appropriate.
>  See <https://gcc.gnu.org/bugs/> for instructions.
>
>If I rename the .gch file and compile the source it works; if I put
>back the .gch file and compile the source it will ICE again.  So
>clearly there's something corrupt about the PCH file itself.
>
>Also this does not happen every time, even using the identical code. 
>Sometimes the PCH file is fine and the compile is fine.  It has never
>happened on my local system but it happens quite often on some of our
>build servers (typically these are a bit older/slower with slower
>disks).  And, it doesn't happen to all PCH files in the same build (I
>create different PCH files for different libraries), even ones that
>include the same files!
>
>Since it's not reproducible and the code is proprietary I haven't tried
>to produce a publishable case so far.
>
>Here's the thing: I added the "-MD -MF foo.d" options to the PCH file
>compile (I wanted to get a manifest of which files were included in the
>PCH file).  Without those options I cannot reproduce this at all (in a
>number of tries).  With those options it happens most of the time on
>some systems (but again, never on my local system).
>
>Unfortunately my GCC is heavily optimized and stripped so backtraces
>are useless.  I will generate a debuggable GCC and see if I can get
>more info on the ICE.
>
>In the meantime, does this remind anyone of an existing bug, hopefully
>one that was fixed in 8.2 or 8.3?

It does remind me of a race condition bug with a Makefile I wrote years ago.

One or two build tasks did not properly depend on the precompiled headers but used them anyway, and sometimes during make -j8 would get unlucky and use a partial header file.
-- 
                Knowledge is Power -- Power Corrupts
                        Study Hard -- Be Evil

  reply	other threads:[~2019-04-30 15:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30 14:02 Paul Smith
2019-04-30 15:34 ` Zan Lynx [this message]
2019-04-30 17:04   ` Paul Smith
2019-05-01 13:35 ` Paul Smith
2019-05-01 15:04   ` Paul Smith
2019-05-01 23:42     ` Paul Smith
2019-05-02 11:12     ` Nathan Sidwell

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=534D0EB9-D26A-4DAB-851E-A1A09ADF88C9@acm.org \
    --to=zlynx@acm.org \
    --cc=gcc@gcc.gnu.org \
    --cc=paul@mad-scientist.net \
    /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).