On 18/06/24(Tue) 23:34, Dana Koch wrote:
> >Synopsis: Mac Studio hangs; locking problems on WITNESS/MP_LOCKDEBUG kernels
> >Category: kernel
> >Environment:
> System      : OpenBSD 7.5
> Details     : OpenBSD 7.5-current (GENERIC.MP) #69: Wed Jun 12 04:43:28 MDT 
> 2024
> dera...@arm64.openbsd.org:/usr/src/sys/arch/arm64/compile/GENERIC.MP
> 
> Architecture: OpenBSD.arm64
> Machine     : arm64
> >Description:
> System can hang and be unresponsive on a Mac Studio (M2, Ultra),
> either soon after boot passes to userland during/after "starting
> network", or under load. When on a kernel with MP_LOCKDEBUG and
> WITNESS options turned on, these points will trigger locking-related
> panics

The panic is the following:

> *cpu16: acquiring blockable sleep lock with spinlock or critical section held 
> (
> kernel_lock) &kernel_lock

Which correspond to the following trace (note 0x10 is 16):

> ddb{9}> mach ddbcpu 10
> ddb{16}> trace
> db_enter() at panic+0x148
> panic() at witness_checkorder+0x84c
> witness_checkorder() at __mp_lock+0x64
> __mp_lock() at selwakeup+0x14
> selwakeup() at ptsstart+0x74
> ptsstart() at tputchar+0x84
> tputchar() at kputchar+0x7c
> kputchar() at kprintf+0x614
> kprintf() at printf+0x88
> printf() at witness_checkorder+0x518
> witness_checkorder() at mtx_enter+0x50
> mtx_enter() at timeout_del+0x2c
> timeout_del() at dequeue_randomness+0x38
> dequeue_randomness() at extract_entropy+0x90
> extract_entropy() at _rs_stir+0x28
> _rs_stir() at arc4random+0xf4
> arc4random() at uvm_map_hint+0x5c
> uvm_map_hint() at uaddr_rnd_select+0xf8
> uaddr_rnd_select() at uvm_addr_invoke+0xc0
> uvm_addr_invoke() at uvm_map_findspace+0x78
> uvm_map_findspace() at uvm_mapanon+0x228
> uvm_mapanon() at uvm_mmapanon+0xd0
> uvm_mmapanon() at sys_mmap+0x330
> sys_mmap() at svc_handler+0x480
> svc_handler() at do_el0_sync+0xc8
> do_el0_sync() at handle_el0_sync+0x70
> handle_el0_sync() at 0x4d20f2bf8
> --- trap ---
> end of kernel

This is a lock order reversal reported by WITNESS.  Thankfully claudio@
already committed a fix for this on the 16th.  So please, try with
up-to-date sources 

Reply via email to