On Thu, Jun 27, 2024 at 11:24:39AM +0100, kir...@korins.ky wrote:
> >Synopsis:    
> >Category:    
> >Environment:
>       System      : OpenBSD 7.5
>       Details     : OpenBSD 7.5-current (GENERIC.MP) #151: Wed Jun 26 
> 01:12:37 MDT 202
>                        
> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> 
>       Architecture: OpenBSD.amd64
>       Machine     : amd64
> >Description:
> 
> 
>       The first boot on new snapshot crashed. After boot and login into
>       X11 I run recompile kernel with -j4 and during that time attach and
>       deattach gdb and egdb to running emacs. Nothing else on the machine
>       at this time. At some point X11 crashed and I seend ddb stackstrace
>       (text is OCR, may contains typos):
> 
>               panic: kernel diagnostic assertion "p->p_kq->kq_refcnt.r_refs 
> == 1" failed: file "/usr/src/sys/kern/kern_event.c", line 894
>               Stopped at      db_enter+0x14:  movq    %rbp
>               TID     PID     UID     PRFLAGS          PFLAGS CPU COMMAND
>               123012  72047      0     0x14000                 0x200   3 
> i915-unordered
>               196300  55210      0     0x14000                 0x200   2K 
> reaper
>               db_enter() at db_enter+0x14
>               panic(ffffffff82408981) at panic+0x4dd
>               
> __assert(ffffffff823c2a8f,ffffffff82345e30,37e,ffffffff8233d253) at 
> __assert+0x29
>               kqpoll_exit() at kqpoll_exit+0xbf
>               exit1(ffff8000fffe8820,0,0,3) at exit1+0x229
>               single_thread_check_locked(ffff8000fffe8820,0) at 
> single_thread_check_locked+0x19?
>               single_thread_set(ffff8000fffe8820,21) at single_thread_set+0x6a
>               cursig(ffff8000fffe8820,ffff80004c1123d8) at cursig+0x255
>               sleep_finish(0,1) at sleep_finish+0x1fe
>               
> msleep(fffffd83c8c80690,fffffd83c8c80690,318,ffffffff8234b389,0) at 
> msleep+0xc8
>               
> kqueue_scan(ffff80004c112690,0,ffff8000fffe8820,ffff80004c1281c) at 
> kqueue_scan+0x111
>               dopoll(ffff8000fffe8820,968b1cbfec0,1,0,0,ffff80004c112900) at 
> dopoll+0x294
>               sys_poll(ffff8000fffe8820,ffff80004c112990,ffff80004c112900) at 
> sys_poll+0x6e
>               syscall(ffff80004c112990) at syscall+0x620
>               Xsyscall(rip,ffff80004c112a10, count: 0
>               end trace frame: 0xffff80004c112a10

The ptrace code is somewhat borken. We are inside sleep_finish() but
cursig() calls single_thread_set() without SINGLE_DEEP. Because of this
exit1() is called in a place it is not allowed to.

ptrace and SIGSTOP handling is not quite right. It is on my list of things
to fix.

-- 
:wq Claudio

Reply via email to