START	sys/kern/signal/sigpthread	2025-03-27T02:14:49Z

==== run-block-thread-3-unblock-0 ====
cc -O2 -pipe  -g -Wall -Wpointer-arith -Wuninitialized -Wstrict-prototypes -Wmissing-prototypes -Wunused -Wsign-compare -Wshadow  -MD -MP  -c /usr/src/regress/sys/kern/signal/sigpthread/sigpthread.c
/usr/src/regress/sys/kern/signal/sigpthread/sigpthread.c:199:8: warning: cast to smaller integer type 'int' from 'void *' [-Wvoid-pointer-to-int-cast]
        ret = (int)val;
              ^~~~~~~~
/usr/src/regress/sys/kern/signal/sigpthread/sigpthread.c:205:9: warning: cast to smaller integer type 'int' from 'void *' [-Wvoid-pointer-to-int-cast]
                ret = (int)val;
                      ^~~~~~~~
/usr/src/regress/sys/kern/signal/sigpthread/sigpthread.c:247:13: warning: cast to smaller integer type 'int' from 'void *' [-Wvoid-pointer-to-int-cast]
        int tnum = (int)arg;
                   ^~~~~~~~
3 warnings generated.
cc   -o sigpthread sigpthread.o -lpthread
# block signal
# run 3 threads
# kill process
# suspend threads until signaled
# unblock thread 0
# handle signal
./sigpthread -b -t 3 -u 0 >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-block-thread-3-sleep-main-unblock-0 ====
# block signal
# run 3 threads
# suspend threads until signaled
# sleep in main thread, signal should be received while suspended
# kill process
# unblock thread 0
# handle signal
./sigpthread -b -s -t 3 -u 0 >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-block-thread-3-unblock-0-sleep-thread ====

==== run-block-thread-3-sleep-unblock-unblock-0 ====
# block signal
# run 3 threads
# kill process
# suspend threads until signaled
# sleep in thread 0, others should be exited when unblocking
# unblock thread 0
# handle signal
./sigpthread -b -t 3 -U -u 0 >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-block-thread-3-kill-0-unblock-0 ====
# block signal
# run 3 threads
# kill thread 0
# suspend threads until signaled
# unblock thread 0
# handle signal
./sigpthread -b -k 0 -t 3 -u 0 >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-block-thread-3-sleep-main-kill-0-unblock-0 ====
# block signal
# run 3 threads
# suspend threads until signaled
# sleep in main thread, signal should be received while suspended
# kill thread 0
# unblock thread 0
# handle signal
./sigpthread -b -k 0 -s -t 3 -u 0 >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-block-thread-3-kill-0-sleep-thread-unblock-0 ====
# block signal
# run 3 threads
# kill thread 0
# sleep in threads, signal should be pending when suspending
# suspend threads until signaled
# unblock thread 0
# handle signal
./sigpthread -b -k 0 -S -t 3 -u 0 >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-block-thread-3-kill-0-unblock-0-sleep-unblock ====
# block signal
# run 3 threads
# kill thread 0
# suspend threads until signaled
# sleep in thread 0, others should be exited when unblocking
# unblock thread 0
# handle signal
./sigpthread -b -k 0 -t 3 -U -u 0 >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-block-thread-3-kill-0 ====
# block signal
# run 3 threads
# kill thread 0
# suspend threads until signaled
# unblock all threads
# handle signal
./sigpthread -b -k 0 -t 3 >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-block-thread-3-sleep-main-kill-0 ====
# block signal
# run 3 threads
# suspend threads until signaled
# sleep in main thread, signal should be received while suspended
# kill thread 0
# unblock all threads
# handle signal
./sigpthread -b -k 0 -s -t 3 >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-block-thread-3-kill-0-sleep-thread ====
# block signal
# run 3 threads
# kill thread 0
# sleep in threads, signal should be pending when suspending
# suspend threads until signaled
# unblock all threads
# handle signal
./sigpthread -b -k 0 -S -t 3 >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-block-thread-3-kill-0-sleep-unblock ====
# block signal
# run 3 threads
# kill thread 0
# suspend threads until signaled
# sleep in all threads
# unblock all threads
# handle signal
./sigpthread -b -k 0 -t 3 -U >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-block-thread-3-unblock-1 ====
# block signal
# run 3 threads
# kill process
# suspend threads until signaled
# unblock thread 1
# handle signal
./sigpthread -b -t 3 -u 1 >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-block-thread-3-sleep-main-unblock-1 ====
# block signal
# run 3 threads
# suspend threads until signaled
# sleep in main thread, signal should be received while suspended
# kill process
# unblock thread 1
# handle signal
./sigpthread -b -s -t 3 -u 1 >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-block-thread-3-unblock-1-sleep-thread ====

