public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Kevin Pouget <kevin.pouget@gmail.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb@sourceware.org
Subject: Re: GDB crashing because of Python
Date: Thu, 23 Aug 2012 14:30:00 -0000	[thread overview]
Message-ID: <CAPftXULyovO08rghxQa2hO4RO8ssK6nt=O0g_abNUDo0OhPTCA@mail.gmail.com> (raw)
In-Reply-To: <87k3wpr9uy.fsf@fleche.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2275 bytes --]

On Thu, Aug 23, 2012 at 3:55 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Kevin" == Kevin Pouget <kevin.pouget@gmail.com> writes:
>
> Kevin> I notice today a lot for GDB crash because of Python, am I the
> Kevin> only one?  (I didn't refresh my git tree since a while, so it
> Kevin> might not be directly related to the last Python patches)
>
> Kevin> It's hard to tell exactly what cause it, but for instance I see
> Kevin> repeatedly:
> [...]
>
> I haven't seen it.
> I updated from CVS just now, rebuilt, and ran the gdb.python tests
> without any problems.
>
> Kevin> I'm on Fedora 17, x86_64, Python seems to be at version 2.7.3, gdb is
> Kevin> up to date against the trunk (7.5.50.20120823-cvs)
>
> I'm still on Fedora 16.  I wouldn't expect 17 to have particular
> problems like this though.
>
> What were you doing when you got these crashes?  Is it something simple
> that I could try?  What happens if you run the gdb.python tests?
>
> Tom

Hello,

> What happens if you run the gdb.python tests?
unfortunately, the run 100% fine ...

> What were you doing when you got these crashes?
just "normal" things, I mean, running code which have been running
fine until today.

> SystemError: /builddir/build/BUILD/Python-2.7.3/Objects/listobject.c:178: bad argument to internal function
this one is triggered in the middle of a Breakpoint callback, so it
appears quite often

> Program received signal SIGSEGV, Segmentation fault.
> PyObject_Malloc (nbytes=32)
>     at /usr/src/debug/Python-2.7.3/Objects/obmalloc.c:784
this one is when I want to attach gdb to another gdb instance (gdb2
--pid $(pidof gdb))

and finally:
> Fatal Python error: GC object already tracked
this one appears when I start the inferior execution, and start it again

I've attached the complete stack of this crash (from a third gdb!).

We can see that it crashed while auto-loading
"/usr/lib/debug/usr/bin/gdb-gdb.py", which is the original file from
Fedora gdb package.

I can also see that the stack contains "prompt_hook", I've seen another crash
which was mentioned this file [1], which deals with prompt customization.
It *might* be related, but I'm not sure at all.


Thanks,

Kevin


[1] : http://gitorious.org/misc-gdb-stuff/misc-gdb-stuff/blobs/master/misc_gdb/gaudy_prompt.py

[-- Attachment #2: stack.txt --]
[-- Type: text/plain, Size: 3717 bytes --]

(gdb) where
#0  0x0000003f19035925 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x0000003f190370d8 in __GI_abort () at abort.c:91
#2  0x0000003f2c4f7b3e in Py_FatalError (msg=msg@entry=
    0x3f2c520ae8 "GC object already tracked")
    at /usr/src/debug/Python-2.7.3/Python/pythonrun.c:1685
#3  0x0000003f2c4739cb in PyList_New (size=size@entry=0)
    at /usr/src/debug/Python-2.7.3/Objects/listobject.c:170
#4  0x0000003f2c4f58a5 in PyArena_New ()
    at /usr/src/debug/Python-2.7.3/Python/pyarena.c:143
