Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Feb 2002 14:58:52 -0500 (EST)
From:      Zhihui Zhang <zzhang@cs.binghamton.edu>
To:        Dag-Erling Smorgrav <des@ofug.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Ptrace and SIGTRAP problem
Message-ID:  <Pine.SOL.4.21.0202091443001.1954-100000@opal>
In-Reply-To: <xzpu1sqzci8.fsf@flood.ping.uio.no>

next in thread | previous in thread | raw e-mail | index | archive | help

I have tested four cases:

- PT_CONTINUE + waitpid() works fine, the trace program prints out values.
- PT_CONTINUE alone does not work but no core-dump caused by SIGTRAP
- PT_DETACH + waitpid() does not work and core-dump
- PT_DETACH alone does not work and core-dump.

Who is sending the SIGRAP (5) signal?  The same program works fine on
SunOS.  Maybe there is a bug in the kernel.  I have looked into
sys_process.c and still have no idea.

-Zhihui

On 9 Feb 2002, Dag-Erling Smorgrav wrote:

> Zhihui Zhang <zzhang@cs.binghamton.edu> writes:
> > The following small program demonstrates that a parent process can write
> > into the data space of its child by ptrace().  If the parent waits for the
> > child to exit, there is no problem. However, if the parent does not do so,
> > the child will get a SIGTRAP signal and core dumps.  Can anyone give me a
> > clue how this is the case?  Thanks!
> 
> The parent must either detach from the child, or wait for it to
> terminate.  See ptrace(2).
> 
> DES
> -- 
> Dag-Erling Smorgrav - des@ofug.org
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.4.21.0202091443001.1954-100000>