==== run-block-thread-3-sleep-unblock-unblock-1 ====
# block signal
# run 3 threads
# kill process
# suspend threads until signaled
# sleep in thread 1, others should be exited when unblocking
# unblock thread 1
# handle signal
./sigpthread -b -t 3 -U -u 1 >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-block-thread-3-kill-1-unblock-1 ====
# block signal
# run 3 threads
# kill thread 1
# suspend threads until signaled
# unblock thread 1
# handle signal
./sigpthread -b -k 1 -t 3 -u 1 >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-block-thread-3-sleep-main-kill-1-unblock-1 ====
# block signal
# run 3 threads
# suspend threads until signaled
# sleep in main thread, signal should be received while suspended
# kill thread 1
# unblock thread 1
# handle signal
./sigpthread -b -k 1 -s -t 3 -u 1 >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-block-thread-3-kill-1-sleep-thread-unblock-1 ====
# block signal
# run 3 threads
# kill thread 1
# sleep in threads, signal should be pending when suspending
# suspend threads until signaled
# unblock thread 1
# handle signal
./sigpthread -b -k 1 -S -t 3 -u 1 >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-block-thread-3-kill-1-unblock-1-sleep-unblock ====
# block signal
# run 3 threads
# kill thread 1
# suspend threads until signaled
# sleep in thread 1, others should be exited when unblocking
# unblock thread 1
# handle signal
./sigpthread -b -k 1 -t 3 -U -u 1 >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-block-thread-3-kill-1 ====
# block signal
# run 3 threads
# kill thread 1
# suspend threads until signaled
# unblock all threads
# handle signal
./sigpthread -b -k 1 -t 3 >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-block-thread-3-sleep-main-kill-1 ====
# block signal
# run 3 threads
# suspend threads until signaled
# sleep in main thread, signal should be received while suspended
# kill thread 1
# unblock all threads
# handle signal
./sigpthread -b -k 1 -s -t 3 >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-block-thread-3-kill-1-sleep-thread ====
# block signal
# run 3 threads
# kill thread 1
# sleep in threads, signal should be pending when suspending
# suspend threads until signaled
# unblock all threads
# handle signal
./sigpthread -b -k 1 -S -t 3 >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-block-thread-3-kill-1-sleep-unblock ====
# block signal
# run 3 threads
# kill thread 1
# suspend threads until signaled
# sleep in all threads
# unblock all threads
# handle signal
./sigpthread -b -k 1 -t 3 -U >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-block-thread-3-unblock-2 ====
# block signal
# run 3 threads
# kill process
# suspend threads until signaled
# unblock thread 2
# handle signal
./sigpthread -b -t 3 -u 2 >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-block-thread-3-sleep-main-unblock-2 ====
# block signal
# run 3 threads
# suspend threads until signaled
# sleep in main thread, signal should be received while suspended
# kill process
# unblock thread 2
# handle signal
./sigpthread -b -s -t 3 -u 2 >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-block-thread-3-unblock-2-sleep-thread ====

