PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 506 - Segmentation fault
: Segmentation fault
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: QtCore
: 0.4.2
: PC Linux
: P2 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2010-11-28 18:59 EET by Walter Hofmann
Modified: 2011-01-06 16:19 EET (History)
8 users (show)

See Also:


Attachments
app.py (37 bytes, text/x-python)
2010-11-28 18:59 EET, Walter Hofmann
Details
mod.py (84 bytes, text/x-python)
2010-11-28 19:00 EET, Walter Hofmann
Details
Output/Backtrace of "import PySide" run in python2.6-dbg (34.59 KB, text/plain)
2010-12-07 18:53 EET, Walter Hofmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Walter Hofmann 2010-11-28 18:59:47 EET
Created attachment 159 [details]
app.py

Hi,

When I start the attached app.py, I get a segmentation fault. 

Starting python in gdb gives the following stack trace:

(gdb) run app.py
Starting program: /usr/bin/python app.py
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x08393c20 in ?? ()
(gdb) where
#0  0x08393c20 in ?? ()
#1  0x0808fa4d in ?? ()
#2  0x0810a58c in ?? ()
#3  0x0810afd9 in PyGC_Collect ()
#4  0x080fd197 in Py_Finalize ()
#5  0x0805b086 in Py_Main ()
#6  0x0805a8ab in main ()
(gdb) 

Notes:
- I get the segmentation fault every time
- I tried to find the smallest example where I could still reproduce the
segmentation fault
- Ubuntu Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39) 
- Unbuntu Linux 2.6.36-020636-generic #201010210905 SMP Thu Oct 21 10:17:53 UTC
2010 i686 GNU/Linux
Comment 1 Walter Hofmann 2010-11-28 19:00:27 EET
Created attachment 160 [details]
mod.py
Comment 2 Hugo Parente Lima 2010-11-29 10:09:17 EET
Works for me with PySide 1.0.0~beta1.

Can you also test it with PySide 1.0.0~beta1?
Comment 3 Walter Hofmann 2010-12-07 18:17:07 EET
Hi,

I tested it with pyside 1.0.0 beta 1 (from Ubuntu ppa) and the test program
attached to this bug report still gives a segmentation fault.

It seems to me that there is some memory corruption occuring. The "import gc"
step in the test case is just enough computation on my computer to escalate the
memory corruption to a segmentation fault. The original program where I noticed
the bug the first time didn't use the gc module but crashed in some other,
pure-python function that did some involved list manipulation.

Anything I can do to help getting this resolved?

Regards,
Walter
Comment 4 Walter Hofmann 2010-12-07 18:53:44 EET
Created attachment 170 [details]
Output/Backtrace of "import PySide" run in python2.6-dbg

When I run "import PySide" inside python2.6-dbg, I will get an assertation
failure:

 python2.6-dbg: ../Objects/object.c:65: _Py_AddToAllObjects: Assertion
`(op->_ob_prev == ((void *)0)) == (op->_ob_next == ((void *)0))' failed.

Attached is the backtrace I obtained from gdb. I think these lines matter most:

#3  0xb7c928e8 in __assert_fail (assertion=0x81e12c4 "(op->_ob_prev == ((void
*)0)) == (op->_ob_next == ((void *)0))", file=
    0x81e12b0 "../Objects/object.c", line=65, function=0x81e204f
"_Py_AddToAllObjects") at assert.c:81
#4  0x08096880 in _Py_AddToAllObjects (op=<unknown at remote 0xb7355460>,
force=0) at ../Objects/object.c:65
#5  0x080c11de in PyType_Ready (type=0xb7355460) at
../Objects/typeobject.c:3929
#6  0xb73458e3 in Shiboken::init() () from /usr/lib/libshiboken-py26.so.1.0
#7  0xb775ef7c in initQtCore () from
/usr/lib/pymodules/python2.6/PySide/QtCore.so
#8  0x08117d76 in _PyImport_LoadDynamicModule (name=0xbfff5b5b "PySide.QtCore",
pathname=
    0xbfff4abb "/usr/lib/pymodules/python2.6/PySide/QtCore.so", fp=0x8317a60)
at ../Python/importdl.c:53


Could this cause the segmentation fault I observed?
Comment 5 Hugo Parente Lima 2010-12-07 19:05:59 EET
Can be, I didn't tested your code using a debug-enabled python.
Comment 6 Matti Airas 2010-12-07 19:10:51 EET
For some reason I've managed to miss this before - sorry about that. Since the
bug results in a segfault and the cause has been potentially narrowed down
quite a bit, I'm prioritizing this P2. The bug will be taken in once the
preceding P2 bugs have been fixed.
Comment 7 Marcelo Lira 2010-12-21 12:33:56 EET
Running it with python2.6-dbg I got a segmentation fault that I discovered was
caused by a bug in QT_TRANSLATE_NOOP. All this function do is to return the
second argument, our implementation wasn't increasing the reference counting
for the object before returning.

I've made a test and a fix in commit PySide/bb39c847.

Running app.py with python2.6-dbg now works fine.
Comment 8 renato filho 2011-01-06 16:19:29 EET
released on beta3