[Bug 283101] pthread_cancel() doesn't cancel a thread that's currently in pause()

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 19 Dec 2024 09:50:39 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=283101

--- Comment #12 from vedad@kajtaz.net ---
(In reply to Konstantin Belousov from comment #11)

(gdb) thread apply all bt full

Thread 2 (LWP 215869 of process 56582):
#0  _sigsuspend () at _sigsuspend.S:4
No locals.
#1  0x000000082268cfb6 in __thr_sigsuspend (set=0x8269d3f90) at
/usr/src/lib/libthr/thread/thr_sig.c:688
        newset = {__bits = {0, 0, 0, 0}}
        curthread = 0x3a2768013500
        old = 0
        ret = <optimized out>
#2  0x0000000823a09a65 in __pause () at /usr/src/lib/libc/gen/pause.c:51
        oset = {__bits = {0, 0, 0, 0}}
#3  0x0000000000201ac5 in thread ()
No symbol table info available.
#4  0x0000000822683b05 in thread_start (curthread=0x3a2768013500) at
/usr/src/lib/libthr/thread/thr_create.c:289
        set = {__bits = {0, 0, 660918232, 8}}
#5  0x0000000000000000 in ?? ()
No symbol table info available.
Backtrace stopped: Cannot access memory at address 0x8269d4000

Thread 1 (LWP 100557 of process 56582):
#0  _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:38
No locals.
#1  0x0000000822690cdb in _thr_umtx_wait (mtx=0x3a2768013500, id=215869,
timeout=0x0) at /usr/src/lib/libthr/thread/thr_umtx.c:198
No locals.
#2  0x0000000822685a2e in join_common (pthread=0x3a2768013500,
thread_return=0x820817e20, abstime=0x0, peek=<optimized out>) at
/usr/src/lib/libthr/thread/thr_join.c:144
        __cup = {prev = 0x0, routine = 0x822685ba0 <backout_join>, routine_arg
= 0x3a2768013500, onheap = 0}
        ts = {tv_sec = 34905095632, tv_nsec = 34937006492}
        ts2 = {tv_sec = 100557, tv_nsec = 63940923039744}
        curthread = 0x3a2768012000
        ret = <optimized out>
        tid = 215869
        tsp = 0x34b3d
        tmp = <optimized out>
#3  0x0000000000201a4a in main ()
No symbol table info available.
(gdb) frame 2
#2  0x0000000822685a2e in join_common (pthread=0x3a2768013500,
thread_return=0x820817e20, abstime=0x0, peek=<optimized out>) at
/usr/src/lib/libthr/thread/thr_join.c:144
144                     ret = _thr_umtx_wait(&pthread->tid, tid, tsp);
(gdb) print *pthread
$2 = {tid = 215869, lock = {m_owner = 0, m_flags = 0, m_ceilings = {0, 0},
m_rb_lnk = 0, m_spare = {0, 0}}, cycle = 0, locklevel = 0, critical_count = 0,
sigblock = 0, fsigblock = 0, tle = {tqe_next = 0x3a2768012000, tqe_prev =
0x822694580 <_thread_list>}, gcle = {
    tqe_next = 0x0, tqe_prev = 0x0}, hle = {le_next = 0x0, le_prev =
0x822694e58}, wle = {tqe_next = 0x0, tqe_prev = 0x0}, refcount = 1,
start_routine = 0x201ab0 <thread>, arg = 0x0, attr = {sched_policy = 2,
sched_inherit = 4, prio = 0, suspend = 0, flags = 2,
    stackaddr_attr = 0x8267d4000, stacksize_attr = 2097152, guardsize_attr =
4096, cpuset = 0x0, cpusetsize = 0}, cancel_enable = 1, cancel_pending = 1,
cancel_point = 1, no_cancel = 0, cancel_async = 0, cancelling = 0, sigmask =
{__bits = {0, 0, 0, 0}},
  unblock_sigcancel = 0, in_sigsuspend = 1, deferred_siginfo = {si_signo = 0,
si_errno = 0, si_code = 0, si_pid = 0, si_uid = 0, si_status = 0, si_addr =
0x0, si_value = {sival_int = 0, sival_ptr = 0x0, sigval_int = 0, sigval_ptr =
0x0}, _reason = {_fault = {
        _trapno = 0}, _timer = {_timerid = 0, _overrun = 0}, _mesgq = {_mqd =
0}, _poll = {_band = 0}, _capsicum = {_syscall = 0}, __spare__ = {__spare1__ =
0, __spare2__ = {0, 0, 0, 0, 0, 0, 0}}}}, deferred_sigmask = {__bits = {0, 0,
0, 0}}, deferred_sigact = {
    __sigaction_u = {__sa_handler = 0x0, __sa_sigaction = 0x0}, sa_flags = 0,
sa_mask = {__bits = {0, 0, 0, 0}}}, deferred_run = 0, force_exit = 0, state =
PS_RUNNING, error = 0, joiner = 0x3a2768012000, flags = 0, tlflags = 2, mq =
{{tqh_first = 0x0,
      tqh_last = 0x3a27680136a8}, {tqh_first = 0x0, tqh_last = 0x3a27680136b8},
{tqh_first = 0x0, tqh_last = 0x3a27680136c8}, {tqh_first = 0x0, tqh_last =
0x3a27680136d8}, {tqh_first = 0x0, tqh_last = 0x3a27680136e8}, {tqh_first =
0x0, tqh_last = 0x3a27680136f8}},
  ret = 0x0, specific = 0x0, specific_data_count = 0, rdlock_count = 0,
rtld_bits = 0, tcb = 0x3a276860b120, cleanup = 0x0, ex = {exception_class = 0,
exception_cleanup = 0x0, private_1 = 0, private_2 = 0}, unwind_stackend =
0x8269d4000, unwind_disabled = 0,
  magic = 3499860245, report_events = 0, event_mask = 0, event_buf = {event =
TD_EVENT_NONE, th_p = 0, data = 0}, wchan = 0x0, mutex_obj = 0x0, will_sleep =
0, nwaiter_defer = 0, robust_inited = 0, robust_list = 0, priv_robust_list = 0,
inact_mtx = 0, defer_waiters = {
    0x0 <repeats 50 times>}, wake_addr = 0x3a2768600030, sleepqueue =
0x3a27680190c0, name = 0x0, dlerror_msg = '\000' <repeats 511 times>,
dlerror_seen = 0}

-- 
You are receiving this mail because:
You are the assignee for the bug.