Date: Thu, 12 Apr 2018 00:27:28 -0700 From: Eitan Adler <lists@eitanadler.com> To: Andriy Gapon <avg@freebsd.org> Cc: "hackers@freebsd.org" <hackers@freebsd.org> Subject: Re: panic: deadlkres: possible deadlock detected for 0xfffff80141b04560, blocked for 1801695 ticks Message-ID: <CAF6rxg=4u4aFfTCKHupAr-t108ttHiXcFd6u9_%2B9iGu4VO3OGQ@mail.gmail.com> In-Reply-To: <33e482b2-ee50-bd72-51d6-bb320cc95b82@FreeBSD.org> References: <CAF6rxgmF_aOx-R7nZ%2B6-N70jwtH8pgHXPK3WovHS2V5Aed0qwA@mail.gmail.com> <33e482b2-ee50-bd72-51d6-bb320cc95b82@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 11 April 2018 at 23:11, Andriy Gapon <avg@freebsd.org> wrote: > On 12/04/2018 07:00, Eitan Adler wrote: >> How to reproduce? >> >> # kldload sem >> # kldunload sem >> < wait debug.deadlkres.slptime_threshold seconds > >> >> https://reviews.freebsd.org/P168 >> Reading symbols from ./kernel/kernel...Reading symbols from >> /usr/home/eax/crashes/sem_load_dklres/kernel/kernel.debug...done. >> done. >> >> Unread portion of the kernel message buffer: >> [29474] panic: deadlkres: possible deadlock detected for >> 0xfffff80141b04560, blocked for 1801695 ticks > > The debugging information you provided does not help. > You need to do > (gdb) p *(struct thread*)0xfffff80141b04560 <=== taken from the panic message > find td_tid value and then do > (gdb) tid <td_tid> > And then examine that thread. > > I guess that the deadlkres could be enhanced to print the tid and the stack > trace of the deadlocked thread, so that it is faster to get started. (kgdb) p (*(struct thread*)0xfffff80141b04560).td_tid $2 = 0x18bd8 (kgdb) tid 18bd8 (kgdb) bt #0 sched_switch (td=0xfffff80141b04560, newtd=0xfffff80003699000, flags=<optimized out>) at /usr/src/sys/kern/sched_ule.c:2115 #1 0xffffffff80b7156c in mi_switch (flags=0x104, newtd=0x0) at /usr/src/sys/kern/kern_synch.c:437 #2 0xffffffff80bba7ed in sleepq_switch (wchan=0xffffffff81deb2d8 <kld_sx>, pri=0x0) at /usr/src/sys/kern/subr_sleepqueue.c:613 #3 0xffffffff80bba693 in sleepq_wait (wchan=0xffffffff81deb2d8 <kld_sx>, pri=0x0) at /usr/src/sys/kern/subr_sleepqueue.c:692 #4 0xffffffff80b6f329 in _sx_xlock_hard (sx=0xffffffff81deb2d8 <kld_sx>, x=<optimized out>, opts=<optimized out>, file=<optimized out>, line=<optimized out>) at /usr/src/sys/kern/kern_sx.c:777 #5 0xffffffff80b6ef31 in _sx_xlock (sx=0xffffffff81deb2d8 <kld_sx>, opts=0x0, file=0xffffffff811a5d65 "/usr/src/sys/kern/kern_linker.c", line=0x42e) at /usr/src/sys/kern/kern_sx.c:319 #6 0xffffffff80b3834e in kern_kldload (td=<optimized out>, file=<optimized out>, fileid=0xfffffe00af1f8964) at /usr/src/sys/kern/kern_linker.c:1070 #7 0xffffffff80b3848b in sys_kldload (td=0xfffff80141b04560, uap=<optimized out>) at /usr/src/sys/kern/kern_linker.c:1097 #8 0xffffffff8102606b in syscallenter (td=0xfffff80141b04560) at /usr/src/sys/amd64/amd64/../../kern/subr_syscall.c:134 #9 amd64_syscall (td=0xfffff80141b04560, traced=0x0) at /usr/src/sys/amd64/amd64/trap.c:936 #10 <signal handler called> #11 0x00000008002cfd8a in ?? () Backtrace stopped: Cannot access memory at address 0x7fffffffd478 (kgdb) frame Stack level 3, frame at 0xfffffe00af1f8820: rip = 0xffffffff80bba693 in sleepq_wait (/usr/src/sys/kern/subr_sleepqueue.c:692); saved rip = 0xffffffff80b6f329 called by frame at 0xfffffe00af1f88d0, caller of frame at 0xfffffe00af1f87f0 source language c. Arglist at 0xfffffe00af1f8810, args: wchan=0xffffffff81deb2d8 <kld_sx>, pri=0x0 Locals at 0xfffffe00af1f8810, Previous frame's sp is 0xfffffe00af1f8820 Saved registers: rbx at 0xfffffe00af1f87f8, rbp at 0xfffffe00af1f8810, r14 at 0xfffffe00af1f8800, r15 at 0xfffffe00af1f8808, rip at 0xfffffe00af1f8818 wchan = 0xffffffff81deb2d8 <kld_sx> pri = 0x0 td = 0xfffff80141b04560 Updated paste with more info as well -- Eitan Adler
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAF6rxg=4u4aFfTCKHupAr-t108ttHiXcFd6u9_%2B9iGu4VO3OGQ>