From nobody Mon Mar 2 00:40:06 2026 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fPKpH0bdNz6TxSV for ; Mon, 02 Mar 2026 00:40:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fPKpG73sbz3Hhx for ; Mon, 02 Mar 2026 00:40:06 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1772412007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qjAzHL/0RX+9CMrXn6Z9JMiv5uvmFnUX0Oa13fzfJ00=; b=D7C34MXRg3mzxxIZMFZNKWIb/6KCGvp060ttT3w2aI4qVgZw5j67h1M/ffbu8oYuUoQ2bo 82a5zehjRX4gr1MbWcD5vx7GTXgT+n++ZEaXlXNLDVmBvYaWk419e4mV9QwVFf1o3MeFb4 xyNno8RiFz71DJHc5mHYw4VX38ylaeUOb/NeKAvp2D3cl2kEkuxmI6tD7DG/4VjG38zEj+ ac25nqYXd266ok60ur6dXzt9mAgORCol8lZKYs+C1y8pfBh3RoUoDvnJxbMlKU3PZXRyEa omc8Agwi5EdX/3eFZa+9lagFUnM2gMDNfCgoqM48YGZBVjksw4ulPC4n5C0mcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1772412007; a=rsa-sha256; cv=none; b=bJ9wb/Qgtg1IxfPemiI7IJwvCEbIg/La/qtFSteXF/lSbBGkjU+Otiwuvmb2wB/rZfZW91 NutljSh4Zuxtnt05ek4rQQI5CF2HCRy/tA6LOLejFWCgrb29UKJDl77t5cd1bfFiknYpyo cqPIXiHUFkzQLgN1+yuWhsdDI7gdSYsq7wpPK8JJveEd8ZLWjJGvltFDTslZka8l24wp37 Cv8+XXaA4h2aNtfF+0kPnrhyjP5tjADBUgvdvAiVLjvNMlRpv4vaKyoAvKiZaeVggn1ial oYVtS17XS3zBPRbT3Yf25eoj4EFpPXq1x1CKiiV51znnhq6PYd8/ZP2czL2UJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1772412007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qjAzHL/0RX+9CMrXn6Z9JMiv5uvmFnUX0Oa13fzfJ00=; b=r/10QGF8FqKP+fXSELej0u/pCDhvRP2KPROwtZmNZplqLVw7GBHCGZwNdH7JpOk/A7C2js G2sE8ku7VjjxbgJ5N7PsTSVI6Th9J882VOcct+Hx7RrM/R6y3ahhKa5BJ8/v2CEaKQW6z8 9HdOT02Fu3cPbm9wPcaat1r96HWtHBxMswE1t26oWHS25FXXqYX361eqHj9qM2ysKcK9g7 mA1PYhMNcp0T3p0UqFdHs8Bb5Ah4qQ38P3UWm0z9FmyO328WgF5ODIP5uBCcA96nQQbi5h 8YrKm/7nJu6xIqmZu93ZQ6rIuGNMzrI6qF0PdAs3h45NUrQV94+hxAXJqkJUAg== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4fPKpG6Llnz1BMd for ; Mon, 02 Mar 2026 00:40:06 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 6220e6Mt044742 for ; Mon, 2 Mar 2026 00:40:06 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 6220e61N044740 for bugs@FreeBSD.org; Mon, 2 Mar 2026 00:40:06 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 293536] kgdb: source code location lookup works for kernel but not for module Date: Mon, 02 Mar 2026 00:40:06 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 16.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: cracauer@cons.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D293536 Bug ID: 293536 Summary: kgdb: source code location lookup works for kernel but not for module Product: Base System Version: 16.0-CURRENT Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: cracauer@cons.org tl;dr: I have a bhyve kgdb situation, debugging a module. The source code is synced between guest and host, both located at /usr/src-debug. However, the debugg= er insists on using /usr/src for the module, although the correct /usr/src-deb= ug is used for the kernel. Consider this backtrace: #0 panic (fmt=3D0xffffffff83012022 "No cnp") at /usr/src-debug/sys/kern/kern_shutdown.c:886 #1 0xffffffff830116a0 in sysctl_rule (oidp=3D, arg1=3D0x0 , arg2=3D-2097078112, req=3D0xffffffff830120a0) at /xcarb3/usr/src/sys/security/mac_bsdextended/mac_bsdextended.c:145 #2 0xffffffff83011714 in sysctl_rule (oidp=3D, arg1=3D, arg2=3D, req=3D0x40 ) at /xcarb3/usr/src/sys/security/mac_bsdextended/mac_bsdextended.c:154 #3 0xffffffff80f3c56b in mac_vnode_check_lookup_impl ( cred=3Dcred@entry=3D0xfffff8037415ed80, dvp=3Ddvp@entry=3D0xfffff80001b= 0a1b8, cnp=3D0xfffffe00d5fa68f8, cnp@entry=3D0xfffffe00d5fa6d18) at /usr/src-debug/sys/security/mac/mac_vfs.c:576 #4 0xffffffff80cc5a7d in mac_vnode_check_lookup (cred=3D0xfffff8037415ed80, dvp=3D0xfffff80001b0a1b8, cnp=3D0xfffffe00d5fa6d18) at /usr/src-debug/sys/security/mac/mac_framework.h:565 #5 vfs_lookup (ndp=3Dndp@entry=3D0xfffffe00d5fa6c98) at /usr/src-debug/sys/kern/vfs_lookup.c:1311 #6 0xffffffff80cc472d in namei (ndp=3Dndp@entry=3D0xfffffe00d5fa6c98) at /usr/src-debug/sys/kern/vfs_lookup.c:738 #7 0xffffffff80cefd52 in vn_open_cred (ndp=3Dndp@entry=3D0xfffffe00d5fa6c9= 8, flagp=3Dflagp@entry=3D0xfffffe00d5fa6db4, cmode=3Dcmode@entry=3D420, --Type for more, q to quit, c to continue without paging-- vn_open_flags=3Dvn_open_flags@entry=3D16, cred=3D0xfffff8037415ed80, fp=3D0xfffff8000583a050) at /usr/src-debug/sys/kern/vfs_vnops.c:369 #8 0xffffffff80ce5747 in openatfp (td=3D0xfffff8000584b000, dirfd=3Ddirfd@entry=3D-100, path=3D0x824cba112 "/var/run/utx.active", pathseg=3Dpathseg@entry=3DUIO_USERSPACE, flags=3D1048577, mode=3D, fpp=3D0x0 ) at /usr/src-debug/sys/kern/vfs_syscalls.c:1263 #9 0xffffffff80ce5408 in kern_openat (td=3D0xffffffff83012022, dirfd=3D-10= 0, path=3D0xffffffff830120a0 "FOO3: '%s'\n", pathseg=3DUIO_USERSPACE, flags=3D= 92581888, mode=3D-2111371672) at /usr/src-debug/sys/kern/vfs_syscalls.c:1351 As you can see /xcarb3/usr/src is used for the module (which is the unedited host source code). The correct /usr/src-debug is used for the kernel. Inside, kernel.debug and mac_bsdextended.ko.debug both clearly reference /usr/src-debug if you inspect the files in a hexdump. Longer story: ------------- I am bringing things into play like this: - source code is in /usr/src-debug on both guest and host - guest compiles, installs and runs the modified kernel and module - kernel.debug and mac_bsdextended.ko.debug are copied to /var/tmp on the h= ost - invocation: kgdb /var/tmp/kernel.debug add-symbol-file /var/tmp/mac_bsdextended.ko.debug target remote localhost:1234 b panic When starting kgdb says Reading symbols from /var/tmp/kernel.debug...=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 add symbol table from file "/var/tmp/mac_bsdextended.ko.debug"=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 warning: remote target does not support file transfer, attempting to access file s from local filesystem.=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 Obviously that "from local filesystem" could screw me up, but it doesn't say that it actually loads something. --=20 You are receiving this mail because: You are the assignee for the bug.=