Re: GDB does not work, sometimes

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



On Sat, Nov 23, 2013 at 3:18 PM, jb <jb.1234abcd@xxxxxxxxx> wrote:

> Rodrigo Rivas <rodrigorivascosta <at> gmail.com> writes:
>
> >
> > Hi!
> >
> > I'm having a very weird problem with gdb. I hadn't used the debugger for
> > some time, so I'm not sure for how long it has been broken...
> > The problem is that the debugged program does not stop in any breakpoing,
> > exception, signal... nothing. Just as if it weren't being debugged.
> > ...
>
> No problem here.
> gdb 7.6.1-1
> $ cat /proc/sys/kernel/yama/ptrace_scope
> 1
> $
>
> Perhaps you should start with some basic steps.
> Are you using any repos beyond the 3 basic ones (core, extra, community) ?
>
> Re-install gdb the "hard" way:
> pacman -Suy
> pacman -R gdb
> pacman -S gdb
> find /etc -iname "*.pac*"
>
> Verify dependencies:
> pacman -Qi gdb
>
> Verify:
> $ ls -al /usr/bin/gdb
> -rwxr-xr-x 1 root root 4634932 Aug 31 06:13 /usr/bin/gdb
> $ ldd /usr/bin/gdb
>         linux-gate.so.1 (0xb77b0000)
>         libreadline.so.6 => /usr/lib/libreadline.so.6 (0xb775b000)
>         libdl.so.2 => /usr/lib/libdl.so.2 (0xb7756000)
>         libncursesw.so.5 => /usr/lib/libncursesw.so.5 (0xb76f7000)
>         libz.so.1 => /usr/lib/libz.so.1 (0xb76e0000)
>         libm.so.6 => /usr/lib/libm.so.6 (0xb769a000)
>         libpthread.so.0 => /usr/lib/libpthread.so.0 (0xb767d000)
>         libpython2.7.so.1.0 => /usr/lib/libpython2.7.so.1.0 (0xb74e5000)
>         libexpat.so.1 => /usr/lib/libexpat.so.1 (0xb74bc000)
>         liblzma.so.5 => /usr/lib/liblzma.so.5 (0xb7495000)
>         libc.so.6 => /usr/lib/libc.so.6 (0xb72e5000)
>         /lib/ld-linux.so.2 (0xb77b1000)
>         libutil.so.1 => /usr/lib/libutil.so.1 (0xb72e0000)
> $
>
> Verify:
> $ cat /etc/gdb/gdbinit
> $ mv .gdbinit .gdbinit-save
>
> You can try debugging gdb itself first:
> $ gdb gdb
> or
> $ strace gdb
>
> jb
>
>
Thank for the suggestions! I've already done that: latest versions of
everything, no extra repositories...
I've even recompiled "gdb" using the ABS (with debugging symbols) and the
same result.

The main difference from my machine to yours is that I'm using x86_64, so
the ldd output is different. I'm also using Cinnamon, maybe the session
management have something to do with it...

I've strace'd two runs of gdb with the same program, one working (from a
VT) and one not working (from a PTY). The main difference that I can see is
that the non-working one does not call `ptrace()` at all.

I've tried debugging two instances of gdb in parallel, one working and one
not working. Actually quite confusing: 4 instances of gdb running at once,
working or failing for no apparent reasons...

What I've noticed is that if I'm debugging gdb and I put a breakpoint in
some selected places (`br vfork`, for example) then the problem fixes
itself for this execution.

Now I think that it may actually be a bug in gdb... I think I'll report to
upstream and see what happens.

Best regards
-- 
Rodrigo


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux