From owner-freebsd-stable@FreeBSD.ORG Sat Feb 17 11:51:52 2007 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E8DB816A406; Sat, 17 Feb 2007 11:51:51 +0000 (UTC) (envelope-from lofi@freebsd.org) Received: from mail-in-13.arcor-online.net (mail-in-13.arcor-online.net [151.189.21.53]) by mx1.freebsd.org (Postfix) with ESMTP id 6462113C441; Sat, 17 Feb 2007 11:51:51 +0000 (UTC) (envelope-from lofi@freebsd.org) Received: from mail-in-01-z2.arcor-online.net (mail-in-09-z2.arcor-online.net [151.189.8.21]) by mail-in-13.arcor-online.net (Postfix) with ESMTP id 29CC921D0E4; Sat, 17 Feb 2007 12:51:48 +0100 (CET) Received: from mail-in-01.arcor-online.net (mail-in-01.arcor-online.net [151.189.21.41]) by mail-in-01-z2.arcor-online.net (Postfix) with ESMTP id 1384C28EBCF; Sat, 17 Feb 2007 12:51:48 +0100 (CET) Received: from lofi.dyndns.org (dslb-084-061-133-123.pools.arcor-ip.net [84.61.133.123]) by mail-in-01.arcor-online.net (Postfix) with ESMTP id CC1BC106B65; Sat, 17 Feb 2007 12:51:47 +0100 (CET) Received: from kiste.my.domain (root@kiste.my.domain [192.168.8.2]) by lofi.dyndns.org (8.13.8/8.13.3) with ESMTP id l1HBpao8003009 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 17 Feb 2007 12:51:37 +0100 (CET) (envelope-from lofi@freebsd.org) Received: from kiste.my.domain (lofi@localhost [127.0.0.1]) by kiste.my.domain (8.13.6/8.13.4) with ESMTP id l1HBpaNv006924; Sat, 17 Feb 2007 12:51:36 +0100 (CET) (envelope-from lofi@freebsd.org) Received: from localhost (localhost [[UNIX: localhost]]) by kiste.my.domain (8.13.6/8.13.4/Submit) id l1HBpZah006923; Sat, 17 Feb 2007 12:51:35 +0100 (CET) (envelope-from lofi@freebsd.org) X-Authentication-Warning: kiste.my.domain: lofi set sender to lofi@freebsd.org using -f From: Michael Nottebrock To: Rink Springer Date: Sat, 17 Feb 2007 12:51:34 +0100 User-Agent: KMail/1.9.5 References: <200702170947.49001.lofi@freebsd.org> <200702171136.50919.lofi@freebsd.org> <20070217103904.GB91175@rink.nu> In-Reply-To: <20070217103904.GB91175@rink.nu> X-Face: g:jG2\O{-yqD1x?DG2lU1)(v%xffR"p8Nz(w/*)YEUO\Hn%mGi&-!+rq$&r64,=?utf-8?q?fuP=7E=3Bbw=5C=0A=09=5EQdX?=@v~HEAi?NaE8SU]}.oeYSjN84Fe{M(ahZ.(i+lxyP; pr)2[%mGbkY'RmM>=?utf-8?q?+mg3Y=24ip=0A=091?=@Z>[EUaE7tjJ=1DRs~:!uSd""d~:/Er3rpQA%ze|bp>S MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart5057270.5JxiCZcNEm"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200702171251.35639.lofi@freebsd.org> X-Virus-Scanned: by amavisd-new Cc: freebsd-stable@freebsd.org Subject: Re: sysctl segfaulting X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Feb 2007 11:51:52 -0000 --nextPart5057270.5JxiCZcNEm Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday, 17. February 2007 11:39, Rink Springer wrote: > Hi Michael, > > On Sat, Feb 17, 2007 at 11:36:46AM +0100, Michael Nottebrock wrote: > > So I tried recompiling libc with debug cflags ("-g3 -O -pipe"), but this > > only makes the backtrace in gdb much longer, but still without any > > function names. > > Hmm, 'make install' appears to strip the debugging info. Duh, I keep forgetting that. > Please try=20 > gdb-ing /usr/obj/usr/src/sbin/sysctl/sysctl instead (assuming you use > default the /usr/obj path like I do) I recompiled/reinstalled both sysctl and libc with CFLAGS=3D-g3 and STRIP= =3D"" and=20 now I get: [lofi@lofi]:0:~ > gdb /sbin/sysctl 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 condition= s. 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"... (gdb) set args kern.clockrate (gdb) run Starting program: /sbin/sysctl kern.clockrate kern.clockrate: Program received signal SIGSEGV, Segmentation fault. 0x08049696 in S_clockinfo (l2=3D20, p=3D0x804e000)=20 at /usr/src/sbin/sysctl/sysctl.c:333 333 printf(hflag ? "{ hz =3D %'d, tick =3D %'d, profhz =3D %'d,= stathz=20 =3D %'d }" : (gdb) bt #0 0x08049696 in S_clockinfo (l2=3D20, p=3D0x804e000) at /usr/src/sbin/sysctl/sysctl.c:333 #1 0x0804a5f2 in show_var (oid=3D0xbfbfea80, nlen=3D2) at /usr/src/sbin/sysctl/sysctl.c:690 #2 0x08049093 in parse (string=3D0xbfbfecb1 "kern.clockrate") at /usr/src/sbin/sysctl/sysctl.c:208 #3 0x08048e77 in main (argc=3D0, argv=3D0xbfbfeba0)=20 at /usr/src/sbin/sysctl/sysctl.c:152 (gdb) list 328 struct clockinfo *ci =3D (struct clockinfo*)p; 329 if (l2 !=3D sizeof(*ci)) { 330 warnx("S_clockinfo %d !=3D %d", l2, sizeof(*ci)); 331 return (0); 332 } 333 printf(hflag ? "{ hz =3D %'d, tick =3D %'d, profhz =3D %'d,= stathz=20 =3D %'d }" : 334 "{ hz =3D %d, tick =3D %d, profhz =3D %d, stathz = =3D %d }", 335 ci->hz, ci->tick, ci->profhz, ci->stathz); 336 return (0); 337 } (gdb) print ci->hz Error accessing memory address 0x804e000: Bad address. (gdb) print ci->tick Error accessing memory address 0x804e004: Bad address. (gdb) print ci->profhz Error accessing memory address 0x804e010: Bad address. (gdb) print ci->stathz Error accessing memory address 0x804e00c: Bad address. (gdb) print ci $1 =3D (struct clockinfo *) 0x804e000 (gdb) print p $2 =3D (void *) 0x804e000 (gdb) print l2 $3 =3D 20 =2D-=20 ,_, | Michael Nottebrock | lofi@freebsd.org (/^ ^\) | FreeBSD - The Power to Serve | http://www.freebsd.org \u/ | K Desktop Environment on FreeBSD | http://freebsd.kde.org --nextPart5057270.5JxiCZcNEm Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQBF1uxHXhc68WspdLARAkkLAJ0YMd3Skwnlzt+uDpG4eoeOCoAljwCggIAC Rqd8CxgUTejj085rWzNYTXM= =1ROe -----END PGP SIGNATURE----- --nextPart5057270.5JxiCZcNEm--