From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BC1963857805; Sun, 10 Jan 2021 11:14:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BC1963857805 From: "akrl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug jit/98615] New: libgccjit crash while freeing 'clone_info' in 'cgraph_c_finalize' Date: Sun, 10 Jan 2021 11:14:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: jit X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: akrl at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2021 11:14:59 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98615 Bug ID: 98615 Summary: libgccjit crash while freeing 'clone_info' in 'cgraph_c_finalize' Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: jit Assignee: dmalcolm at gcc dot gnu.org Reporter: akrl at gcc dot gnu.org Target Milestone: --- Created attachment 49928 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D49928&action=3Dedit reproducer =3D=3D=3D=3D $ gcc libgccjit_repro.c -lgccjit $ ./a.out munmap_chunk(): invalid pointer Aborted (core dumped) =3D=3D=3D=3D What is going on is that a static function (CAR) is inlined via virtual clo= ne and its symbol released. Eventually 'cgraph_c_finalize' calls 'clone_info::release' and this is where (not sure why) we crash. I believe this bug was introduced by:=20 ae7a23a3fab Move clone_info to summary The first revision where is possible to reproduce on was unbroken few commi= ts later with: 895fdc1f4c9 ipa: Fix segmentation fault in function_summary::get(cgraph_node*) I found this because it breaks Emacs bootstrap on libgccjit.=