public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Xi Ruoyao <xry111@xry111.site>
To: Zopolis0 <creatorsmithmdt@gmail.com>, gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: Segfault in libjava/prims.cc while compiling gcj
Date: Wed, 18 May 2022 17:59:23 +0800	[thread overview]
Message-ID: <98a68a34c0d95c812b49f471df3ff3d32e0bea8d.camel@xry111.site> (raw)
In-Reply-To: <CAEYL+X9rxt7PJVZazDOZg6s7krp+D-oyvNFo9QfBW9R-hCmGqQ@mail.gmail.com>

On Wed, 2022-05-18 at 19:23 +1000, Zopolis0 via Gcc-help wrote:

/* snip */

> ../../../../gcj/libjava/prims.cc:182:23: internal compiler error:
> Segmentation fault

/* snip */

> Is this an error within prims.cc?

No.  No matter prims.cc is erroneous or not, the compiler should not
crash.

> Or is it catching an error from somewhere else?

It indicates a bug in the compiler.

> Should I report this as per the instructions?

Maybe.  We don't know if you introduced the bug or the bug has been
already in GCC trunk.

Try to get a preprocessed file (by changing "-c" to "-E" in the command
line, and "-o prims.o" to "-o prims.ii").  Then compile prims.ii using
*unmodified and latest* g++ trunk with all flags (esp. -m32, -Ox, and -
f...) in the command line.  But "-D...", "-I...", and "-B..." shall be
removed.

If the segfault can be reproduced with unmodified g++ trunk with the
instruction above, try to remove some flags (for example, remove -m32,
change -O2 to -O1 or -O0, etc) and get a minimal set of flags to produce
the crash.  Then use cvise (https://github.com/marxin/cvise) to reduce
prims.ii into a test case and report via https://gcc.gnu.org/bugzilla
with the test case attached.

If the segfault can't be reproduced with latest g++ trunk and the
preprocessed file, you can try to rebase your changes onto the latest
trunk.  If the crash still happens for the rebased code, it indicates
you've done something wrong modifying GCC.  You can still use cvise to
get a minimal test case to reproduce the crash for you, and then use a
debugger (like gdb) to figure out what's going wrong.
-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

  reply	other threads:[~2022-05-18  9:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18  9:23 Zopolis0
2022-05-18  9:59 ` Xi Ruoyao [this message]
2022-05-18 10:38   ` Zopolis0
2022-05-18 10:43     ` Jonathan Wakely
2022-05-18 10:45       ` Zopolis0
2022-05-18 10:57         ` Jonathan Wakely
2022-05-18 11:01           ` Xi Ruoyao
2022-05-18 23:20             ` Zopolis0
2022-05-19  4:32               ` Zopolis0
2022-05-19  8:06                 ` Xi Ruoyao
2022-05-20 10:50                   ` Zopolis0
2022-05-18 11:16           ` Zopolis0
2022-05-19 10:47 ` Florian Weimer
2022-05-19 12:22   ` Zopolis0
2022-05-21  7:12     ` Zopolis0
2022-06-15  7:51       ` Zopolis0
2022-06-17  9:20         ` Zopolis0

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=98a68a34c0d95c812b49f471df3ff3d32e0bea8d.camel@xry111.site \
    --to=xry111@xry111.site \
    --cc=creatorsmithmdt@gmail.com \
    --cc=gcc-help@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).