==== run-block-thread-3-sleep-unblock-unblock-2 ====
# block signal
# run 3 threads
# kill process
# suspend threads until signaled
# sleep in thread 2, others should be exited when unblocking
# unblock thread 2
# handle signal
./sigpthread -b -t 3 -U -u 2 >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-block-thread-3-kill-2-unblock-2 ====
# block signal
# run 3 threads
# kill thread 2
# suspend threads until signaled
# unblock thread 2
# handle signal
./sigpthread -b -k 2 -t 3 -u 2 >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-block-thread-3-sleep-main-kill-2-unblock-2 ====
# block signal
# run 3 threads
# suspend threads until signaled
# sleep in main thread, signal should be received while suspended
# kill thread 2
# unblock thread 2
# handle signal
./sigpthread -b -k 2 -s -t 3 -u 2 >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-block-thread-3-kill-2-sleep-thread-unblock-2 ====
# block signal
# run 3 threads
# kill thread 2
# sleep in threads, signal should be pending when suspending
# suspend threads until signaled
# unblock thread 2
# handle signal
./sigpthread -b -k 2 -S -t 3 -u 2 >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-block-thread-3-kill-2-unblock-2-sleep-unblock ====
# block signal
# run 3 threads
# kill thread 2
# suspend threads until signaled
# sleep in thread 2, others should be exited when unblocking
# unblock thread 2
# handle signal
./sigpthread -b -k 2 -t 3 -U -u 2 >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-block-thread-3-kill-2 ====
# block signal
# run 3 threads
# kill thread 2
# suspend threads until signaled
# unblock all threads
# handle signal
./sigpthread -b -k 2 -t 3 >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-block-thread-3-sleep-main-kill-2 ====
# block signal
# run 3 threads
# suspend threads until signaled
# sleep in main thread, signal should be received while suspended
# kill thread 2
# unblock all threads
# handle signal
./sigpthread -b -k 2 -s -t 3 >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-block-thread-3-kill-2-sleep-thread ====
# block signal
# run 3 threads
# kill thread 2
# sleep in threads, signal should be pending when suspending
# suspend threads until signaled
# unblock all threads
# handle signal
./sigpthread -b -k 2 -S -t 3 >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-block-thread-3-kill-2-sleep-unblock ====
# block signal
# run 3 threads
# kill thread 2
# suspend threads until signaled
# sleep in all threads
# unblock all threads
# handle signal
./sigpthread -b -k 2 -t 3 -U >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-block-thread-3 ====
# block signal
# run 3 threads
# kill process
# suspend threads until signaled
# unblock all threads
# handle signal
./sigpthread -b -t 3 >out
grep 'signal [0-2]' out
signal 0
test `wc -l <out` = 1

==== run-block-thread-3-sleep-main ====
# block signal
# run 3 threads
# suspend threads until signaled
# sleep in main thread, signal should be received while suspended
# kill process
# unblock all threads
# handle signal
./sigpthread -b -s -t 3 >out
grep 'signal [0-2]' out
signal 2
test `wc -l <out` = 1

==== run-block-thread-3-sleep-thread ====
# block signal
# run 3 threads
# kill process
# sleep in threads, signal should be pending when suspending
# suspend threads until signaled
# unblock all threads
# handle signal
./sigpthread -b -S -t 3 >out
grep 'signal [0-2]' out
signal 1
test `wc -l <out` = 1

==== run-block-thread-3-sleep-unblock ====
# block signal
# run 3 threads
# kill process
# suspend threads until signaled
# sleep in all threads
# unblock all threads
# handle signal
./sigpthread -b -t 3 -U >out
grep 'signal [0-2]' out
signal 1
test `wc -l <out` = 1

