On Thursday 02 June 2011 18:39, Oleg Nesterov wrote: > On 06/02, Oleg Nesterov wrote: > > > > On 06/02, Denys Vlasenko wrote: > > > > > > The problem is that right now it seems that if tracer doesn't catch > > > EVENT_EXIT and detach tracee when it sees it, really weird things > > > happen. > > > > The test-case is wrong afaics... > > > > Perhaps this should be considered as a bug in glibc, I dunno. > > > > > thread1(void *unused) > > > { > > > // usleep(100*1000); > > > // VERBOSE("WINCH\n"); > > > // raise(SIGWINCH); > > > > > > usleep(100*1000); > > > VERBOSE("DYING\n"); > > > raise(SIGUSR1); > > > > This doesn't send a signal. This does tgkill(tgid, 0, SIGUSR1) which > > fails correctly with -EINVAL. Yes. After I fixed this, it works as expected. See attached. The output is: # ./thread_leader_exit 2876: thread leader 2876: status:0003057f WIFSTOPPED sig:5 (TRAP) event:CLONE eventdata:0xb3d 2877: status:0000137f WIFSTOPPED sig:19 (STOP) event:none eventdata:0x0 Leader exits 2876: status:0006057f WIFSTOPPED sig:5 (TRAP) event:EXIT eventdata:0x7700 Sending WINCH to self (pid,tid:2876,2877) 2877: status:00001c7f WIFSTOPPED sig:28 (WINCH) event:none eventdata:0x0 res:0 Sending USR1 to self (pid,tid:2876,2877) 2877: status:00000a7f WIFSTOPPED sig:10 (USR1) event:none eventdata:0x0 2877: status:0006057f WIFSTOPPED sig:5 (TRAP) event:EXIT eventdata:0xa 2877: status:0000000a WIFSIGNALED sig:10 (USR1) 2876: status:0000000a WIFSIGNALED sig:10 (USR1) > > > static int > > > thread_leader(void *unused) > > > { > > > /* malloc gives sufficiently aligned buffer. > > > * long buf[] does not! (on ia64). > > > */ > > > clone2(thread1, malloc(16 * 1024), 16 * 1024, 0 > > > > Probably because of this clone2. This seems to be not a problem (it is defined to clone()). -- vda