Summary: | latest sip and PyQt4 cause segfault when using "import qt" | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | James Bowlin <bowlin> |
Component: | Current packages | Assignee: | Qt Bug Alias <qt> |
Status: | RESOLVED TEST-REQUEST | ||
Severity: | normal | ||
Priority: | High | ||
Version: | 2006.1 | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
James Bowlin
2009-06-12 16:27:29 UTC
This behavior doesnt happen with every PyQt4 application so I am adjusting the title So far we havent found any PyQt4 that fails with the latest pyqt4 and sip. Did you try to re-emerge xbmc? I did try re-emerging xbmc but it made no difference. Did you try the sample 5-line program I provided? It always segfaults with the newer sip + PyQt4. It no longer segfaults after I downgraded sip. (In reply to comment #2) > I did try re-emerging xbmc but it made no difference. Did you try the sample > 5-line program I provided? It always segfaults with the newer sip + PyQt4. It > no longer segfaults after I downgraded sip. > 'qt' is not a valid module name... (In reply to comment #3) > > 'qt' is not a valid module name... I believe that is why there is the try statement, to determine if 'qt' is a valid module name on the system. If the import statement works then the append is executed, otherwise it is not. But regardless, unlike C, if Python segfaults, the fault never lies in the script. IMO a segfault under any conditions is a significant bug. For example this code: try: from xyzzy import * print "Module xyzzy exists.\n" except: print "Module xyzzy not found.\n" Prints "Module zyzzy not found." on my system. Also, a similar test program with qt says that qt does exist on my system (with the older versions of sip and PyQt). What happens if you execute 'import qt' in a python shell? Import qt works fine. But I'm still using the downgraded packages so the test program is also working fine. considering he provided a very simple piece of test code that has nothing xbmc related in it that still crashes ... I updated the title. It never occurred to me that someone would suspect the append line so I upgraded to the latest sip and PyQt to verify. I get a segfault when I try to run: import qt Works for me
hwoarang@Raptor ~ $ python
Python 2.6.2 (r262:71600, May 29 2009, 01:05:03)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import qt
>>>
I still can't understand where that 'qt' module comes from. PyQt4 does not install such a module, it may belong to PyQt-3.x... Could you post the output of: qfile /usr/lib/python*/site-packages/qt.* Works for me, in the sense that it doesnt segfault with sip-4.8 and PyQt4-4.5: ben@raven ~ % python Python 2.6.2 (r262:71600, May 30 2009, 15:55:39) [GCC 4.3.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import qt Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named qt And the same on my other box: ben@hummingbird ~ % python Python 2.6.2 (r262:71600, Jun 8 2009, 17:17:30) [GCC 4.4.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import qt Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named qt (In reply to comment #10) > I still can't understand where that 'qt' module comes from. PyQt4 does not > install such a module, it may belong to PyQt-3.x... > > Could you post the output of: > qfile /usr/lib/python*/site-packages/qt.* > Yes it comes from PyQt-3.X hwoarang@Raptor ~ $ qlist PyQt|grep qt|grep site-packages|sed "s/.*\///" qtsql.so qt.so qtgl.so qtxml.so qtui.so qtcanvas.so pyqtconfig.py qttable.so qtnetwork.so qt.so qtproxies.py qtwebkit.py pyqtconfig.py So was PyQt updated to 3.18, to go along with sip-4.8 ? (In reply to comment #13) > So was PyQt updated to 3.18, to go along with sip-4.8 ? No. I think this is probably where the problem lies. I added: dev-python/PyQt x11-libs/qscintilla dev-python/qscintilla-python to package.keywords but unfortunately PyQt failed to emerge with this error: sip/qt/qobject.sip: In function 'void* sipQtCreateUniversalSlot(sipWrapper*, const char*, PyObject*, const char*, const char**, int)': sip/qt/qobject.sip:1652: error: 'struct _sipWrapper' has no member named 'ob_type' which was preceded by six warnings like: sip/qt/qobject.sip:1256: warning: missing initializer for member '_heaptypeobject::ht_slots' Please try to reproduce this issue with the latest PyQt-3.18 Re-open the bug if needed Thanks Thanks. I was able to emerge PyQt-3.18-r1 and that solved the problem. Thank you all for your help. |