==== run-thread-3-kill-0 ====
# run 3 threads
# kill thread 0
# handle signal
# suspend threads until signaled
./sigpthread -k 0 -t 3 >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-thread-3-sleep-main-kill-0 ====
# run 3 threads
# suspend threads until signaled
# sleep in main thread, signal should be received while suspended
# kill thread 0
# handle signal
./sigpthread -k 0 -s -t 3 >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-thread-3-kill-0-sleep-thread ====
# run 3 threads
# kill thread 0
# sleep in threads, signal should be received while sleeping
# handle signal
# suspend threads until signaled
./sigpthread -k 0 -S -t 3 >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-thread-3-kill-0-sleep-unblock ====
# run 3 threads
# kill thread 0
# handle signal
# suspend threads until signaled
# sleep in all threads
./sigpthread -k 0 -t 3 -U >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-thread-3-kill-1 ====
# run 3 threads
# kill thread 1
# handle signal
# suspend threads until signaled
./sigpthread -k 1 -t 3 >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-thread-3-sleep-main-kill-1 ====
# run 3 threads
# suspend threads until signaled
# sleep in main thread, signal should be received while suspended
# kill thread 1
# handle signal
./sigpthread -k 1 -s -t 3 >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-thread-3-kill-1-sleep-thread ====
# run 3 threads
# kill thread 1
# sleep in threads, signal should be received while sleeping
# handle signal
# suspend threads until signaled
./sigpthread -k 1 -S -t 3 >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-thread-3-kill-1-sleep-unblock ====
# run 3 threads
# kill thread 1
# handle signal
# suspend threads until signaled
# sleep in all threads
./sigpthread -k 1 -t 3 -U >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-thread-3-kill-2 ====
# run 3 threads
# kill thread 2
# handle signal
# suspend threads until signaled
./sigpthread -k 2 -t 3 >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-thread-3-sleep-main-kill-2 ====
# run 3 threads
# suspend threads until signaled
# sleep in main thread, signal should be received while suspended
# kill thread 2
# handle signal
./sigpthread -k 2 -s -t 3 >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-thread-3-kill-2-sleep-thread ====
# run 3 threads
# kill thread 2
# sleep in threads, signal should be received while sleeping
# handle signal
# suspend threads until signaled
./sigpthread -k 2 -S -t 3 >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-thread-3-kill-2-sleep-unblock ====
# run 3 threads
# kill thread 2
# handle signal
# suspend threads until signaled
# sleep in all threads
./sigpthread -k 2 -t 3 -U >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-thread-3 ====
# run 3 threads
# kill process
# handle signal
# suspend threads until signaled
./sigpthread -t 3 >out
grep 'signal [0-2]' out
signal 0
test `wc -l <out` = 1

==== run-thread-3-sleep-main ====
# block signal
# run 3 threads
# suspend threads until signaled
# sleep in main thread, signal should be received while suspended
# kill process
# handle signal
./sigpthread -s -t 3 >out
grep 'signal [0-2]' out
signal 0
test `wc -l <out` = 1

==== run-thread-3-sleep-thread ====
# run 3 threads
# kill process
# sleep in threads, signal should be received while sleeping
# handle signal
# suspend threads until signaled
./sigpthread -S -t 3 >out
grep 'signal [0-2]' out
signal 0
test `wc -l <out` = 1

==== run-thread-3-sleep-unblock ====
# run 3 threads
# kill process
# handle signal
# suspend threads until signaled
# sleep in all threads
./sigpthread -t 3 -U >out
grep 'signal [0-2]' out
signal 0
test `wc -l <out` = 1

==== run-block-thread-3-waiter-0 ====
# block signal
# run 3 threads
# kill process
# wait for signal in thread 0
# suspend threads until signaled
./sigpthread -b -t 3 -w 0 >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-block-thread-3-sleep-main-waiter-0 ====
# block signal
# run 3 threads
# wait for signal in thread 0
# suspend threads until signaled
# sleep in main thread, signal should be received while waiting
# kill process
./sigpthread -b -s -t 3 -w 0 >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-block-thread-3-waiter-0-sleep-thread ====

