SIGINFO interrupts connect() with libpthread

Robert Watson rwatson at FreeBSD.org
Sat Oct 8 08:58:07 PDT 2005


On Sat, 8 Oct 2005, Daniel Eischen wrote:

> It only works with libc_r because libc_r wraps all these calls 
> (including connect()) with poll().  Obviously we're not going to do that 
> with libpthread.  You're only seeing it with SIGINFO because we use 
> SIGINFO as a debugging signal for libpthread (to dump thread state). 
> libpthread doesn't install any other signal handlers unless the 
> application does.  We could use a different signal or not use SIGINFO at 
> all.

Ah, so this is why my /tmp is full of garbage :-):

-rw-r--r--  1 robert  wheel  1823 Oct  5 20:32 /tmp/pthread.dump.49376.0
-rw-r--r--  1 robert  wheel  1822 Oct  5 20:32 /tmp/pthread.dump.49376.1
-rw-r--r--  1 robert  wheel  1861 Oct  5 20:32 /tmp/pthread.dump.49385.0
-rw-r--r--  1 robert  wheel  1860 Oct  5 20:32 /tmp/pthread.dump.49385.1
-rw-r--r--  1 robert  wheel  1861 Oct  5 20:32 /tmp/pthread.dump.49385.10
-rw-r--r--  1 robert  wheel  1860 Oct  5 20:32 /tmp/pthread.dump.49385.11
-rw-r--r--  1 robert  wheel  1860 Oct  5 20:32 /tmp/pthread.dump.49385.12
-rw-r--r--  1 robert  wheel  1860 Oct  5 20:32 /tmp/pthread.dump.49385.13
-rw-r--r--  1 robert  wheel  1861 Oct  5 20:32 /tmp/pthread.dump.49385.14
-rw-r--r--  1 robert  wheel  1860 Oct  5 20:32 /tmp/pthread.dump.49385.15
-rw-r--r--  1 robert  wheel  1861 Oct  5 20:32 /tmp/pthread.dump.49385.16
-rw-r--r--  1 robert  wheel  1860 Oct  5 20:32 /tmp/pthread.dump.49385.17
-rw-r--r--  1 robert  wheel  1861 Oct  5 20:32 /tmp/pthread.dump.49385.2
-rw-r--r--  1 robert  wheel  1860 Oct  5 20:32 /tmp/pthread.dump.49385.3
-rw-r--r--  1 robert  wheel  1861 Oct  5 20:32 /tmp/pthread.dump.49385.4
-rw-r--r--  1 robert  wheel  1860 Oct  5 20:32 /tmp/pthread.dump.49385.5
-rw-r--r--  1 robert  wheel  1861 Oct  5 20:32 /tmp/pthread.dump.49385.6
-rw-r--r--  1 robert  wheel  1860 Oct  5 20:32 /tmp/pthread.dump.49385.7
-rw-r--r--  1 robert  wheel  1861 Oct  5 20:32 /tmp/pthread.dump.49385.8
-rw-r--r--  1 robert  wheel  1860 Oct  5 20:32 /tmp/pthread.dump.49385.9
-rw-r--r--  1 robert  wheel  1856 Oct  5 21:16 /tmp/pthread.dump.49954.0
-rw-r--r--  1 robert  wheel  1856 Oct  5 21:16 /tmp/pthread.dump.49954.1
-rw-r--r--  1 robert  wheel  1856 Oct  5 21:16 /tmp/pthread.dump.49954.10
-rw-r--r--  1 robert  wheel  1856 Oct  5 21:16 /tmp/pthread.dump.49954.11
-rw-r--r--  1 robert  wheel  1856 Oct  5 21:16 /tmp/pthread.dump.49954.12
-rw-r--r--  1 robert  wheel  1856 Oct  5 21:16 /tmp/pthread.dump.49954.13
-rw-r--r--  1 robert  wheel  1856 Oct  5 21:16 /tmp/pthread.dump.49954.2
-rw-r--r--  1 robert  wheel  1857 Oct  5 21:16 /tmp/pthread.dump.49954.3
-rw-r--r--  1 robert  wheel  1856 Oct  5 21:16 /tmp/pthread.dump.49954.4
-rw-r--r--  1 robert  wheel  1857 Oct  5 21:16 /tmp/pthread.dump.49954.5
-rw-r--r--  1 robert  wheel  1856 Oct  5 21:16 /tmp/pthread.dump.49954.6
-rw-r--r--  1 robert  wheel  1856 Oct  5 21:16 /tmp/pthread.dump.49954.7
-rw-r--r--  1 robert  wheel  1856 Oct  5 21:16 /tmp/pthread.dump.49954.8
-rw-r--r--  1 robert  wheel  1856 Oct  5 21:16 /tmp/pthread.dump.49954.9
-rw-r--r--  1 robert  wheel   338 Oct  5 21:16 /tmp/pthread.dump.49956.0
-rw-r--r--  1 robert  wheel   338 Oct  6 12:12 /tmp/pthread.dump.54401.0
-rw-r--r--  1 robert  wheel   338 Oct  6 12:18 /tmp/pthread.dump.54419.0
-rw-r--r--  1 robert  wheel  1016 Oct  6 12:11 /tmp/uthread.dump.54363.0
-rw-r--r--  1 robert  wheel  1016 Oct  6 12:12 /tmp/uthread.dump.54400.0
-rw-r--r--  1 robert  wheel  1016 Oct  6 12:12 /tmp/uthread.dump.54402.0

As you might guess, I like to hit ^T to find out what an application is 
doing.  Regardless of whether the application has its own SIGINFO handler 
or not.  libpthread should not implement SIGINFO unless some or another 
special circumstances apply -- environmental variable, or compile option, 
or such.

Robert N M Watson


More information about the freebsd-threads mailing list