[Bug 283101] pthread_cancel() doesn't cancel a thread that's currently in pause()
Date: Fri, 20 Dec 2024 17:52:40 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=283101 --- Comment #17 from Konstantin Belousov <kib@FreeBSD.org> --- (In reply to vedad from comment #16) We seems to getting close, but still not quite. The victim thread was caught by SIGCANCEL inside the critical section. Then, returning from the section should have caused cancellation to trigger. Since it does not, and I verified manually all places where we leave critical counters, lets try with more debugging to see what happens. Please provide me with both the backtrace and the p *curthread on the victim thread. diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c index b953c430158c..9f7fcbe33566 100644 --- a/lib/libthr/thread/thr_sig.c +++ b/lib/libthr/thread/thr_sig.c @@ -191,8 +191,13 @@ sigcancel_handler(int sig __unused, struct pthread *curthread = _get_curthread(); int err; - if (THR_IN_CRITICAL(curthread)) + if (THR_IN_CRITICAL(curthread)) { + void *p[1]; + + p[0] = curthread; + abort2("thr_in_critical %p", 1, p); return; + } err = errno; check_suspend(curthread); check_cancel(curthread, ucp); -- You are receiving this mail because: You are the assignee for the bug.