NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/52117: ptrace(2) PTRACE_FORK fails on some platforms



The following reply was made to PR kern/52117; it has been noted by GNATS.

From: "Kamil Rytarowski" <n54%gmx.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/52117: ptrace(2) PTRACE_FORK fails on some platforms
Date: Tue, 28 Mar 2017 16:00:21 +0200

 > Sent: Tuesday, March 28, 2017 at 3:15 PM
 > From: "Martin Husemann" <martin%duskware.de@localhost>
 > To: kern-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost, n54%gmx.com@localhost
 > Subject: Re: kern/52117: ptrace(2) PTRACE_FORK fails on some platforms
 >
 > The following reply was made to PR kern/52117; it has been noted by GNATS.
 > 
 > From: Martin Husemann <martin%duskware.de@localhost>
 > To: gnats-bugs%NetBSD.org@localhost
 > Cc: 
 > Subject: Re: kern/52117: ptrace(2) PTRACE_FORK fails on some platforms
 > Date: Tue, 28 Mar 2017 15:13:36 +0200
 > 
 >  On Tue, Mar 28, 2017 at 01:00:01PM +0000, Kamil Rytarowski wrote:
 >  >  Before calling wait4() for the child 19554
 >  >  Reported PTRACE_FORK event with forkee 11702
 >  >  Before calling wait4() for the forkee 11702 of the child 19554
 >  
 >  What happens here is (from my local run):
 >  
 >    5603      1 t_ptrace_wait4 GIO   fd 1 wrote 44 bytes
 >         "Reported PTRACE_FORK event with forkee 5251\n"
 >    5603      1 t_ptrace_wait4 RET   write 44/0x2c
 >    5603      1 t_ptrace_wait4 CALL  write(1,0xffffffffffffcbf8,0x3d)
 >    5603      1 t_ptrace_wait4 GIO   fd 1 wrote 61 bytes
 >         "Before calling wait4() for the forkee 5251 of the child 6264\n"
 >    5603      1 t_ptrace_wait4 RET   write 61/0x3d
 >    5603      1 t_ptrace_wait4 CALL  __wait450(0x1483,0xffffffffffffd240,0,0)
 >    5251      1 t_ptrace_wait4 EMUL  "netbsd"
 >    5251      1 t_ptrace_wait4 RET   fork 0
 >    5251      1 t_ptrace_wait4 CALL  exit(0xf)
 >    5603      1 t_ptrace_wait4 RET   __wait450 5251/0x1483
 >    5603      1 t_ptrace_wait4 CALL  writev(1,0xffffffffffffcc70,4)
 >    5603      1 t_ptrace_wait4 GIO   fd 1 wrote 75 bytes
 >         "failed: /ssd/src/tests/kernel/t_ptrace_wait.h:295: Reported exited pro\
 >          cess\n"
 >  
 >  Now note that wait4 is called on the childs forkee (5251) which does 
 >  nothing but exit. So WIFEXITED() is correct, but you probably want
 >  to wait for the child (6264) instead?
 > 
 
 Yes, we wait for two signals SIGTRAP.
 
 Exactly the same interface is added for PTRACE_VFORK and the same behavior.
 (However I have not managed to make it work so far)
  
 >  Martin
 >  
 > 
 


Home | Main Index | Thread Index | Old Index