From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 65C2E3858D3C for ; Wed, 18 May 2022 09:59:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 65C2E3858D3C Received: from [192.168.124.21] (unknown [113.140.11.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 989866678E; Wed, 18 May 2022 05:59:25 -0400 (EDT) Message-ID: <98a68a34c0d95c812b49f471df3ff3d32e0bea8d.camel@xry111.site> Subject: Re: Segfault in libjava/prims.cc while compiling gcj From: Xi Ruoyao To: Zopolis0 , gcc-help Date: Wed, 18 May 2022 17:59:23 +0800 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.1 MIME-Version: 1.0 X-Spam-Status: No, score=3.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FROM_SUSPICIOUS_NTLD, KAM_SHORT, LIKELY_SPAM_FROM, PDS_OTHER_BAD_TLD, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: *** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2022 09:59:28 -0000 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. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University