SIGPROF and SIGVTALRM are not delivered to multi-threaded programs

Philippe Troin ptroin at buzzlogic.com
Mon May 7 23:32:49 UTC 2007


[I'm not subscribed to freebsd-bugs, please CC me on any replies]

See attached program.
Compile with:

  gcc -Wall -Wextra -o itimer-test itimer-test.c -lpthread

Run without threads:

  ./itimer-test

See that SIGPROF is delivered every few milliseconds.

Run with threads:

  ./itimer-test 1

SIGPROF is never delivered, either to the main thread or the other
thread.

Note that changing to ITIMER_VIRTUAL/SIGVTALARM does not work either.
ITIMER_REAL/SIGALRM seems to work though.

Phil.



More information about the freebsd-bugs mailing list