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>
next in thread | previous in thread | raw e-mail | index | archive | help
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---559023410-1506727461-1255109444=:5432 Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Fri, 9 Oct 2009, Mel Flynn wrote: > On Friday 09 October 2009 11:38:29 Dag-Erling Sm=F8rgrav 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 someth= ing > 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 thinkin= g i > should just wrap it and mktemp(1) a new command script for gdb to use wit= h 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=20 should be obvious). You could do it if you ran everything as root, but it= =20 sounds like the bug doesn't occur in that case. --=20 Nate Eldredge nate@thatsmathematics.com ---559023410-1506727461-1255109444=:5432--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.64.0910091028530.5432>