From owner-freebsd-threads@freebsd.org Wed Aug 17 16:49:39 2016 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77A4EBBD2DC for ; Wed, 17 Aug 2016 16:49:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6748A1F3A for ; Wed, 17 Aug 2016 16:49:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HGndwA038820 for ; Wed, 17 Aug 2016 16:49:39 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-threads@FreeBSD.org Subject: [Bug 211947] bconsole won't die sitting on do_rw_wrlock Date: Wed, 17 Aug 2016 16:49:39 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: threads X-Bugzilla-Version: 10.3-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: longwitz@incore.de X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Aug 2016 16:49:39 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211947 Bug ID: 211947 Summary: bconsole won't die sitting on do_rw_wrlock Product: Base System Version: 10.3-STABLE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: threads Assignee: freebsd-threads@FreeBSD.org Reporter: longwitz@incore.de I am running 10.3-STABLE FreeBSD 10.3-STABLE #3 r301633 und try to run bcon= sole from the port bacula5-client (P4Q4). Often after some bconsole commands the bconsole process can not die when entering "quit".=20 With kgdb running on /dev/mem I can see the process: (kgdb) info threads ... 191 Thread 100880 (PID=3D66009: bconsole) sched_switch (td=3D0xfffff8008= d64d4b0, newtd=3D, flags=3D) at /usr/src/sys/kern/sched_ule.c:1945 ... (kgdb) thread 191 [Switching to thread 191 (Thread 100880)]#0 sched_switch (td=3D0xfffff8008d64d4b0, newtd=3D, flags=3D) at /usr/src/sys/kern/sched_ule.c:1945 1945 cpuid =3D PCPU_GET(cpuid); (kgdb) bt #0 sched_switch (td=3D0xfffff8008d64d4b0, newtd=3D, flags=3D) at /usr/src/sys/kern/sched_ule.c:1945 #1 0xffffffff80664d41 in mi_switch (flags=3D260, newtd=3D0x0) at /usr/src/sys/kern/kern_synch.c:491 #2 0xffffffff806a87ab in sleepq_catch_signals (wchan=3D0xfffff8012a366f00, pri=3D0) at /usr/src/sys/kern/subr_sleepqueue.c:426 #3 0xffffffff806a865f in sleepq_wait_sig (wchan=3D0x0, pri=3D0) at /usr/src/sys/kern/subr_sleepqueue.c:632 #4 0xffffffff8066474d in _sleep (ident=3D, lock=3D, priority=3D, wmesg=3D, sbt=3D, pr=3D, flags=3D) at /usr/src/sys/kern/kern_synch.c:253 #5 0xffffffff80678d55 in umtxq_sleep (uq=3D0xfffff8012a366f00, wmesg=3D0xffffffff80a2583c "uwrlck", abstime=3D0x0) at /usr/src/sys/kern/kern_umtx.c:780 #6 0xffffffff8067c2ef in do_rw_wrlock (td=3D0xfffff8008d64d4b0, rwlock=3D0x802270880, timeout=3D) at /usr/src/sys/kern/kern_umtx.c:3109 #7 0xffffffff8067ff77 in __umtx_op_rw_wrlock (td=3D, uap=3D) at /usr/src/sys/kern/kern_umtx.c:3657 #8 0xffffffff808edddf in amd64_syscall (td=3D0xfffff8008d64d4b0, traced=3D= 0) at subr_syscall.c:141 #9 0xffffffff808d29ab in Xfast_syscall () at /usr/src/sys/amd64/amd64/exception.S:398 kgdb) p *(struct thread *)0xfffff8008d64d4b0 $1 =3D {td_lock =3D 0xffffffff80e3d220, td_proc =3D 0xfffff800059a29e0, td_= plist =3D {tqe_next =3D 0x0, tqe_prev =3D 0xfffff800059a29f0}, td_runq =3D {tqe_next = =3D 0x0, tqe_prev =3D 0xffffffff80e07008}, td_slpq =3D {tqe_next =3D 0x0, tqe_pr= ev =3D 0xfffff800100d5980}, td_lockq =3D {tqe_next =3D 0x0, tqe_prev =3D 0xfffffe0231e18438}, td_hash =3D {le_next =3D 0x0, le_prev =3D 0xfffffe0000835080}, td_cpuset = =3D 0xfffff800042013a8, td_sel =3D 0xfffff801a28b2500, td_sleepqueue =3D 0x0, td_turnstile =3D 0xfffff80002fbd240, td_rlqe =3D 0xfffff800101aacf8, td_u= mtxq =3D 0xfffff8012a366f00, td_tid =3D 100880, td_sigqueue =3D {sq_signals =3D {__b= its =3D {0, 0, 0, 0}}, sq_kill =3D {__bits =3D {0, 0, 0, 0}}, sq_list =3D {tqh_fir= st =3D 0x0, tqh_last =3D 0xfffff8008d64d568}, sq_proc =3D 0xfffff800059a29e0, sq_flags = =3D 1}, td_lend_user_pri =3D 255 '=C3=BF', td_flags =3D 12, td_inhibitors =3D 2, = td_pflags =3D 0, td_dupfd =3D 0, td_sqqueue =3D 0, td_wchan =3D 0xfffff8012a366f00, td_wmesg =3D 0xffffffff80a2583c "uwrlck", td_lastcpu =3D 0 '\0', td_oncpu= =3D 255 '=C3=BF', td_owepreempt =3D 0 '\0', td_tsqueue =3D 0 '\0', td_locks =3D 399, td_rw_rlocks =3D 0, td_lk_slocks =3D 0, td_stopsched =3D 0, td_blocked = =3D 0x0, td_lockname =3D 0x0, td_contested =3D {lh_first =3D 0x0}, td_sleeplocks =3D= 0x0, td_intr_nesting_level =3D 0, td_pinned =3D 0, td_ucred =3D 0xfffff8004514= c700, td_estcpu =3D 0, td_slptick =3D 457002771, td_blktick =3D 0, td_swvoltick = =3D 457002771, td_cow =3D 104, td_ru =3D {ru_utime =3D {tv_sec =3D 0, tv_usec =3D 0}, ru= _stime =3D {tv_sec =3D 0, tv_usec =3D 0}, ru_maxrss =3D 6588, ru_ixrss =3D 252, ru_idr= ss =3D 28, ru_isrss =3D 896, ru_minflt =3D 325, ru_majflt =3D 0, ru_nswap =3D 0, r= u_inblock =3D 0, ru_oublock =3D 0, ru_msgsnd =3D 14, ru_msgrcv =3D 2353, ru_nsignals =3D = 0, ru_nvcsw =3D 121, ru_nivcsw =3D 9}, td_rux =3D {rux_runtime =3D 1515070= 80, rux_uticks =3D 5, rux_sticks =3D 2, rux_iticks =3D 0, rux_uu =3D 30135, rux= _su =3D 13070, rux_tu =3D 42189}, td_incruntime =3D 0, td_runtime =3D 151507080, td_pt= icks =3D 0, td_sticks =3D 0, td_iticks =3D 0, td_uticks =3D 0, td_intrval =3D 0, td_old= sigmask =3D { __bits =3D {0, 0, 0, 0}}, td_generation =3D 130, td_sigstk =3D {ss_sp = =3D 0x0, ss_size =3D 0, ss_flags =3D 4}, td_xsig =3D 0, td_profil_addr =3D 0, td_pro= fil_ticks =3D 0, td_name =3D "bconsole", '\0' , td_fpop =3D 0x0, td_dbgf= lags =3D 0, td_dbgksi =3D {ksi_link =3D {tqe_next =3D 0x0, tqe_prev =3D 0x0}, ksi_in= fo =3D { si_signo =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, sigval_ptr =3D 0x0}, _reason =3D {_fault =3D {_trapno =3D 0}, _time= r =3D {_timerid =3D 0, _overrun =3D 0}, _mesgq =3D {_mqd =3D 0}, _poll =3D {_band= =3D 0}, __spare__ =3D { __spare1__ =3D 0, __spare2__ =3D {0, 0, 0, 0, 0, 0, 0}}}}, ksi_fl= ags =3D 0, ksi_sigq =3D 0x0}, td_ng_outbound =3D 0, td_osd =3D {osd_nslots =3D 0, osd_= slots =3D 0x0, osd_next =3D {le_next =3D 0x0, le_prev =3D 0x0}}, td_map_def_user =3D 0= x0, td_dbg_forked =3D 0, td_vp_reserv =3D 0, td_no_sleeping =3D 0, td_dom_rr_id= x =3D 0, td_sigmask =3D { __bits =3D {0, 0, 0, 0}}, td_rqindex =3D 30 '\036', td_base_pri =3D 120= 'x', td_priority =3D 120 'x', td_pri_class =3D 3 '\003', td_user_pri =3D 120 'x', td_base_user_pri =3D 120 'x', td_pcb =3D 0xfffffe0231f2bcc0, td_state =3D TDS_INHIBITED, td_retval =3D {0, 0}, td_slpcallout =3D {c_links =3D {le =3D= { le_next =3D 0xfffffe00007eb2c0, le_prev =3D 0xfffffe0000801de8}, sl= e =3D {sle_next =3D 0xfffffe00007eb2c0}, tqe =3D {tqe_next =3D 0xfffffe00007eb2c0, tqe_prev =3D 0xfffffe0000801de8}}, c_time =3D 1962816112194023, c_p= recision =3D 26843, c_arg =3D 0xfffff8008d64d4b0, c_func =3D 0xffffffff806a8220 , c_lock =3D 0x0, c_flags= =3D 2, c_iflags =3D 272, c_cpu =3D 0}, td_frame =3D 0xfffffe0231f2bc00, td_kstack_obj =3D 0xfffff8013d46ea00, td_kstack =3D 18446741884114206720, td_kstack_pages =3D 4, td_critnest =3D 1, td_md =3D {md_spinlock_count =3D = 1, md_saved_flags =3D 582, md_spurflt_addr =3D 34414718976}, td_sched =3D 0xfffff8008d64d930, td_ar =3D 0x0, td_lprof =3D {{lh_first =3D 0x0}, {lh_fi= rst =3D 0x0}}, td_dtrace =3D 0xfffff8003e02d000, td_errno =3D 0, td_vnet =3D 0x0, td_vne= t_lpush =3D 0x0, td_intr_frame =3D 0x0, td_rfppwait_p =3D 0xfffff801a2d224f0, td_ma =3D= 0x0, td_ma_cnt =3D 0, td_su =3D 0x0, td_dbg_sc_code =3D 0, td_dbg_sc_narg =3D = 0, td_emuldata =3D 0x0} (kgdb) p *(struct proc *)0xfffff800059a29e0 $2 =3D {p_list =3D {le_next =3D 0xfffff80010d209e0, le_prev =3D 0xfffff8000= 556c000}, p_threads =3D {tqh_first =3D 0xfffff8008d64d4b0, tqh_last =3D 0xfffff8008d6= 4d4c0}, p_slock =3D {lock_object =3D {lo_name =3D 0xffffffff80a22eb0 "process slo= ck", lo_flags =3D 720896, lo_data =3D 0, lo_witness =3D 0x0}, mtx_lock =3D 4}, p_ucred =3D 0xfffff8004514c700, p_fd =3D 0xfffff801d97ba800, p_fdtol =3D = 0x0, p_stats =3D 0xfffff80005889800, p_limit =3D 0xfffff800055cc800, p_limco =3D= {c_links =3D { le =3D {le_next =3D 0x0, le_prev =3D 0x0}, sle =3D {sle_next =3D 0x0}= , tqe =3D {tqe_next =3D 0x0, tqe_prev =3D 0x0}}, c_time =3D 0, c_precision =3D 0, c_a= rg =3D 0x0, c_func =3D 0, c_lock =3D 0xfffff800059a2ae0, c_flags =3D 0, c_iflags = =3D 0, c_cpu =3D 0}, p_sigacts =3D 0xfffff801a1ce4000, p_flag =3D 268451970, p_flag2 =3D 0, p_state =3D PRS_NORMAL, p_pid =3D 66009, p_hash =3D {le_next =3D 0x0, le_= prev =3D 0xfffffe00006beec8}, p_pglist =3D {le_next =3D 0x0, le_prev =3D 0xfffff8011= 2b3df10}, p_pptr =3D 0xfffff801a2e549e0, p_sibling =3D {le_next =3D 0x0, le_prev =3D 0xfffff801a2e54ad8}, p_children =3D {lh_first =3D 0x0}, p_mtx =3D {lock_obj= ect =3D { lo_name =3D 0xffffffff80a22ea3 "process lock", lo_flags =3D 21168128,= lo_data =3D 0, lo_witness =3D 0x0}, mtx_lock =3D 4}, p_ksi =3D 0xfffff80004e76620, = p_sigqueue =3D { sq_signals =3D {__bits =3D {0, 0, 0, 0}}, sq_kill =3D {__bits =3D {0, 0= , 0, 0}}, sq_list =3D {tqh_first =3D 0x0, tqh_last =3D 0xfffff800059a2b28}, sq_proc =3D 0xfffff800059a29e0, sq_flags =3D 1}, p_oppid =3D 0, p_vmspa= ce =3D 0xfffff8001032cc40, p_swtick =3D 456987934, p_realtimer =3D {it_interval = =3D {tv_sec =3D 0, tv_usec =3D 0}, it_value =3D {tv_sec =3D 0, tv_usec =3D 0}}, p_ru =3D= {ru_utime =3D {tv_sec =3D 0, tv_usec =3D 0}, ru_stime =3D {tv_sec =3D 0, tv_usec =3D 0}, = ru_maxrss =3D 0, ru_ixrss =3D 0, ru_idrss =3D 0, ru_isrss =3D 0, ru_minflt =3D 40, ru_ma= jflt =3D 0, ru_nswap =3D 0, ru_inblock =3D 0, ru_oublock =3D 0, ru_msgsnd =3D 0, ru_msg= rcv =3D 0, ru_nsignals =3D 1, ru_nvcsw =3D 7, ru_nivcsw =3D 0}, p_rux =3D {rux_run= time =3D 155793645, rux_uticks =3D 5, rux_sticks =3D 2, rux_iticks =3D 0, rux_uu =3D= 30987, rux_su =3D 13289, rux_tu =3D 43383}, p_crux =3D {rux_runtime =3D 0, rux= _uticks =3D 0, rux_sticks =3D 0, rux_iticks =3D 0, rux_uu =3D 0, rux_su =3D 0, rux_tu =3D = 0}, p_profthreads =3D 0, p_exitthreads =3D 0, p_traceflag =3D 0, p_tracevp = =3D 0x0, p_tracecred =3D 0x0, p_textvp =3D 0xfffff8019c7bb588, p_lock =3D 0, p_sigio= lst =3D { slh_first =3D 0x0}, p_sigparent =3D 20, p_sig =3D 0, p_code =3D 0, p_st= ops =3D 0, p_stype =3D 0, p_step =3D 0 '\0', p_pfsflags =3D 0 '\0', p_nlminfo =3D 0x0,= p_aioinfo =3D 0x0, p_singlethread =3D 0x0, p_suspcount =3D 0, p_xthread =3D 0x0, p_boundary_= count =3D 0, p_pendingcnt =3D 0, p_itimers =3D 0x0, p_procdesc =3D 0x0, p_magic =3D 3203= 398350, p_osrel =3D 1003500, p_comm =3D "bconsole", '\0' , p_pa= d0 =3D 0x0, p_sysent =3D 0xffffffff80d18db8, p_args =3D 0xfffff801a294b720, p_cpulimit =3D 9223372036854775807, p_nice =3D 0 '\0', p_fibnum =3D 0, p_= xstat =3D 0, p_klist =3D {kl_list =3D {slh_first =3D 0x0}, kl_lock =3D 0xffffffff80620190 , kl_unlock =3D 0xffffffff806201d0 , kl_assert_locked =3D 0xffffffff80620210 , kl_assert_unlocked =3D 0xffffffff80620220 , kl_lockarg =3D 0xfffff800059a2ae0}, p_numthreads =3D 1, p_md =3D {md_ld= t =3D 0x0, md_ldt_sd =3D {sd_lolimit =3D 0, sd_lobase =3D 0, sd_type =3D 0, sd_dpl =3D= 0, sd_p =3D 0, sd_hilimit =3D 0, sd_xx0 =3D 0, sd_gran =3D 0, sd_hibase =3D 0, sd_xx= 1 =3D 0, sd_mbz =3D 0, sd_xx2 =3D 0}}, p_itcallout =3D {c_links =3D {le =3D {le_next= =3D 0x0, le_prev =3D 0x0}, sle =3D {sle_next =3D 0x0}, tqe =3D {tqe_next =3D= 0x0, tqe_prev =3D 0x0}}, c_time =3D 0, c_precision =3D 0, c_arg =3D 0x0, c_func =3D 0, c_lock =3D 0xfffff800059a2ae0, c_flags =3D 0, c_iflags =3D 0, c_cpu =3D= 0}, p_acflag =3D 0, p_peers =3D 0x0, p_leader =3D 0xfffff800059a29e0, p_emuldat= a =3D 0x0, p_label =3D 0x0, p_sched =3D 0xfffff800059a2ed0, p_ktr =3D {stqh_first = =3D 0x0, stqh_last =3D 0xfffff800059a2e28}, p_mqnotifier =3D {lh_first =3D 0x0}, p_dtrace =3D 0xfffff801d965f280, p_pwait =3D {cv_description =3D 0xffffff= ff80a239ab "ppwait", cv_waiters =3D 0}, p_dbgwait =3D { cv_description =3D 0xffffffff80a239b2 "dbgwait", cv_waiters =3D 0}, p_prev_runtime =3D 0, p_racct =3D 0x0, p_throttled =3D 0 '\0', p_orphan =3D= {le_next =3D 0x0, le_prev =3D 0x0}, p_orphans =3D {lh_first =3D 0x0}, p_treeflag =3D 0, p= _reaper =3D 0xfffff800042104f0, p_reaplist =3D {lh_first =3D 0x0}, p_reapsibling =3D { le_next =3D 0xfffff80010d209e0, le_prev =3D 0xfffff8000556c4d0}, p_reap= subtree =3D 29, p_pgrp =3D 0xfffff80112b3df00} The software has run without this problem for years on FreeBSD 8.4-STABLE. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-threads@freebsd.org Thu Aug 18 12:26:02 2016 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79F63BBCD6F for ; Thu, 18 Aug 2016 12:26:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 699891B8F for ; Thu, 18 Aug 2016 12:26:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u7ICQ1mo068575 for ; Thu, 18 Aug 2016 12:26:02 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-threads@FreeBSD.org Subject: [Bug 211947] bconsole won't die sitting on do_rw_wrlock Date: Thu, 18 Aug 2016 12:26:01 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: threads X-Bugzilla-Version: 10.3-STABLE X-Bugzilla-Keywords: regression X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: linimon@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: keywords Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Aug 2016 12:26:02 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211947 Mark Linimon changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-threads@freebsd.org Sat Aug 20 20:52:57 2016 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18F45BC017F for ; Sat, 20 Aug 2016 20:52:57 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F320C15B1 for ; Sat, 20 Aug 2016 20:52:56 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KKqusP036408 for ; Sat, 20 Aug 2016 20:52:56 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-threads@FreeBSD.org Subject: [Bug 211947] bconsole won't die sitting on do_rw_wrlock Date: Sat, 20 Aug 2016 20:52:57 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: threads X-Bugzilla-Version: 10.3-STABLE X-Bugzilla-Keywords: regression X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: longwitz@incore.de X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Aug 2016 20:52:57 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211947 longwitz@incore.de changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |longwitz@incore.de --- Comment #1 from longwitz@incore.de --- I need help with this problem and give some more infos: bconsole creates two threads: watchdog and checker_deadlock. When trying to quit bconsole the main thread sends first a special ping to the watchdog th= read and this thread always stops cleanly without any problems. Second the main thread tries to stop the sleeping thread checker_deadlock with pthread_cancel(). Both the main thread and the checker_deadlock thread do s= ome housekeeping in exit routines. I give ktraces of good and bad case starting with pthread_cancel: good (quit exits normally): 54503 100490 bconsole CALL thr_kill(0x18b71,SIG 32) 54503 100490 bconsole RET thr_kill 0 54503 101233 bconsole RET nanosleep -1 errno 4 Interrupted system call 54503 101233 bconsole PSIG SIG 32 caught handler=3D0x80205b080 mask=3D0x0 code=3DSI_LWP 54503 100490 bconsole CALL _umtx_op(0x802270880,UMTX_OP_RW_WRLOCK,0,0,0) 54503 101233 bconsole CALL thr_wake(0x18b71) 54503 100490 bconsole RET _umtx_op 0 54503 101233 bconsole RET thr_wake 0 54503 101233 bconsole CALL thr_wake(0x18b71) 54503 101233 bconsole RET thr_wake 0 54503 101233 bconsole CALL sigreturn(0x7fffdfffda60) 54503 101233 bconsole RET sigreturn JUSTRETURN 54503 100490 bconsole CALL _umtx_op(0x802270880,UMTX_OP_RW_WRLOCK,0,0,0) 54503 100490 bconsole RET _umtx_op 0 54503 101233 bconsole CALL _umtx_op(0x802270880,UMTX_OP_RW_RDLOCK,0,0,0) 54503 101233 bconsole RET _umtx_op 0 54503 100490 bconsole CALL _umtx_op(0x802270880,UMTX_OP_RW_WRLOCK,0,0,0) 54503 100490 bconsole RET _umtx_op 0 54503 101233 bconsole CALL _umtx_op(0x802270880,UMTX_OP_RW_RDLOCK,0,0,0) 54503 101233 bconsole RET _umtx_op 0 54503 100490 bconsole CALL _umtx_op(0x802270880,UMTX_OP_RW_WRLOCK,0,0,0) 54503 101233 bconsole CALL _umtx_op(0x802270880,UMTX_OP_RW_UNLOCK,0,0,0) 54503 101233 bconsole RET _umtx_op 0 54503 100490 bconsole RET _umtx_op 0 54503 101233 bconsole CALL _umtx_op(0x802270880,UMTX_OP_RW_RDLOCK,0,0,0) 54503 101233 bconsole RET _umtx_op 0 54503 101233 bconsole CALL munmap(0x800663000,0x1000) 54503 101233 bconsole RET munmap 0 54503 101233 bconsole CALL madvise(0x803806000,0x8000,MADV_FREE) 54503 101233 bconsole RET madvise 0 54503 100490 bconsole CALL exit(0) 54503 101233 bconsole CALL thr_exit(0x803406800)=20 bad (hang on quit): 62196 100096 bconsole 0.655701 CALL thr_kill(0x186f8,SIG 32) 62196 100096 bconsole 0.655717 RET thr_kill 0 62196 100088 bconsole 0.655726 RET nanosleep -1 errno 4 Interrupted syst= em call 62196 100088 bconsole 0.655742 PSIG SIG 32 caught handler=3D0x80205b080 mask=3D0x0 code=3DSI_LWP 62196 100096 bconsole 0.655766 CALL=20 _umtx_op(0x802270880,UMTX_OP_RW_WRLOCK,0,0,0) 62196 100088 bconsole 0.655770 CALL thr_wake(0x186f8) 62196 100096 bconsole 0.655774 RET _umtx_op 0 62196 100088 bconsole 0.655781 RET thr_wake 0 62196 100088 bconsole 0.655791 CALL thr_wake(0x186f8) 62196 100088 bconsole 0.655795 RET thr_wake 0 62196 100088 bconsole 0.655800 CALL sigreturn(0x7fffdfffda60) 62196 100088 bconsole 0.655807 RET sigreturn JUSTRETURN 62196 100096 bconsole 0.655830 CALL=20 _umtx_op(0x802270880,UMTX_OP_RW_WRLOCK,0,0,0) 62196 100096 bconsole 0.655837 RET _umtx_op 0 62196 100088 bconsole 0.655838 CALL=20 _umtx_op(0x802270880,UMTX_OP_RW_RDLOCK,0,0,0) 62196 100088 bconsole 0.655848 RET _umtx_op 0 62196 100096 bconsole 0.655848 CALL=20 _umtx_op(0x802270880,UMTX_OP_RW_WRLOCK,0,0,0) 62196 100088 bconsole 0.655862 CALL=20 _umtx_op(0x802270880,UMTX_OP_RW_UNLOCK,0,0,0) 62196 100088 bconsole 0.655875 RET _umtx_op 0 62196 100088 bconsole 0.655885 CALL=20 _umtx_op(0x802270880,UMTX_OP_RW_RDLOCK,0,0,0) 62196 100096 bconsole 0.655885 RET _umtx_op 0 62196 100088 bconsole 0.655897 RET _umtx_op -1 errno 4 Interrupted system call 62196 100096 bconsole 0.655901 CALL=20 _umtx_op(0x802270880,UMTX_OP_RW_UNLOCK,0,0,0) 62196 100088 bconsole 0.655903 CALL=20 _umtx_op(0x802270880,UMTX_OP_RW_RDLOCK,0,0,0) 62196 100096 bconsole 0.655912 RET _umtx_op 0 62196 100088 bconsole 0.655915 RET _umtx_op 0 62196 100096 bconsole 0.655930 CALL=20 _umtx_op(0x802270880,UMTX_OP_RW_WRLOCK,0,0,0) 62196 100088 bconsole 0.655930 CALL=20 _umtx_op(0x802270880,UMTX_OP_RW_UNLOCK,0,0,0) 62196 100088 bconsole 0.655942 RET _umtx_op 0 62196 100088 bconsole 0.655952 CALL=20 _umtx_op(0x802270880,UMTX_OP_RW_UNLOCK,0,0,0) 62196 100088 bconsole 0.655956 RET _umtx_op 0 62196 100088 bconsole 0.655966 CALL=20 _umtx_op(0x802270880,UMTX_OP_RW_UNLOCK,0,0,0) 62196 100088 bconsole 0.655971 RET _umtx_op 0 62196 100088 bconsole 0.655978 CALL=20 _umtx_op(0x802270880,UMTX_OP_RW_UNLOCK,0,0,0) 62196 100088 bconsole 0.655982 RET _umtx_op 0 62196 100088 bconsole 0.655989 CALL=20 _umtx_op(0x802270880,UMTX_OP_RW_UNLOCK,0,0,0) 62196 100088 bconsole 0.655993 RET _umtx_op 0 62196 100088 bconsole 0.655999 CALL=20 _umtx_op(0x802270880,UMTX_OP_RW_UNLOCK,0,0,0) 62196 100088 bconsole 0.656005 RET _umtx_op 0 62196 100088 bconsole 0.656010 CALL80,UMTX_OP_RW_UNLOCK,0,0,0) 62196 100088 bconsole 0.656014 RET _umtx_op 0 62196 100088 bconsole 0.656022 CALL=20 _umtx_op(0x802270880,UMTX_OP_RW_UNLOCK,0,0,0) 62196 100088 bconsole 0.656026 RET _umtx_op 0 62196 100088 bconsole 0.656032 CALL munmap(0x800663000,0x1000) 62196 100088 bconsole 0.656042 RET munmap 0 62196 100088 bconsole 0.656089 CALL madvise(0x803806000,0x8000,MADV_FREE) 62196 100088 bconsole 0.656099 RET madvise 0 62196 100088 bconsole 0.656105 CALL thr_exit(0x803406800) and the main thread does not die, he sits on WCHAN uwrlck. Especially I lik= e to know, why the kernel sends a second signal to the checker_deadlock thread. I can avoid the libthr/kernel problem by sleeping some ms in the main thread after pthread_cancel(), the resulting ktrace looks like rather clean, becau= se no _umtx_op calls to the kernel are necessary: 81803 100271 bconsole 8.425361 CALL thr_kill(0x18a20,SIG 32) 81803 100271 bconsole 8.425374 RET thr_kill 0 81803 100271 bconsole 8.425380 CALL nanosleep(0x7fffffffe2f0,0) 81803 100896 bconsole 8.425382 RET nanosleep -1 errno 4 Interrupted syst= em call 81803 100896 bconsole 8.425400 PSIG SIG 32 caught handler=3D0x80205b080 mask=3D0x0 code=3DSI_LWP 81803 100896 bconsole 8.425426 CALL thr_wake(0x18a20) 81803 100896 bconsole 8.425433 RET thr_wake 0 81803 100896 bconsole 8.425438 CALL thr_wake(0x18a20) 81803 100896 bconsole 8.425442 RET thr_wake 0 81803 100896 bconsole 8.425446 CALL sigreturn(0x7fffdfffda60) 81803 100896 bconsole 8.425452 RET sigreturn JUSTRETURN 81803 100896 bconsole 8.425519 CALL munmap(0x800663000,0x1000) 81803 100896 bconsole 8.425529 RET munmap 0 81803 100896 bconsole 8.425575 CALL madvise(0x80380e000,0x22000,MADV_FREE) 81803 100896 bconsole 8.425585 RET madvise 0 81803 100896 bconsole 8.425595 CALL madvise(0x803806000,0x8000,MADV_FREE) 81803 100896 bconsole 8.425603 RET madvise 0 81803 100896 bconsole 8.425609 CALL thr_exit(0x803406800) 81803 100271 bconsole 8.427522 RET nanosleep 0 81803 100271 bconsole 8.427717 CALL exit(0) In my opinion this problem must be solved in libthr/kernel and not in userl= and. --=20 You are receiving this mail because: You are the assignee for the bug.=