public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "simark at simark dot ca" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/31281] [gdb] intrusive_list.h:329: internal-error: push_back: Assertion elem_node->prev == INTRUSIVE_LIST_UNLINKED_VALUE failed.
Date: Wed, 24 Jan 2024 21:02:14 +0000	[thread overview]
Message-ID: <bug-31281-4717-dSBzMIiflL@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-31281-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=31281

--- Comment #9 from Simon Marchi <simark at simark dot ca> ---
(In reply to Tom de Vries from comment #8)
> (In reply to Simon Marchi from comment #6)
> > I bisected gcc, the failure appeared with this commit:
> > 
> > c++: non-dependent .* operand folding [PR112427]
> > https://gitlab.com/gnutools/gcc/-/commit/d3f48f68227
> > 
> > I know nothing about compilers, so I don't know what the code changes.  But
> > the included test case uses a pointer-to-member, which is somewhat relevant
> > in our case.
> 
> At the parser level (original tree dump file), I see:
> ...
> ;; Function static intrusive_list_node<T>* intrusive_member_node<T,
> MemberNode>::as_node(T*) [with T = thread_info; intrusive_list_node<T> T::*
> MemberNode = &thread_info::resumed_with_pending_wait_status_node] (null)
> ;; enabled by -tree-original
> 
> 
> return <retval> = NON_LVALUE_EXPR <elem> != 0B ? &NON_LVALUE_EXPR
> <elem>->D.191606 + (sizetype) 520 : (struct intrusive_list_node *) 520;
> ...
> 
> The 520 is the offset of resumed_with_pending_wait_status_node:
> ...
> (gdb) p /x (void *)&thread->resumed_with_pending_wait_status_node - (void
> *)thread
> $46 = 0x208
> (gdb) p 0x208
> $12 = 520
> ...
> 
> The D.191606 bit adds an offset of 8 (this becomes apparent at the expand
> rtl dump file).  That also happens to be the offset of the inherited
> intrusive list node, see:
> ...
> class thread_info : public refcounted_object,
>                     public intrusive_list_node<thread_info>
> ...
> and:
> ...
> (gdb) p (void *) &thread.next - (void *) thread
> $13 = 8
> ...

I'm not sure I understand, but aren't you conflating thread_info::next with
thread_info::resumed_with_pending_wait_status_node::next?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2024-01-24 21:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23 17:59 [Bug gdb/31281] New: [gdb] intrusive_list.h:329: internal-error: push_back: Assertion elem_node->prev == INTRUSIVE_LIST_UNLIKED_VALUE failed blarsen at redhat dot com
2024-01-24 15:00 ` [Bug gdb/31281] " sam at gentoo dot org
2024-01-24 15:00 ` sam at gentoo dot org
2024-01-24 15:05 ` blarsen at redhat dot com
2024-01-24 16:17 ` tromey at sourceware dot org
2024-01-24 16:37 ` ssbssa at sourceware dot org
2024-01-24 16:38 ` [Bug gdb/31281] [gdb] intrusive_list.h:329: internal-error: push_back: Assertion elem_node->prev == INTRUSIVE_LIST_UNLINKED_VALUE failed vries at gcc dot gnu.org
2024-01-24 17:06 ` vries at gcc dot gnu.org
2024-01-24 17:18 ` simark at simark dot ca
2024-01-24 18:11 ` blarsen at redhat dot com
2024-01-24 19:23 ` simark at simark dot ca
2024-01-24 19:24 ` vries at gcc dot gnu.org
2024-01-24 19:41 ` vries at gcc dot gnu.org
2024-01-24 21:02 ` simark at simark dot ca [this message]
2024-01-24 22:01 ` vries at gcc dot gnu.org
2024-01-24 22:39 ` vries at gcc dot gnu.org
2024-01-25  3:51 ` simon.marchi at polymtl dot ca
2024-01-25  8:45 ` vries at gcc dot gnu.org
2024-01-25 12:38 ` simon.marchi at polymtl dot ca
2024-01-25 14:04 ` [Bug build/31281] " vries at gcc dot gnu.org
2024-01-25 14:21 ` vries at gcc dot gnu.org
2024-01-25 15:30 ` cvs-commit at gcc dot gnu.org
2024-01-25 15:31 ` vries at gcc dot gnu.org

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=bug-31281-4717-dSBzMIiflL@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.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).