|
From: Tom H. <to...@co...> - 2005-02-26 16:28:25
|
In message <421...@go...>
Jeremy Fitzhardinge <je...@go...> wrote:
> Nicholas Nethercote wrote:
>
> > I had a similar problem last night on my Debian 3.0 box. Strange
> > thing was, whether pth_exit hung or not seemed to depend on the value
> > of the --prefix path given to ./configure! I had two clean checkouts,
> > the only difference was the --prefix path, and one hung while the
> > other didn't. So I reconfigured, swapping the prefix paths, and this
> > time the other one hung. Very strange.
>
> I checked in a signals-related fix last night which could well fix it.
> I have no idea why --prefix would affect it though.
It doesn't seem to be happening as much but I do still have some
hangs in the thread tests on linuxthreads. It's intermittent though
which probably explains Nick's result.
I think I've now tracked down what is happening and why it works
sometimes. This is a trace from the end of pth_cancel2 when the
main thread is exiting and is waiting for the manager thread to
finish up:
SYSCALL[23924,1](175) special:sys_rt_sigprocmask ( 2, 0x0, 0xAFEFE150, 8 )
++23924++ do_setmask: tid = 1 how = 2 (SIG_SETMASK), set = 0x0 0000000000000000
++23924++ oldset=0xAFEFE150 0000000080000000
--> 0 (0x0)
SYSCALL[23924,1](179) mayBlock:sys_rt_sigsuspend ( 0xAFEFE150, 8 ) --> ...
--23924-- SCHED[1]: now sleeping in state VgTs_WaitSys
--23924-- SCHED[1]: now running
--23924-- Async handler got signal 32 for tid 1 info 0
interrupted_syscall: eip=0xB0084CC5; restart=0 eax=0
not started: restart
--23924-- delivering signal 32 (SIGRT0):0 to thread 1
--23924-- vg_push_signal_frame (thread 1): signal 32
SCHEDSETJMP(line 634) tid 1, jumped=1
SYSCALL[23924,1](119) special:sigreturn ( )
--23924-- vg_pop_signal_frame (thread 1): isRT=0 valid magic; EIP=0x420293D3
--> 179 (0xB3)
SYSCALL[23924,1](179) mayBlock:sys_rt_sigsuspend ( 0xAFEFE150, 8 ) --> ...
--23924-- SCHED[1]: now sleeping in state VgTs_WaitSys
So the main thread (thread 1) calls sigsuspend to wait for the signal
from the manager thread (thread 2) to say that it is done. Unfortunately
the signal arrives while the system call is still being setup so we
decide to restart the system call and wound up sat in sigsuspend waiting
for a signal that will never arrive.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|