Date: Wed, 4 Jan 2012 21:56:58 GMT From: Robert Watson <rwatson@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/163822: kgdb -w opens symbols file, not just core, writable Message-ID: <201201042156.q04LuwQS001018@fledge.watson.org> Resent-Message-ID: <201201042200.q04M0PKm029100@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 163822 >Category: bin >Synopsis: kgdb -w opens symbols file, not just core, writable >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jan 04 22:00:25 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Robert Watson >Release: FreeBSD 10-CURRENT i386 >Organization: University of Cambridge >Environment: System: FreeBSD lemongrass-vlan.local 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r229389: Sat Dec 31 09:27:26 GMT 2011 robert@lemongrass-freebsd:/usr/obj/usr/src/sys/CINNAMON i386 >Description: kernel.debug is stored in a root-owned file in an NFS export. When I try to use kernel.debug from an NFS client that doesn't have read access, it fails if -w is specified; it appears that kgdb tries to open kernel.debug, not just /dev/mem, writable: alemongrass-vlan# kgdb kernel.debug /dev/mem GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-marcel-freebsd"... #0 sched_switch (td=0xc10fcc90, newtd=0xc2d898a0, flags=260) at /usr/src/sys/kern/sched_ule.c:1860 1860 cpuid = PCPU_GET(cpuid); lemongrass-vlan# kgdb -w kernel.debug /dev/mem GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-marcel-freebsd"...kernel.debug: No such file or directory. Can't open a vmcore without a kernel (kgdb) 1899 kgdb CALL stat(0x28804030,0xbfbfde48) 1899 kgdb NAMI "kernel.debug" 1899 kgdb STRU struct stat {dev=973143812, ino=15364859, mode=-rwxr-xr-x , nlink=1, uid=0, gid=0, rdev=2, atime=1325717227.093573557, stime=1325324863.713868289, ctime=1325717509.879401621, birthtime=-1, size=60004659, blksize=4096, blocks=117881, flags=0x0 } 1899 kgdb RET stat 0 1899 kgdb CALL open(0xbfbfdea0,0x2<O_RDWR>,<unused>0) 1899 kgdb NAMI "kernel.debug" 1899 kgdb RET open -1 errno 13 Permission denied 1899 kgdb CALL stat(0xbfbfde30,0xbfbfddb8) 1899 kgdb NAMI "/sbin/kernel.debug" 1899 kgdb RET stat -1 errno 2 No such file or directory >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201042156.q04LuwQS001018>