public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Steve Ellcey <sellcey@marvell.com>
To: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Help with bug in GCC garbage collector
Date: Mon, 19 Aug 2019 22:59:00 -0000	[thread overview]
Message-ID: <a26bed2a26654af6293e351970f5c3a9f65232cf.camel@marvell.com> (raw)

I was wondering if anyone could help me investigate a bug I am seeing
in the GCC garbage collector.  This bug (which may or may not be PR
89179) is causing a segfault in GCC, but when I try to create a
preprocessed source file, the bug doesn't trigger.  The problem is with
the garbage collector trying to mark some memory that has already been
freed.  I have tracked down the initial allocation to:

symbol_table::allocate_cgraph_symbol

It has:

	node = ggc_cleared_alloc<cgraph_node> ();

to allocate a cgraph node.  With the GGC debugging on I see this
allocated:

	Allocating object, requested size=360, actual=360 at 0xffff7029c210 on 0x41b148c0

then freed:

	Freeing object, actual size=360, at 0xffff7029c210 on 0x41b148c0

And then later, while the garbage collector is marking nodes, I see:

	Marking 0xffff7029c210

The garbage collector shouldn't be marking this node if has already
been freed.

So I guess my main question is how do I figure out how the garbage
collector got to this memory location?  I am guessing some GTY pointer
is still pointing to it and hadn't got nulled out when the memory was
freed.  Does that seem like the most likely cause?

I am not sure why I am only running into this with one particular
application on my Aarch64 platform.  I am building it with -fopenmp,
which could have something to do with it (though there are no simd functions in the application).  The application is not that large as C++ programs go.

Steve Ellcey
sellcey@marvell.com

             reply	other threads:[~2019-08-19 22:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-19 22:59 Steve Ellcey [this message]
2019-08-19 23:05 ` Jeff Law
2019-08-19 23:25   ` Steve Ellcey

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=a26bed2a26654af6293e351970f5c3a9f65232cf.camel@marvell.com \
    --to=sellcey@marvell.com \
    --cc=gcc@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).