8ZnJoh42MBnRMEw== X-Gm-Gg: ASbGncsp7KU9bioH4MV6PGjhDxggcWCfmfMsFmyVmN5xjW1tkhzoBelTZQoCM2NgCS3 g95y0srpDnljRZXnyEpg7N0mEN5IcCBvMYGwP5q8wP8HjJAJtSje5I4sEBoeGahj2p4xzP0DmUU vuQ3wD6j1b/mfCJUF0/d06NOcL36Xd3M3jLhZV3TB58ZK6jnF/eETWqOVf+01CMpaqXCmiL0rtC B2nFlB/GQj8nslC0qDAdu1TvQQM8e5eMGD6KAvr1v8p+7GfloUEr4F44tKv/QCnChdq/eSyEpJV mWWhXMJTBp6aUKGKeGtGvEF1frfUniJRfPnmopC97ZjPMdTmmN2XEz8QHKzFbglqxLwXqoL1pWY i/1YgVnSg+JQ8SLfZrhhstLmZwFGQQVcaUYyUWrIkHl/LFQm9ontkVkrWxGGwRBsg55fAkyIcwm K2OzFHb2ZB3nbd75ZkpEb4FCmOIGAwscd6DZl8tFo= X-Google-Smtp-Source: AGHT+IEmZHYzT9Qkd7xs2MXxdQvijN3i4hSzm/5ANf0s63nyF/41qI4Mmyz8YJjtULs2cDJ4Z+kx5g== X-Received: by 2002:a05:690c:a85:b0:783:346a:f4bd with SMTP id 00721157ae682-78617fb5744mr49984967b3.47.1761645608982; Tue, 28 Oct 2025 03:00:08 -0700 (PDT) Received: from mail-yw1-f181.google.com (mail-yw1-f181.google.com. [209.85.128.181]) by smtp.gmail.com with ESMTPSA id 00721157ae682-785ed179b9asm26727157b3.16.2025.10.28.03.00.08 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Oct 2025 03:00:08 -0700 (PDT) Received: by mail-yw1-f181.google.com with SMTP id 00721157ae682-781421f5bf5so63093187b3.3 for ; Tue, 28 Oct 2025 03:00:08 -0700 (PDT) X-Received: by 2002:a05:690c:2c07:b0:784:88df:d9d with SMTP id 00721157ae682-78617e2cab5mr44779577b3.2.1761645608326; Tue, 28 Oct 2025 03:00:08 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 References: In-Reply-To: From: Ryan Libby Date: Tue, 28 Oct 2025 02:59:57 -0700 X-Gmail-Original-Message-ID: X-Gm-Features: AWmQ_bnoHERKbIIi7LliSqX27f5SBwr0xoDiVnyXNMHxFF1PxOPomIEzlp1fVw0 Message-ID: Subject: Re: db> reset -> panic: lock (sleep mutex) eventhandler not locked @ /usr/src/sys/kern/subr_eventhandler.c:272 To: "Bjoern A. Zeeb" Cc: current@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / X-Spamd-Result: default: False [-0.60 / 15.00]; RBL_VIRUSFREE_BOTNET(2.00)[74.125.224.53:from]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-0.999]; FORGED_SENDER(0.30)[rlibby@freebsd.org,rlibby@gmail.com]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; MISSING_XM_UA(0.00)[]; FREEFALL_USER(0.00)[rlibby]; ASN(0.00)[asn:15169, ipnet:74.125.0.0/16, country:US]; PREVIOUSLY_DELIVERED(0.00)[current@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[rlibby@freebsd.org,rlibby@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MLMMJ_DEST(0.00)[current@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[74.125.224.53:from]; R_DKIM_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:74.125.0.0/16:c]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.181:received] X-Rspamd-Queue-Id: 4cwm8G1tznz3GY1 On Tue, Oct 28, 2025 at 2:46=E2=80=AFAM Ryan Libby wro= te: > > On Mon, Oct 27, 2025 at 7:31=E2=80=AFAM Bjoern A. Zeeb > wrote: > > > > Hi, > > > > on main-ish I get the following. I am a bit concerned as over the last > > year or two our reset paths had issues like this more and more. > > > > > > db> reset > > panic: lock (sleep mutex) eventhandler not locked @ /usr/src/sys/kern/s= ubr_eventhandler.c:272 > > cpuid =3D 1 > > time =3D 1025 > > KDB: stack backtrace: > > db_trace_self() at db_trace_self > > db_trace_self_wrapper() at db_trace_self_wrapper+0x38 > > vpanic() at vpanic+0x1a0 > > panic() at panic+0x48 > > witness_unlock() at witness_unlock+0x140 > > __mtx_unlock_flags() at __mtx_unlock_flags+0x54 > > eventhandler_find_list() at eventhandler_find_list+0xbc > > kern_reboot() at kern_reboot+0x244 > > db_reset() at db_reset+0xec > > db_command() at db_command+0x2f4 > > db_command_loop() at db_command_loop+0x58 > > db_trap() at db_trap+0x100 > > kdb_trap() at kdb_trap+0x350 > > handle_el1h_sync() at handle_el1h_sync+0x18 > > --- exception, esr 0xf2000000 > > kdb_alt_break_internal() at kdb_alt_break_internal+0x1a8 > > kdb_alt_break() at kdb_alt_break+0x10 > > uart_intr_rxready() at uart_intr_rxready+0x88 > > uart_intr() at uart_intr+0x124 > > intr_event_handle() at intr_event_handle+0xf4 > > intr_isrc_dispatch() at intr_isrc_dispatch+0x60 > > arm_gic_intr() at arm_gic_intr+0x118 > > intr_irq_handler() at intr_irq_handler+0x98 > > handle_el1h_irq() at handle_el1h_irq+0x18 > > --- interrupt > > cpu_idle() at cpu_idle+0x78 > > sched_idletd() at sched_idletd+0x494 > > fork_exit() at fork_exit+0x78 > > fork_trampoline() at fork_trampoline+0x18 > > Uptime: 17m5s > > Automatic reboot in 15 seconds - press a key on the console to abort > > > > -- > > Bjoern A. Zeeb r15:= 7 > > > > Would your kernel config match this condition in sys/sys/mutex.h? > #if LOCK_DEBUG > 0 || defined(MUTEX_NOINLINE) > > It looks like we might be missing some SCHEDULER_STOPPED() checks in > those code paths. It's a twisty maze of macros that I haven't totally > followed though. td_locks might be getting broken too. > > Ryan Reading sys/sys/_lock.h, LOCK_DEBUG will be on with WITNESS, which this kernel clearly has (and also with INVARIANTS, both of which are defaults for GENERIC).