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 826 - Segmentation fault when geting custom event type
: Segmentation fault when geting custom event type
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: QtCore
: 1.0.1
: PC Linux
: P2 major
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2011-04-13 15:10 EEST by Krasilnikov Sergey
Modified: 2011-05-26 17:03 EEST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Krasilnikov Sergey 2011-04-13 15:10:06 EEST
see code below
last two prints causes "Segmentation fault"
if you uncomment pyqt4 import everything works fine

#===================================
from PySide import QtCore
#from PyQt4 import QtCore 

TEST_EVENT_TYPE = QtCore.QEvent.Type(QtCore.QEvent.registerEventType())

class TestEvent(QtCore.QEvent):
    TestEventType = QtCore.QEvent.Type(QtCore.QEvent.registerEventType())

    def __init__(self, rand=0):
        super(TestEvent, self).__init__(TestEvent.TestEventType)
        self._rand = rand

    def getRand(self):
        return self._rand


if __name__ == '__main__':
    for a in range(5):
        b = TestEvent(a)
        print b.type()
        print b.getRand()
    print '---------'
    print TestEvent.TestEventType
    print '---------'
    print TEST_EVENT_TYPE
Comment 1 Hugo Parente Lima 2011-04-13 16:22:46 EEST
Works for me (tm).

[hugo@thinkpadugo tmp  4.7] $ python test.py                                    
<enum-item PySide.QtCore.QEvent.Type.#out of bounds# (65534)>                   
0                                                                               
<enum-item PySide.QtCore.QEvent.Type.#out of bounds# (65534)>                   
1                                                                               
<enum-item PySide.QtCore.QEvent.Type.#out of bounds# (65534)>                   
2                                                                               
<enum-item PySide.QtCore.QEvent.Type.#out of bounds# (65534)>                   
3                                                                               
<enum-item PySide.QtCore.QEvent.Type.#out of bounds# (65534)>                   
4                                                                               
---------                                                                       
<enum-item PySide.QtCore.QEvent.Type. (65534)>                                  
---------                                                                       
<enum-item PySide.QtCore.QEvent.Type. (65535)>
Comment 2 Lauro Moura 2011-04-13 16:31:56 EEST
Segfaults here. PySide from git (debug build) + qt 4.7.1. Ubuntu 64.
Comment 3 Lauro Moura 2011-04-13 16:33:21 EEST
Trace:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6a0435e in _IO_vfprintf_internal (s=0x7ffff6d38780, format=<value
optimized out>, ap=0x7fffffffd790) at vfprintf.c:1614
1614    vfprintf.c: No such file or directory.
    in vfprintf.c
(gdb) where
#0  0x00007ffff6a0435e in _IO_vfprintf_internal (s=0x7ffff6d38780,
format=<value optimized out>, ap=0x7fffffffd790) at vfprintf.c:1614
#1  0x00007ffff6a0b498 in __fprintf (stream=0xcbcbcbcbcbcbcbff,
format=0x7ffff5b061ce "%s (%ld)>") at fprintf.c:33
#2  0x00007ffff5afb7ba in SbkEnumObject_print (self=65534, fp=0x7ffff6d38780)
at /home/lauro/dev/pyside/shiboken/libshiboken/sbkenum.cpp:55
#3  0x000000000045f3ba in internal_print (op=65534, fp=0x7ffff6d38780, flags=1,
nesting=0) at ../Objects/object.c:310
#4  0x000000000045f42e in PyObject_Print (op=65534, fp=0x7ffff6d38780, flags=1)
at ../Objects/object.c:325
#5  0x00000000004372ec in file_PyObject_Print (op=65534, f=0x7ffff7fb21c0,
flags=1) at ../Objects/fileobject.c:116
#6  0x000000000043c6bc in PyFile_WriteObject (v=65534, f=<file at remote
0x7ffff7fb21c0>, flags=1) at ../Objects/fileobject.c:2387
#7  0x00000000004c9bb6 in PyEval_EvalFrameEx (f=Frame 0x9d15f0, for file
test.py, line 25, in <module> (), throwflag=0) at ../Python/ceval.c:1630
Comment 4 Krasilnikov Sergey 2011-04-13 17:52:46 EEST
Ubuntu 10.10 (x64) qt4.7 pyside 1.0.1 from PPA
sorry!
Comment 5 Krasilnikov Sergey 2011-04-13 18:47:08 EEST
also check on Win2008 python2.7
PySide-1.0.0qt472.win32-py2.7.exe

Same crash!!
Comment 6 renato filho 2011-05-03 01:14:34 EEST
fixed on shiboken commit:

commit d5794d3402e9b68d358b382c53f17ebbd08ca844
Author: Renato Filho <renato.filho@openbossa.org>
Date:   Mon May 2 17:43:45 2011 -0300
Comment 7 renato filho 2011-05-26 17:03:59 EEST
PySide release 1.0.3