Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Oct 2009 03:52:05 +0200
From:      Mel Flynn <mel.flynn+fbsd.hackers@mailing.thruhere.net>
To:        freebsd-hackers@freebsd.org
Cc:        Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= <des@des.no>
Subject:   Re: Running a program through gdb without "interfering"
Message-ID:  <200910100352.05524.mel.flynn%2Bfbsd.hackers@mailing.thruhere.net>
In-Reply-To: <86skdss6zq.fsf@ds4.des.no>
References:  <200910090015.24175.mel.flynn%2Bfbsd.hackers@mailing.thruhere.net> <200910091650.04231.mel.flynn%2Bfbsd.hackers@mailing.thruhere.net> <86skdss6zq.fsf@ds4.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 09 October 2009 21:27:21 Dag-Erling Sm=F8rgrav wrote:
> Mel Flynn <mel.flynn+fbsd.hackers@mailing.thruhere.net> writes:
> > Dag-Erling Sm=F8rgrav <des@des.no> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910100352.05524.mel.flynn%2Bfbsd.hackers>