Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Feb 2012 16:01:46 -0800
From:      Dmitry Mikulin <dmitrym@juniper.net>
To:        Kostik Belousov <kostikbel@gmail.com>
Cc:        freebsd-current Current <freebsd-current@freebsd.org>, Marcel Moolenaar <marcelm@juniper.net>
Subject:   Re: [ptrace] please review follow fork/exec changes
Message-ID:  <4F2C756A.80900@juniper.net>
In-Reply-To: <20120130192727.GZ2726@deviant.kiev.zoral.com.ua>
References:  <749E238A-A85F-4264-9DEB-BCE1BBD21C9D@juniper.net> <20120125074824.GD2726@deviant.kiev.zoral.com.ua> <4F2094B4.70707@juniper.net> <20120126122326.GT2726@deviant.kiev.zoral.com.ua> <4F22E8FD.6010201@juniper.net> <20120129074843.GL2726@deviant.kiev.zoral.com.ua> <4F26E0D1.8040100@juniper.net> <20120130192727.GZ2726@deviant.kiev.zoral.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
--------------030706030706070106060906
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
Content-Transfer-Encoding: 7bit


> Please provide more details, I am looking forward for the panic
> message and backtrace.

I can't seem to get the panic with the latest source base, but tracing doesn't appear to work with vfork(). I attached a modified test case to closer model what gdb is doing. If you change fork() to vfork() in simple.c the parent doesn't get the events the same way it does under fork().

> The lack of the notification for parent is exactly what the patch I
> posted fixes. More exactly, it is the lack of notification for parent
> with PT_CONTINUE loop. I will commit this today.
>
> Regarding a single notification. Currently, parent arrives at the
> syscall return code only after the child is attached to the debugger.
> See the cv_wait() in kern_fork.c:739. In other words, if you get the
> PL_FLAG_FORK, the child is already attached (at last it shall be). My
> scescx.c code illustrates this well, IMO.
>
> You still get a separate stop from the child, but I do not see how is it
> harmful.

There a couple of tweaks to the interface that I'd like to have:
- set PL_FLAG_FORKED in the child so gdb can identify the stop as a fork() event.
- add a switch similar to PT_FOLLOW_FORK to enable/disable exec() notifications. Gdb gets confused by the events it hasn't explicitly asked for and having a switch makes it easier to filter out unwanted stops.

Do you think it's possible/makes sense?

Thanks.
Dmitry.

--------------030706030706070106060906--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F2C756A.80900>