From: Tom de Vries <tdevries@suse.de>
To: Pedro Alves <palves@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Handle vfork in thread with follow-fork-mode child
Date: Thu, 18 Apr 2019 08:02:00 -0000 [thread overview]
Message-ID: <d7be9ac9-bf48-145f-3e35-11faaf3da270@suse.de> (raw)
In-Reply-To: <d5e1c85d-a880-1b6a-7e7c-19c739c111bb@redhat.com>
On 17-04-19 19:45, Pedro Alves wrote:
> On 4/16/19 4:06 PM, Tom de Vries wrote:
>> Hi,
>
> Hi!
>
> Comments below. As I was reviewing this, I kept experimenting,
> so I ended up addressing my own comments myself. See updated patch
> at the bottom.
>
Hi Pedro,
thanks for the comments and updated patch.
>> @@ -982,7 +983,17 @@ handle_vfork_child_exec_or_exit (int exec)
>> }
>> }
>>
>> - target_detach (inf->vfork_parent, 0);
>> + /* Now that the vfork child has terminated, make sure during detach
>
> This path is also reached if the vfork child execs, so the reference to
> "terminated" above would better be exec. But also, the other paths in
> the function already clear vfork_parent/vfork_child, so I think it's better
> to refactor things a bit so that all paths share the code.
>
> + inf->vfork_parent = NULL;
I was checking this and found dereferences of inf->vfork_parent after it
was set to NULL here:
...
else if (exec)
{
...
resume_parent = inf->vfork_parent->pid;
...
and here:
...
else
{
...
clone_program_space (pspace, inf->vfork_parent->pspace);
...
To confirm, I did another testrun with aborts at the start of the
blocks, and I found no regressions. So, either this is dead code, or we
need test-cases that trigger these paths.
Thanks,
- Tom
next prev parent reply other threads:[~2019-04-18 8:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-16 15:06 Tom de Vries
2019-04-17 17:45 ` Pedro Alves
2019-04-18 8:02 ` Tom de Vries [this message]
2019-04-18 9:12 ` Pedro Alves
2019-04-18 15:48 ` Tom de Vries
2019-04-18 16:17 ` Pedro Alves
2019-07-23 15:04 ` [8.3 backport] " Tom de Vries
2019-08-13 16:20 ` [PING][8.3 " Tom de Vries
2019-08-15 16:50 ` [8.3 " Pedro Alves
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=d7be9ac9-bf48-145f-3e35-11faaf3da270@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/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).