Bug#676908: C program embedding python segfaults after reinitialization in subsequent call to import a script using gi.repository module

2012-06-11 Thread Josselin Mouette
severity 676908 normal
forwarded 676908 https://bugzilla.gnome.org/show_bug.cgi?id=677091
thanks

Le dimanche 10 juin 2012 à 14:13 +0200, Andrey Gursky a écrit : 
 You call Py_Initialize(), then import a python script, which contains
 at least one(!) of the following imports:
 from gi.repository import GLib
 from gi.repository import Gtk
 from gi.repository import Cairo
 from gi.repository import Pango
 from gi.repository import Gio
 Than you call Py_Finalize();
 After you repeat Py_Initialize() and try to import the script again,
 it segfaults.
 But there is no problems with pygtk.

Seriously? Can’t you deal with such programming problems with upstream?

-- 
 .''`.  Josselin Mouette
: :' :
`. `'
  `-




--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Processed: Re: Bug#676908: C program embedding python segfaults after reinitialization in subsequent call to import a script using gi.repository module

2012-06-11 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

 severity 676908 normal
Bug #676908 [python-gi] C program embedding python segfaults after 
reinitialization in subsequent call to import a script using gi.repository 
module
Severity set to 'normal' from 'serious'
 forwarded 676908 https://bugzilla.gnome.org/show_bug.cgi?id=677091
Bug #676908 [python-gi] C program embedding python segfaults after 
reinitialization in subsequent call to import a script using gi.repository 
module
Set Bug forwarded-to-address to 
'https://bugzilla.gnome.org/show_bug.cgi?id=677091'.
 thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
676908: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=676908
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems


--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#676908: C program embedding python segfaults after reinitialization in subsequent call to import a script using gi.repository module

2012-06-10 Thread Andrey Gursky
Package: python-gi
Version: 3.2.2-1
Severity: serious

On the pygtk page everyone is encouraged to upgrade from pygtk to
using gtkCo through gobject introspection. The further described
behavior introduces a regression compared to pygtk.

You call Py_Initialize(), then import a python script, which contains
at least one(!) of the following imports:
from gi.repository import GLib
from gi.repository import Gtk
from gi.repository import Cairo
from gi.repository import Pango
from gi.repository import Gio
Than you call Py_Finalize();
After you repeat Py_Initialize() and try to import the script again,
it segfaults.
But there is no problems with pygtk.

Please try out this small program and if it fails for you, please
confirm the bug upstream:
https://bugzilla.gnome.org/show_bug.cgi?id=677091.

Thanks,
Andrey
running embedded python...
[36161 refs]
...done
running embedded python...

