Re: how to debug a program when the session freezes



On 1/9/06, Andrew Sobala <aes gnome org> wrote:
> Rod Butcher wrote:
>
> >Can somebody tell me how to get a gdb trace when the app I'm debugging
> >freezes my X session ? I'm running gnome-system-monitor from a
> >terminal : gdb gnome-system-monitor which freezes up the X session when
> >I click on the top menu line. The only way I can get out is by by
> >al-ctl-f1 and killing the X session from the linux command line. How do
> >I send the gdb output to a file for later retrieval, and is it possible
> >to get the stack trace some other way, without X ?
> >thanks
> >
> >
> You can control-alt-F1 first, export DISPLAY=:0, then run gdb from
> there. The app should appear in your X session, but gdb will run in the
> terminal.

Well, you might have access to the Xserver denied depending on your
distro's setup and handling of X, so this wouldn't work for everyone
without more effort.

(For those whom it wouldn't work for and are curious about how to make
this still work, the method I know requires root access but just means
copying the xauth file created by gdm to a temporary file that anyone
can access and make use of.  In detail, it means something like 'cp -a
/var/gdm/:0.Xauth /tmp/x-security-workaround && chmod a+r
/tmp/x-security-workaround' as root and then do an 'export
XAUTHORITY=/tmp/x-security-workaround' as the user that you want to
run graphical commands as in the virtual terminal.  Someone smarter
than me might have a simpler workaround available, besides just "don't
use a distro with annoying security constraints")



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]