[Python-Dev] PyGEGL instant crash (Python regression?)

Josiah Carlson jcarlson at uci.edu
Fri Jul 20 10:26:13 CEST 2007


"David Gowers" <00ai99 at gmail.com> wrote:
> Has anyone tried PyGEGL, the Python interface to gegl (www.gegl.org),
> with SVN Python?
> When I 'import gegl', that causes an immediate crash with the
> following backtrace.

I would wager a beer or two that the issue is in the wrapping of gegl.
Having recently started wrapping modules by hand and with Swig, I have
come to notice that making a mistake with refcounts can lead to
segfaults like you are seeing.  If you are getting that immediately upon
import, you may want to check to make sure that the function that is
initializing your module (typically something like init_gegl) is doing
the right things (I can't really offer any suggestions on what to check
for, I literally only started wrapping stuff by hand yesterday;
previously I used Pyrex, which can handle all refcounts for you if
desired).


 - Josiah


> 
> ----
> babl-db.c:100 babl_db_insert()
>        Eeeeek
> Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
> [Thread debugging using libthread_db enabled]
> [New Thread -1210014016 (LWP 30914)]
> 0xffffe410 in __kernel_vsyscall ()
> #0  0xffffe410 in __kernel_vsyscall ()
> #1  0xb7e97933 in waitpid () from /lib/tls/i686/cmov/libc.so.6
> #2  0xb7e413c9 in strtold_l () from /lib/tls/i686/cmov/libc.so.6
> #3  0xb7f6e7dd in system () from /lib/tls/i686/cmov/libpthread.so.0
> #4  0xb6e93df4 in babl_backtrack () at babl-internal.c:68
> #5  0xb6e93e15 in babl_die () at babl-internal.c:74
> #6  0xb6e8d352 in babl_db_insert (db=0x0, item=0x82bbff8) at babl-db.c:100
> #7  0xb6e968be in babl_type_new (first_arg=0xb6ef90d6) at babl-type.c:135
> #8  0xb6ef7dea in init () at CIE-Lab.c:427
> #9  0xb7b191b3 in babl_extension_init () at babl-extension.c:194
> #10 0xb7b16a2f in babl_init () at babl.c:40
> #11 0xb7b3630e in gegl_post_parse_hook (context=0x0, group=0x0,
> data=0x0, error=0x0)
>    at gegl-init.c:199
> #12 0xb7b364d5 in gegl_init (argc=0xbffa1038, argv=0xbffa1034) at gegl-init.c:73
> #13 0xb7f8494d in pygegl_register_classes (d=0xb7d27714) at gegl.override:139
> #14 0xb7f82f21 in initgegl () at geglmodule.c:57
> #15 0x080d742f in _PyImport_LoadDynamicModule (name=0xbffa2177 "gegl",
>    pathname=0xbffa1103
> "/usr/lib/python2.6/site-packages/geglmodule.so", fp=0xfffffe00)
>    at ./Python/importdl.c:53
> #16 0x080d5327 in load_module (name=0xbffa2177 "gegl", fp=0x0,
>    buf=0xbffa1103 "/usr/lib/python2.6/site-packages/geglmodule.so", type=3,
>    loader=0xbffa0974) at Python/import.c:1752
> #17 0x080d578c in import_submodule (mod=0x81343c0, subname=0xbffa2177 "gegl",
>    fullname=0xbffa2177 "gegl") at Python/import.c:2394
> #18 0x080d59d1 in load_next (mod=0x81343c0, altmod=0x81343c0,
> p_name=<value optimized out>,
>    buf=0xbffa2177 "gegl", p_buflen=0xbffa3178) at Python/import.c:2214
> #19 0x080d5e0d in import_module_level (name=0x0, globals=0xb7de2acc,
>    locals=<value optimized out>, fromlist=0x81343c0, level=-1) at
> Python/import.c:1995
> #20 0x080d62de in PyImport_ImportModuleLevel (name=0xb7d23374 "gegl",
> globals=0xb7de2acc,
>    locals=0xb7de2acc, fromlist=0xfffffe00, level=-512) at Python/import.c:2066
> #21 0x080b5658 in builtin___import__ (self=0x0, args=0xfffffe00,
> kwds=0xfffffe00)c:1995
>    at Python/bltinmodule.c:47
> #22 0x0805a8ac in PyObject_Call (func=0xbffa0974, arg=0xfffffe00, kw=0xfffffe00)
>    at Objects/abstract.c:1860
> #23 0x080b9c39 in PyEval_CallObjectWithKeywords (func=0xfffffe00,
> arg=0xb7ddecac, kw=0x0)
>    at Python/ceval.c:3433
> #24 0x080bc631 in PyEval_EvalFrameEx (f=0x81ebf24, throwflag=0) at
> Python/ceval.c:2071
> #25 0x080c133f in PyEval_EvalCodeEx (co=0xb7d9d968,
> globals=0xb7de2acc, locals=0xb7de2acc,
>    args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0)
>    at Python/ceval.c:2840
> #26 0x080c14c6 in PyEval_EvalCode (co=0xfffffe00, globals=0xfffffe00,
> locals=0xfffffe00)
>    at Python/ceval.c:493
> #27 0x080df9dc in PyRun_InteractiveOneFlags (fp=0xfffffe00,
> filename=0x8116d6e "<stdin>",
>    flags=0xbffa3688) at Python/pythonrun.c:1293
> #28 0x080dfbd0 in PyRun_InteractiveLoopFlags (fp=0xb7f37240,
> filename=0x8116d6e "<stdin>",
>    flags=0xbffa3688) at Python/pythonrun.c:723
> #29 0x080e030b in PyRun_AnyFileExFlags (fp=0xb7f37240,
> filename=0x8116d6e "<stdin>",
>    closeit=0, flags=0xbffa3688) at Python/pythonrun.c:692
> #30 0x08056dad in Py_Main (argc=0, argv=0xbffa3724) at Modules/main.c:527
> #31 0xb7e20ea2 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
> #32 0x08056251 in _start () at ../sysdeps/i386/elf/start.S:119
> ----
> 
> I'm pretty sure that the bug lies in either Python or the pygegl module, as I've
> ran the babl and gegl tests successfully (and the gegl editor
> works okay too)
> 
> (btw, this is with both SVN python and SVN gegl -- PyGEGL is included
> in the gegl repository; in order to test this, you might also need the
> SVN version of babl. Lastly, in the gegl tree, you can find PyGEGL
> source in the bindings/pygegl/ dir.)
> 
> I posted this report originally to the gegl-developer list.
> 
> Kevin Cozens, the PyGEGL maintainer, said:
> > I have only tested pyGEGL with the 2.4 version of Python. It possible (or very
> > likely?) that something has changed in the 2.6 version of Python. I don't have
> > the 2.6 version installed at the moment so I can't investigate this further.
> 
> Sven Neumann said:
> > Have you contacted the python developers then? This looks a lot like a
> > regression in Python and I guess they would like to hear about it before
> > the release the next version.
> 
> Hence I'm posting it here. Perhaps someone can shed some light on what
> is happening here?
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/jcarlson%40uci.edu



More information about the Python-Dev mailing list