==== run-block-thread-3-kill-0-waiter-0 ====
# block signal
# run 3 threads
# kill thread 0
# wait for signal in thread 0
# suspend threads until signaled
./sigpthread -b -k 0 -t 3 -w 0 >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-block-thread-3-sleep-main-kill-0-waiter-0 ====
# block signal
# run 3 threads
# wait for signal in thread 0
# suspend threads until signaled
# sleep in main thread, signal should be received while waiting
# kill thread 0
./sigpthread -b -k 0 -s -t 3 -w 0 >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-block-thread-3-kill-0-sleep-thread-waiter-0 ====
# block signal
# run 3 threads
# kill thread 0
# sleep in threads, signal should be pending when waiting
# wait for signal in thread 0
# suspend threads until signaled
./sigpthread -b -k 0 -S -t 3 -w 0 >out
grep 'signal 0' out
signal 0
test `wc -l <out` = 1

==== run-block-thread-3-waiter-1 ====
# block signal
# run 3 threads
# kill process
# wait for signal in thread 1
# suspend threads until signaled
./sigpthread -b -t 3 -w 1 >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-block-thread-3-sleep-main-waiter-1 ====
# block signal
# run 3 threads
# wait for signal in thread 1
# suspend threads until signaled
# sleep in main thread, signal should be received while waiting
# kill process
./sigpthread -b -s -t 3 -w 1 >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-block-thread-3-waiter-1-sleep-thread ====

==== run-block-thread-3-kill-1-waiter-1 ====
# block signal
# run 3 threads
# kill thread 1
# wait for signal in thread 1
# suspend threads until signaled
./sigpthread -b -k 1 -t 3 -w 1 >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-block-thread-3-sleep-main-kill-1-waiter-1 ====
# block signal
# run 3 threads
# wait for signal in thread 1
# suspend threads until signaled
# sleep in main thread, signal should be received while waiting
# kill thread 1
./sigpthread -b -k 1 -s -t 3 -w 1 >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-block-thread-3-kill-1-sleep-thread-waiter-1 ====
# block signal
# run 3 threads
# kill thread 1
# sleep in threads, signal should be pending when waiting
# wait for signal in thread 1
# suspend threads until signaled
./sigpthread -b -k 1 -S -t 3 -w 1 >out
grep 'signal 1' out
signal 1
test `wc -l <out` = 1

==== run-block-thread-3-waiter-2 ====
# block signal
# run 3 threads
# kill process
# wait for signal in thread 2
# suspend threads until signaled
./sigpthread -b -t 3 -w 2 >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-block-thread-3-sleep-main-waiter-2 ====
# block signal
# run 3 threads
# wait for signal in thread 2
# suspend threads until signaled
# sleep in main thread, signal should be received while waiting
# kill process
./sigpthread -b -s -t 3 -w 2 >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-block-thread-3-waiter-2-sleep-thread ====

==== run-block-thread-3-kill-2-waiter-2 ====
# block signal
# run 3 threads
# kill thread 2
# wait for signal in thread 2
# suspend threads until signaled
./sigpthread -b -k 2 -t 3 -w 2 >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-block-thread-3-sleep-main-kill-2-waiter-2 ====
# block signal
# run 3 threads
# wait for signal in thread 2
# suspend threads until signaled
# sleep in main thread, signal should be received while waiting
# kill thread 2
./sigpthread -b -k 2 -s -t 3 -w 2 >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-block-thread-3-kill-2-sleep-thread-waiter-2 ====
# block signal
# run 3 threads
# kill thread 2
# sleep in threads, signal should be pending when waiting
# wait for signal in thread 2
# suspend threads until signaled
./sigpthread -b -k 2 -S -t 3 -w 2 >out
grep 'signal 2' out
signal 2
test `wc -l <out` = 1

==== run-block-thread-100-unblock-23 ====
# block signal
# run 100 threads
# kill process
# suspend threads until signaled
# unblock thread 23
# handle signal
./sigpthread -b -t 100 -u 23 >out
grep 'signal 23' out
signal 23
test `wc -l <out` = 1

==== run-block-thread-100-waiter-42 ====
# block signal
# run 100 threads
# kill process
# wait for signal in thread 42
# suspend threads until signaled
./sigpthread -b -t 100 -w 42 >out
grep 'signal 42' out
signal 42
test `wc -l <out` = 1

PASS	sys/kern/signal/sigpthread	Duration 0m51.42s