#5  0x0000003f2c4f793a in PyRun_FileExFlags (fp=fp@entry=
    0x478ec40, filename=filename@entry=
    0x3d8f910 "/usr/lib/debug/usr/bin/gdb-gdb.py", 
    start=start@entry=257, globals=globals@entry=
    {'GdbOutputFile': <classobj at remote 0x23d8460>, '__builtins__': <module at remote 0x7f0a6e5f4ad0>, '__file__': '\x00\x00\x00\x00/lib/deb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'GdbRemoveReadlineFinder': <classobj at remote 0x23d83f8>, 'init': <module at remote 0x23ff718>, '__package__': None, 'sys': <module at remote 0x7f0a6e5f4b78>, 'GdbOutputErrorFile': <classobj at remote 0x23d84c8>, 'gdb': <module at remote 0x23f5830>, 'prompt_hook': None, '__name__': '__main__', 'GdbSetPythonDirectory': <function at remote 0x23f2758>, 'os': <module at remote 0x7f0a6e5bacc8>, '__doc__': None}, 
    locals=locals@entry=
    {'GdbOutputFile': <classobj at remote 0x23d8460>, '__builtins__': <module at remote 0x7f0a6e5f4ad0>, '__file__': '\x00\x00\x00\x00/lib/deb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'GdbRemoveReadlineFinder': <classobj at remote 0x23d83f8>, 'init': <module at remote 0x23ff718>, '__package__': None, 'sys': <module at remote 0x7f0a6e5f4b78>, 'GdbOutputErrorFile': <classobj at remote 0x23d84c8>, 'gdb': <module at remote 0x23f5830>, 'prompt_hook': None, '__name__': '__main__', 'GdbSetPythonDirectory': <function at remote 0x23f2758>, 'os': <module at remote 0x7f0a6e5bacc8>, '__doc__': None}, 
    closeit=closeit@entry=0, flags=flags@entry=0x0)
    at /usr/src/debug/Python-2.7.3/Python/pythonrun.c:1335
#6  0x0000003f2c4f83ab in PyRun_SimpleFileExFlags (fp=fp@entry=
    0x478ec40, filename=filename@entry=
    0x3d8f910 "/usr/lib/debug/usr/bin/gdb-gdb.py", 
    closeit=closeit@entry=0, flags=flags@entry=0x0)
    at /usr/src/debug/Python-2.7.3/Python/pythonrun.c:951
#7  0x00000000004d9b11 in python_run_simple_file (filename=
    0x3d8f910 "/usr/lib/debug/usr/bin/gdb-gdb.py", file=
    0x478ec40) at ../../../git/gdb/gdb/python/python.c:269
#8  source_python_script_for_objfile (objfile=0x26ed780, file=
    0x478ec40, filename=
    0x3d8f910 "/usr/lib/debug/usr/bin/gdb-gdb.py")
    at ../../../git/gdb/gdb/python/python.c:1134
#9  0x000000000050b1cc in auto_load_objfile_script (
    objfile=objfile@entry=0x26ed780, language=language@entry=
    0x748390 <script_language_python>)
    at ../../../git/gdb/gdb/auto-load.c:770
#10 0x00000000004da3df in gdbpy_load_auto_scripts_for_objfile (
    objfile=0x26ed780)
    at ../../../git/gdb/gdb/python/py-auto-load.c:233
#11 0x0000000000583d5d in captured_main (data=data@entry=
    0x7fffe49b9d30) at ../../../git/gdb/gdb/main.c:964
#12 0x000000000058213e in catch_errors (func=func@entry=
    0x583780 <captured_main>, func_args=func_args@entry=
    0x7fffe49b9d30, errstring=errstring@entry=0x733ab2 "", 
    mask=mask@entry=6) at ../../../git/gdb/gdb/exceptions.c:546
#13 0x0000000000584794 in gdb_main (args=args@entry=
    0x7fffe49b9d30) at ../../../git/gdb/gdb/main.c:1008
#14 0x000000000045894e in main (argc=<optimized out>, 
    argv=<optimized out>) at ../../../git/gdb/gdb/gdb.c:34
(gdb) 


  reply	other threads:[~2012-08-23 14:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-23 13:21 Kevin Pouget
2012-08-23 13:56 ` Tom Tromey
2012-08-23 14:30   ` Kevin Pouget [this message]
2012-08-23 18:52     ` Tom Tromey
2012-08-27 16:05       ` Kevin Pouget
2012-08-27 16:36         ` Tom Tromey
2012-08-27 16:39           ` Tom Tromey
2012-08-28 19:45           ` Tom Tromey
2012-08-29  8:14             ` Kevin Pouget
2012-09-06 19:27               ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPftXULyovO08rghxQa2hO4RO8ssK6nt=O0g_abNUDo0OhPTCA@mail.gmail.com' \
    --to=kevin.pouget@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).