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

[email protected] Thu, 19 Dec 2024 09:50:39 +0000
Newsgroups gmane.os.freebsd.devel.threading
Message-ID <[email protected]/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D283101

--- Comment #12 from [email protected] ---
(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=3D0x8269d3f90) at
/usr/src/lib/libthr/thread/thr_sig.c:688
        newset =3D {__bits =3D {0, 0, 0, 0}}
        curthread =3D 0x3a2768013500
        old =3D 0
        ret =3D <optimized out>
#2  0x0000000823a09a65 in __pause () at /usr/src/lib/libc/gen/pause.c:51
        oset =3D {__bits =3D {0, 0, 0, 0}}
#3  0x0000000000201ac5 in thread ()
No symbol table info available.
#4  0x0000000822683b05 in thread_start (curthread=3D0x3a2768013500) at
/usr/src/lib/libthr/thread/thr_create.c:289
        set =3D {__bits =3D {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=3D0x3a2768013500, id=3D215869,
timeout=3D0x0) at /usr/src/lib/libthr/thread/thr_umtx.c:198
No locals.
#2  0x0000000822685a2e in join_common (pthread=3D0x3a2768013500,
thread_return=3D0x820817e20, abstime=3D0x0, peek=3D<optimized out>) at
/usr/src/lib/libthr/thread/thr_join.c:144
        __cup =3D {prev =3D 0x0, routine =3D 0x822685ba0 <backout_join>, ro=
utine_arg
=3D 0x3a2768013500, onheap =3D 0}
        ts =3D {tv_sec =3D 34905095632, tv_nsec =3D 34937006492}
        ts2 =3D {tv_sec =3D 100557, tv_nsec =3D 63940923039744}
        curthread =3D 0x3a2768012000
        ret =3D <optimized out>
        tid =3D 215869
        tsp =3D 0x34b3d
        tmp =3D <optimized out>
#3  0x0000000000201a4a in main ()
No symbol table info available.
(gdb) frame 2
#2  0x0000000822685a2e in join_common (pthread=3D0x3a2768013500,
thread_return=3D0x820817e20, abstime=3D0x0, peek=3D<optimized out>) at
/usr/src/lib/libthr/thread/thr_join.c:144
144                     ret =3D _thr_umtx_wait(&pthread->tid, tid, tsp);
(gdb) print *pthread
$2 =3D {tid =3D 215869, lock =3D {m_owner =3D 0, m_flags =3D 0, m_ceilings =
=3D {0, 0},
m_rb_lnk =3D 0, m_spare =3D {0, 0}}, cycle =3D 0, locklevel =3D 0, critical=
_count =3D 0,
sigblock =3D 0, fsigblock =3D 0, tle =3D {tqe_next =3D 0x3a2768012000, tqe_=
prev =3D
0x822694580 <_thread_list>}, gcle =3D {
    tqe_next =3D 0x0, tqe_prev =3D 0x0}, hle =3D {le_next =3D 0x0, le_prev =
=3D
0x822694e58}, wle =3D {tqe_next =3D 0x0, tqe_prev =3D 0x0}, refcount =3D 1,
start_routine =3D 0x201ab0 <thread>, arg =3D 0x0, attr =3D {sched_policy =
=3D 2,
sched_inherit =3D 4, prio =3D 0, suspend =3D 0, flags =3D 2,
    stackaddr_attr =3D 0x8267d4000, stacksize_attr =3D 2097152, guardsize_a=
ttr =3D
4096, cpuset =3D 0x0, cpusetsize =3D 0}, cancel_enable =3D 1, cancel_pendin=
g =3D 1,
cancel_point =3D 1, no_cancel =3D 0, cancel_async =3D 0, cancelling =3D 0, =
sigmask =3D
{__bits =3D {0, 0, 0, 0}},
  unblock_sigcancel =3D 0, in_sigsuspend =3D 1, deferred_siginfo =3D {si_si=
gno =3D 0,
si_errno =3D 0, si_code =3D 0, si_pid =3D 0, si_uid =3D 0, si_status =3D 0,=
 si_addr =3D
0x0, si_value =3D {sival_int =3D 0, sival_ptr =3D 0x0, sigval_int =3D 0, si=
gval_ptr =3D
0x0}, _reason =3D {_fault =3D {
        _trapno =3D 0}, _timer =3D {_timerid =3D 0, _overrun =3D 0}, _mesgq=
 =3D {_mqd =3D
0}, _poll =3D {_band =3D 0}, _capsicum =3D {_syscall =3D 0}, __spare__ =3D =
{__spare1__ =3D
0, __spare2__ =3D {0, 0, 0, 0, 0, 0, 0}}}}, deferred_sigmask =3D {__bits =
=3D {0, 0,
0, 0}}, deferred_sigact =3D {
    __sigaction_u =3D {__sa_handler =3D 0x0, __sa_sigaction =3D 0x0}, sa_fl=
ags =3D 0,
sa_mask =3D {__bits =3D {0, 0, 0, 0}}}, deferred_run =3D 0, force_exit =3D =
0, state =3D
PS_RUNNING, error =3D 0, joiner =3D 0x3a2768012000, flags =3D 0, tlflags =
=3D 2, mq =3D
{{tqh_first =3D 0x0,
      tqh_last =3D 0x3a27680136a8}, {tqh_first =3D 0x0, tqh_last =3D 0x3a27=
680136b8},
{tqh_first =3D 0x0, tqh_last =3D 0x3a27680136c8}, {tqh_first =3D 0x0, tqh_l=
ast =3D
0x3a27680136d8}, {tqh_first =3D 0x0, tqh_last =3D 0x3a27680136e8}, {tqh_fir=
st =3D
0x0, tqh_last =3D 0x3a27680136f8}},
  ret =3D 0x0, specific =3D 0x0, specific_data_count =3D 0, rdlock_count =
=3D 0,
rtld_bits =3D 0, tcb =3D 0x3a276860b120, cleanup =3D 0x0, ex =3D {exception=
_class =3D 0,
exception_cleanup =3D 0x0, private_1 =3D 0, private_2 =3D 0}, unwind_stacke=
nd =3D
0x8269d4000, unwind_disabled =3D 0,
  magic =3D 3499860245, report_events =3D 0, event_mask =3D 0, event_buf =
=3D {event =3D
TD_EVENT_NONE, th_p =3D 0, data =3D 0}, wchan =3D 0x0, mutex_obj =3D 0x0, w=
ill_sleep =3D
0, nwaiter_defer =3D 0, robust_inited =3D 0, robust_list =3D 0, priv_robust=
_list =3D 0,
inact_mtx =3D 0, defer_waiters =3D {
    0x0 <repeats 50 times>}, wake_addr =3D 0x3a2768600030, sleepqueue =3D
0x3a27680190c0, name =3D 0x0, dlerror_msg =3D '\000' <repeats 511 times>,
dlerror_seen =3D 0}

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