Program received signal SIGSEGV, Segmentation fault.
0x779dcc27 in PyObject_GC_UnTrack (op=0xb60da8) at 
../Modules/gcmodule.c:1428
1428../Modules/gcmodule.c: No such file or directory.
(gdb) bt
#0  0x779dcc27 in PyObject_GC_UnTrack (op=0xb60da8) at 
../Modules/gcmodule.c:1428
#1  0x76179e1b in _base_info_dealloc (self=0xb60da8) at 
/home/martin/debian/pkg-gnome/build-area/pygobject-3.2.2/gi/pygi-info.c:35
#2  0x778ec9eb in _Py_Dealloc (op=0xb60da8) at ../Objects/object.c:2243
#3  0x778be583 in frame_dealloc (f=0xba4c10) at 
../Objects/frameobject.c:458
#4  0x778ec9eb in _Py_Dealloc (op=0xba4c10) at ../Objects/object.c:2243
#5  0x7798b355 in PyEval_EvalCodeEx (co=0xb01880, globals=0xb967f0, 
locals=0x0, args=0xb86088, argcount=2, kws=0x0, kwcount=0, defs=0x0, 
defcount=0, closure=0x0) at ../Python/ceval.c:3264
#6  0x778c215b in function_call (func=0xb7b8e8, arg=0xb86060, kw=0x0) 
at ../Objects/funcobject.c:526
#7  0x77882182 in PyObject_Call (func=0xb7b8e8, arg=0xb86060, kw=0x0) 
at ../Objects/abstract.c:2529
#8  0x7789e1c1 in instancemethod_call (func=0xb7b8e8, arg=0xb86060, 
kw=0x0) at ../Objects/classobject.c:2578
#9  0x77882182 in PyObject_Call (func=0x802060, arg=0xb85840, kw=0x0) 
at ../Objects/abstract.c:2529
#10 0x77882e9d in PyObject_CallFunctionObjArgs (callable=0x802060) at 
../Objects/abstract.c:2760
#11 0x77923cb4 in call_attribute (self=0xb79d10, attr=0x802060, 
name=0xa25a60) at ../Objects/typeobject.c:5441
#12 0x77923f7f in slot_tp_getattr_hook (self=0xb79d10, name=0xa25a60) 
at ../Objects/typeobject.c:5495
#13 0x778e9e8c in PyObject_GetAttr (v=0xb79d10, name=0xa25a60) at 
../Objects/object.c:1191
#14 0x77986d65 in PyEval_EvalFrameEx (f=0xba45d0, throwflag=0) at 
../Python/ceval.c:2256
#15 0x7798b2a9 in PyEval_EvalCodeEx (co=0xb78e00, globals=0xba7780, 
locals=0x0, args=0xba2810, argcount=0, kws=0xba2810, kwcount=0, defs=0x0, 
defcount=0, closure=0x0) at ../Python/ceval.c:3253
#16 0x7798e3c1 in fast_function (func=0xb7b798, 
pp_stack=0x7ffeca00, n=0, na=0, nk=0) at ../Python/ceval.c:4117
#17 0x7798df84 in call_function (pp_stack=0x7ffeca00, oparg=0) at 
../Python/ceval.c:4042
#18 0x779887a4 in PyEval_EvalFrameEx (f=0xba2670, throwflag=0) at 
../Python/ceval.c:2666
#19 0x7798b2a9 in PyEval_EvalCodeEx (co=0xb83b40, globals=0xba7780, 
locals=0xba7780, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, 
defcount=0, closure=0x0) at ../Python/ceval.c:3253
#20 0x779809f4 in PyEval_EvalCode (co=0xb83b40, globals=0xba7780, 
locals=0xba7780) at ../Python/ceval.c:667
#21 0x779aa0e0 in PyImport_ExecCodeModuleEx (name=0x7ffef090 
gi.overrides.GLib, co=0xb83b40, 
pathname=0x7ffeceb0 
/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyc) at 
../Python/import.c:681
#22 0x779aadfb in load_source_module (name=0x7ffef090 
gi.overrides.GLib, 
pathname=0x7ffeceb0 
/usr/lib/python2.7/dist-packages/gi/overrides/GLib.pyc, fp=0xba2400) at 
../Python/import.c:1018
#23 0x779acad8 in load_module (name=0x7ffef090 gi.overrides.GLib, 
fp=0xba2400, 
pathname=0x7ffedf90 
/usr/lib/python2.7/dist-packages/gi/overrides/GLib.py, type=1, loader=0x0) at 
../Python/import.c:1822
#24 0x779aef41 in import_submodule (mod=0xb73198, subname=0x9a6974 
GLib, fullname=0x7ffef090 gi.overrides.GLib) at ../Python/import.c:2595
#25 0x779aea1c in ensure_fromlist (mod=0xb73198, fromlist=0xb7c240, 
buf=0x7ffef090 gi.overrides.GLib, buflen=12, recursive=0)
at ../Python/import.c:2506
#26 0x779ad9a0 in import_module_level (name=0x0, globals=0x0, 
locals=0x0, fromlist=0xb7c240, level=-1) at ../Python/import.c:2174
#27 0x779ada89 in PyImport_ImportModuleLevel (name=0xb52e44 
gi.overrides, globals=0x0, locals=0x0, fromlist=0xb7c240, level=-1)
at ../Python/import.c:2188
#28 0x779766c7 in builtin___import__ (self=0x0, args=0xb79b50, 
kwds=0xba22e0) at