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 1120 - segfault at QApplication.__init__ in libshiboken-python2.7.so.1.1.0 (ubuntu,oneiric,x86_64)
: segfault at QApplication.__init__ in libshiboken-python2.7.so.1.1.0 (ubuntu,o...
Status: NEW
Product: PySide
Classification: Unclassified
Component: QtGui
: HEAD
: PC Linux
: P2 normal
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2012-01-15 13:29 EET by molostoff
Modified: 2012-03-08 16:58 EET (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description molostoff 2012-01-15 13:29:37 EET
# According to gdb it is in "Shiboken::Conversions::pythonTypeIsValueType"
# called from QApplication.__init__
# Python faulty code is:

class MyApp (QApplication, QTranslator, QUiLoader, QSettings):
   def __init__(self, appName, argv):
       QApplication.__init__ (self, argv) ## segfaulted here
       QSettings.__init__ (self, "A", "B")
       QTranslator.__init__ (self)
       QUiLoader.__init__ (self)

# I can not get full stack trace, sorry....
# from /var/log/kern.log:
[63082.490346] python[18935]: segfault at 8 ip 00007f66aa336e82 sp
00007fff6de9dee8 error 4 in libshiboken-
python2.7.so.1.1.0[7f66aa326000+2b000]
Comment 1 Hugo Parente Lima 2012-01-31 14:41:00 EET
Ok, this is a bug, but... you really need to inherit from all those classes!? 

Many of those classes you inherit are QObjects, so when you pass a MyApp
instance to any Qt function expecting a QObject you wont know what object you
are really passing, because internally shiboken will create instances for
QApplication, QTranslator, QUiLoader and QSettings, you are not even creating a
diamond shaped inheritance diagram, you are creating a prisma :-P
Comment 2 molostoff 2012-02-01 04:51:53 EET
Indeed, it looks very nice. 

I suppose (with hope) that shiboken will resolve overloaded virtual member
functions in a positional order taken from base classes declaration.

in theory (wtf?) - yes this may cause recursive dependencies at initialization,
but also I hope that Qt is mostly C++ grounded and multiple inheritance is a
native approach here, as they (qt developers) have already resolved and adopted
these things properly (if not - pyside is not responsible for that, I think). 

But if someone tend to remove multiple inheritance from pyside it will make Qt
interfaces ruined just in its root internals.

I suspect that shiboken tend to adopt native C++ behaviour here, so I dont care
which QObject I pass, since it is always a reference to MyApp vtable (or list?)
in some internal (hidden from me) form. 

When in doubt (or at runtime error exception) I can use python super() builtin,
but using context dependent constructs everywhere in source will soon cause
unreadability and make harder code reuse.

Why so? Its simple and clear with small app, like a cube. 

It seems to me that this piece of code is a good for test case.
Comment 3 Matti Airas 2012-03-08 16:58:00 EET
PySide is now a Qt-addon and uses Qt Project's JIRA tool for tracking bugs.
Please verify that the bug is still valid and re-submit it in the address
below:

https://bugreports.qt-project.org/

Sorry for the inconvenience!