From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by sourceware.org (Postfix) with ESMTPS id EFA933858C52 for ; Wed, 18 May 2022 10:38:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EFA933858C52 Received: by mail-oi1-x233.google.com with SMTP id e189so2134870oia.8 for ; Wed, 18 May 2022 03:38:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=t0SYv+UBqfpDlbfKDTzbq4JzLJdPfYQxOJ3O+FFEozo=; b=mfqMFSfRrbbobfu+oSIx/PZy8TECA+o/vDN58WN7hcvTrcCAjaofGA/gpWDlUnOANJ wSX0ZjaqY8PpnXu4/vlWOi3MaXmmzx+pESu3fZ3+ktYAKftmdUfy/EDVrxLIzymd3r/3 zMIN7b7M6+THGtswk/xY49fR6wClY7yo6nCt84vdIX+4+pzpaG4EnOKh2XfwZla3KeAH j5I+T0Opmo4qjBXboSM+fxylkGITq7U4itpHE9GDoo5ZcYBNDB+8MzXaTYfu5okuoZaO pbNZ0YixvaxxZ1odQLDP7vXSfPhygqhbxEuQ8q5+DAKQLitAyCJ53nSW+q4YUlhAx0qx thIA== X-Gm-Message-State: AOAM530QnoncygqNauQe5c7e1pnqdJ0VlV3a10r1/8+rUtTQVFL0f3Ad nllJfFu4agZUV19sbbOuF1ENQZmrYoKCYriTfGchT5WIimk= X-Google-Smtp-Source: ABdhPJwsyLo7nie07o6L7nknXkO2tKd0k79ogNJt2K4vt+8F6gtZHgTx/EEB6VJObivrptj2kLL2mfsJBVIf9pWFRnc= X-Received: by 2002:a05:6808:2097:b0:326:6bc9:407e with SMTP id s23-20020a056808209700b003266bc9407emr18135658oiw.250.1652870334268; Wed, 18 May 2022 03:38:54 -0700 (PDT) MIME-Version: 1.0 References: <98a68a34c0d95c812b49f471df3ff3d32e0bea8d.camel@xry111.site> In-Reply-To: <98a68a34c0d95c812b49f471df3ff3d32e0bea8d.camel@xry111.site> From: Zopolis0 Date: Wed, 18 May 2022 20:38:43 +1000 Message-ID: Subject: Re: Segfault in libjava/prims.cc while compiling gcj To: Xi Ruoyao Cc: gcc-help X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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 10:38:56 -0000 I'm unable to use the system g++ to compile it as removing any of the includes breaks it, removing any of the -B arguments breaks it, but not removing the -B arguments break it. Not exactly sure how to compile a preprocessed file either. As it stands, I have been unable to reproduce the error or change any of the flags, although I have been able to produce a preprocessed file as per your instructions. On Wed, May 18, 2022 at 7:59 PM Xi Ruoyao wrote: > 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 > School of Aerospace Science and Technology, Xidian University >