From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 10 01:52:09 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 7CC2F106568D for ; Sat, 10 Oct 2009 01:52:09 +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 445628FC1C for ; Sat, 10 Oct 2009 01:52:08 +0000 (UTC) Received: from smoochies.rachie.is-a-geek.net (mailhub.lan.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id 6E5B17E857; Fri, 9 Oct 2009 17:52:20 -0800 (AKDT) From: Mel Flynn To: freebsd-hackers@freebsd.org Date: Sat, 10 Oct 2009 03:52:05 +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> <200910091650.04231.mel.flynn+fbsd.hackers@mailing.thruhere.net> <86skdss6zq.fsf@ds4.des.no> In-Reply-To: <86skdss6zq.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <200910100352.05524.mel.flynn+fbsd.hackers@mailing.thruhere.net> Cc: Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= 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: Sat, 10 Oct 2009 01:52:09 -0000 On Friday 09 October 2009 21:27:21 Dag-Erling Sm=F8rgrav wrote: > Mel Flynn writes: > > Dag-Erling Sm=F8rgrav writes: > > > Yes, just run "gdb /path/to/program" and type "run". > > > > 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 > > > > 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 g= db > > to use with set args $*, but if anyone has a more clever idea, I'd love > > to hear it. >=20 > Why look for a clever option, when the simple one will do just fine? Cause I don't know how much of the cause of this bug I'm influencing. Even= =20 though this is now the simple solution, it would be simpler if gdb (or anot= her=20 debugger) could work similar as sudo, where it would take the first argumen= t=20 as binary and the rest as arguments to the binary. This would do away with= =20 some extra IO I'm now creating. Though, it's unlikely it is related to IO,= =20 there is no pattern that I've found yet for the segfault, so I'm trying to= =20 limit any "extra stuff". I'll patch the kernel tomorrow with the new sysctl and see how far that get= s=20 me. > Add 'ulimit -c unlimited' somewhere in the script before it invokes sudo. I'll add it. =2D-=20 Mel