public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug jit/98615] New: libgccjit crash while freeing 'clone_info' in 'cgraph_c_finalize'
@ 2021-01-10 11:14 akrl at gcc dot gnu.org
  2021-01-11  8:10 ` [Bug jit/98615] " marxin at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 15+ messages in thread
From: akrl at gcc dot gnu.org @ 2021-01-10 11:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98615

            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=49928&action=edit
reproducer

====
$ gcc libgccjit_repro.c -lgccjit
$ ./a.out
munmap_chunk(): invalid pointer
Aborted (core dumped)
====

What is going on is that a static function (CAR) is inlined via virtual clone
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: 

ae7a23a3fab Move clone_info to summary

The first revision where is possible to reproduce on was unbroken few commits
later with:

895fdc1f4c9 ipa: Fix segmentation fault in
function_summary<clone_info*>::get(cgraph_node*)

I found this because it breaks Emacs bootstrap on libgccjit.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-04-21 18:09 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-10 11:14 [Bug jit/98615] New: libgccjit crash while freeing 'clone_info' in 'cgraph_c_finalize' akrl at gcc dot gnu.org
2021-01-11  8:10 ` [Bug jit/98615] " marxin at gcc dot gnu.org
2021-01-11 12:49 ` marxin at gcc dot gnu.org
2021-01-11 12:58 ` marxin at gcc dot gnu.org
2021-01-11 13:30   ` Andrea Corallo
2021-01-11 13:30 ` andrea.corallo at arm dot com
2021-01-11 17:15 ` cvs-commit at gcc dot gnu.org
2021-01-11 17:15 ` marxin at gcc dot gnu.org
2021-01-11 19:36   ` Andrea Corallo
2021-01-11 19:37 ` andrea.corallo at arm dot com
2021-01-12  8:17 ` marxin at gcc dot gnu.org
2021-01-12  9:15   ` Andrea Corallo
2021-01-12  9:15 ` andrea.corallo at arm dot com
2021-01-12 10:49 ` marxin at gcc dot gnu.org
2021-04-21 18:09 ` cvs-commit at gcc dot gnu.org

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).