From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 9 17:32:52 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6D0E1065676 for ; Fri, 9 Oct 2009 17:32:52 +0000 (UTC) (envelope-from mel.flynn+fbsd.hackers@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id AE5E18FC15 for ; Fri, 9 Oct 2009 17:32:52 +0000 (UTC) Received: from smoochies.rachie.is-a-geek.net (mailhub.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id E9E777E857 for ; Fri, 9 Oct 2009 09:33:03 -0800 (AKDT) From: Mel Flynn To: freebsd-hackers@freebsd.org Date: Fri, 9 Oct 2009 19:32:48 +0200 User-Agent: KMail/1.12.1 (FreeBSD/8.0-RC1; KDE/4.3.1; i386; ; ) References: <200910090015.24175.mel.flynn+fbsd.hackers@mailing.thruhere.net> <86skds7vqi.fsf@ds4.des.no> <200910091650.04231.mel.flynn+fbsd.hackers@mailing.thruhere.net> In-Reply-To: <200910091650.04231.mel.flynn+fbsd.hackers@mailing.thruhere.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <200910091932.49028.mel.flynn+fbsd.hackers@mailing.thruhere.net> Subject: Re: Running a program through gdb without "interfering" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2009 17:32:53 -0000 On Friday 09 October 2009 16:50:04 Mel Flynn wrote: > On Friday 09 October 2009 11:38:29 Dag-Erling Sm=F8rgrav wrote: > > Mel Flynn writes: > > > is there a way to have a program run through gdb and gdb only record a > > > segfault, but otherwise let the program run? > > > > Yes, just run "gdb /path/to/program" and type "run". >=20 > Not what I was looking for. The segfaults are random and the only way to > somewhat reliably reproduce it is to have portmaster invoke it as it's > PM_SU_CMD. And no, running that same command again doesn't trigger the > segfault, so it's "something environmental". Hence I'm looking for > something like: > gdb -batch -x script_with_run_cmd.gdb -exec /usr/local/bin/sudo $argv >=20 > where somehow I need $argv to be passed as arguments to sudo. I'm thinking > i should just wrap it and mktemp(1) a new command script for gdb to use > with set args $*, but if anyone has a more clever idea, I'd love to hear > it. Dead end path :/ % bin/gdbsudo echo hi /tmp/gdbsudo.F3kdwJ:1: Error in sourced command file: /usr/local/bin/sudo: Permission denied. % ls -l /usr/local/bin/sudo =2D--s--x--x 2 root wheel 116380 Oct 8 18:31 /usr/local/bin/sudo % sudo chmod g+r /usr/local/bin/sudo % bin/gdbsudo echo hi (no debugging symbols found)...(no debugging symbols found)...(no debugging= =20 symbols found)...(no debugging symbols found)...sudo: must be setuid root Program exited with code 01. Perhaps the cause of it not dumping core either. Would've been nice to know= =20 why it segfaults, but not nice enough to keep digging. =2D-=20 Mel