public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/30547] [gdb, s390x, ppc64] segfault in for_each_block
Date: Wed, 01 Nov 2023 09:56:43 +0000	[thread overview]
Message-ID: <bug-30547-4717-GSrNtJshSq@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30547-4717@http.sourceware.org/bugzilla/>

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

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #4)
> Hardcoding linux_is_uclinux to false makes the test-case pass for me.  The
> function seems to be giving inconsistent results.
> 
> The scenario is as follows:
> - a program space with an address space is created
> - a second program space is about to be created. maybe_new_address_space
>   is called, and because linux_is_uclinux returns true,
> maybe_new_address_space
>   returns false, and no new address space is created
> - a second program space with the same address space is created
> - a program space is deleted. Because linux_is_uclinux now returns false,
>   gdbarch_has_shared_address_space (current_inferior ()->arch ()) returns
>   false, and the address space is deleted
> - when gdb uses the address space of the remaining program space (which is
>   now deleted), it runs into use after free issues.

Related reading: here (
https://sourceware.org/pipermail/gdb-patches/2023-October/202928.html ) it's
suggested to use refcounting to determine whether an address space is shared.

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

  parent reply	other threads:[~2023-11-01  9:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13 13:16 [Bug gdb/30547] New: [gdb, s390x] " vries at gcc dot gnu.org
2023-10-31  8:02 ` [Bug gdb/30547] [gdb, s390x, ppc64] " vries at gcc dot gnu.org
2023-10-31  8:28 ` vries at gcc dot gnu.org
2023-10-31 15:53 ` vries at gcc dot gnu.org
2023-11-01  9:42 ` vries at gcc dot gnu.org
2023-11-01  9:56 ` vries at gcc dot gnu.org [this message]
2023-11-02 10:49 ` vries at gcc dot gnu.org
2023-11-04 15:57 ` vries at gcc dot gnu.org
2023-11-28  9:31 ` cvs-commit at gcc dot gnu.org
2023-11-28  9:31 ` cvs-commit at gcc dot gnu.org
2023-11-28  9:54 ` 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-30547-4717-GSrNtJshSq@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).