Date: Fri, 9 Oct 2009 10:30:44 -0700 (PDT) From: Nate Eldredge <nate@thatsmathematics.com> To: Mel Flynn <mel.flynn+fbsd.hackers@mailing.thruhere.net> Cc: freebsd-hackers@freebsd.org, Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= <des@des.no> Subject: Re: Running a program through gdb without "interfering" Message-ID: <Pine.GSO.4.64.0910091028530.5432@zeno.ucsd.edu> In-Reply-To: <200910091650.04231.mel.flynn%2Bfbsd.hackers@mailing.thruhere.net> References: <200910090015.24175.mel.flynn%2Bfbsd.hackers@mailing.thruhere.net> <86skds7vqi.fsf@ds4.des.no> <200910091650.04231.mel.flynn%2Bfbsd.hackers@mailing.thruhere.net>
index | next in thread | previous in thread | raw e-mail
On Fri, 9 Oct 2009, Mel Flynn wrote: > On Friday 09 October 2009 11:38:29 Dag-Erling Smørgrav wrote: >> Mel Flynn <mel.flynn+fbsd.hackers@mailing.thruhere.net> 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". > > 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 gdb to use with set > args $*, but if anyone has a more clever idea, I'd love to hear it. This won't work. You can't debug setuid programs (for reasons which should be obvious). You could do it if you ran everything as root, but it sounds like the bug doesn't occur in that case. -- Nate Eldredge nate@thatsmathematics.comhelp
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.64.0910091028530.5432>
