View Issue Details

IDProjectCategoryView StatusLast Update
0007879ScribusScripterpublic2010-12-13 15:14
Reportereob Assigned Tosubik  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionno change required 
PlatformLinuxOSUbuntuOS Version8.04 Hardy Heron
Product Version1.3.5svn 
Target Version1.3.5svn 
Summary0007879: "import qt" in startup script crashes Scribus
DescriptionIf you try to import qt in a startup extension script, Scribus will crash. See "Steps to reproduce" below. Also see "Additional Information" below for the stack trace from gdb.

Thanks.

Hope this helps.
Steps To Reproduce(1) Create a script file containing the following
---------------------
try:
    print "importing qt"
    import qt
    print "qt imported"
except:
    print "Cannot import qt"
---------------------

(2) Open Scribus, go to preferences and set this script as the startup extension script.

(3) Close Scribus, and start it again in a terminal winddow. Scribus will crash, popping up an alert "Scribus Crash/Scribus crashes due to Signal 0000011" and the following appears in the terminal:
------------------
$ scribus
importing qt
Scribus Crash
-------------
Scribus crashes due to Signal 0000011
Calling Emergency Save
Segmentation fault
$
------------------


 
Additional Information$ gdb --args scribus
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(gdb) run
Starting program: /usr/local/bin/scribus
[Thread debugging using libthread_db enabled]
[New Thread 0xb66756d0 (LWP 355)]
importing qt

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb66756d0 (LWP 355)]
0xb560e120 in QMutexPool::get () from /usr/lib/libqt-mt.so.3
(gdb) bt
#0 0xb560e120 in QMutexPool::get () from /usr/lib/libqt-mt.so.3
0000001 0xb52f0286 in QMetaObjectCleanUp::QMetaObjectCleanUp ()
   from /usr/lib/libqt-mt.so.3
0000002 0xb56dbf67 in ?? () from /usr/lib/libqt-mt.so.3
0000003 0xb56dbfa8 in ?? () from /usr/lib/libqt-mt.so.3
0000004 0xb56dc3c5 in ?? () from /usr/lib/libqt-mt.so.3
0000005 0xb51dab5c in _init () from /usr/lib/libqt-mt.so.3
0000006 0xb7f28990 in ?? () from /lib/ld-linux.so.2
0000007 0xb7f28ac3 in ?? () from /lib/ld-linux.so.2
0000008 0xb7f2c774 in ?? () from /lib/ld-linux.so.2
0000009 0xb7f285c6 in ?? () from /lib/ld-linux.so.2
0000010 0xb7f2bf4e in ?? () from /lib/ld-linux.so.2
0000011 0xb6fdcc19 in ?? () from /lib/tls/i686/cmov/libdl.so.2
0000012 0xb7f285c6 in ?? () from /lib/ld-linux.so.2
0000013 0xb6fdd2bc in ?? () from /lib/tls/i686/cmov/libdl.so.2
0000014 0xb6fdcb51 in dlopen () from /lib/tls/i686/cmov/libdl.so.2
0000015 0xb6df5ff5 in _PyImport_GetDynLoadFunc () from /usr/lib/libpython2.5.so.1.0
0000016 0xb6de5358 in _PyImport_LoadDynamicModule ()
   from /usr/lib/libpython2.5.so.1.0
0000017 0xb6de3096 in ?? () from /usr/lib/libpython2.5.so.1.0
0000018 0xb6de32f3 in ?? () from /usr/lib/libpython2.5.so.1.0
0000019 0xb6de37f8 in ?? () from /usr/lib/libpython2.5.so.1.0
0000020 0xb6de3a0f in ?? () from /usr/lib/libpython2.5.so.1.0
0000021 0xb6de40c3 in PyImport_ImportModuleLevel ()
   from /usr/lib/libpython2.5.so.1.0
0000022 0xb6dc2624 in ?? () from /usr/lib/libpython2.5.so.1.0
0000023 0xb6d7b600 in PyCFunction_Call () from /usr/lib/libpython2.5.so.1.0
0000024 0xb6d44897 in PyObject_Call () from /usr/lib/libpython2.5.so.1.0
0000025 0xb6dc2dec in PyEval_CallObjectWithKeywords ()
   from /usr/lib/libpython2.5.so.1.0
0000026 0xb6dc6bcf in PyEval_EvalFrameEx () from /usr/lib/libpython2.5.so.1.0
0000027 0xb6dcb5a8 in PyEval_EvalCodeEx () from /usr/lib/libpython2.5.so.1.0
0000028 0xb6dcb703 in PyEval_EvalCode () from /usr/lib/libpython2.5.so.1.0
0000029 0xb6deeb1a in PyRun_FileExFlags () from /usr/lib/libpython2.5.so.1.0
0000030 0xb6dc1c0b in ?? () from /usr/lib/libpython2.5.so.1.0
0000031 0xb6d7b5ea in PyCFunction_Call () from /usr/lib/libpython2.5.so.1.0
0000032 0xb6dc9e16 in PyEval_EvalFrameEx () from /usr/lib/libpython2.5.so.1.0
0000033 0xb6dcb5a8 in PyEval_EvalCodeEx () from /usr/lib/libpython2.5.so.1.0
0000034 0xb6dcb703 in PyEval_EvalCode () from /usr/lib/libpython2.5.so.1.0
0000035 0xb6dec8ac in PyRun_StringFlags () from /usr/lib/libpython2.5.so.1.0
0000036 0xb61b1846 in ScripterCore::slotRunScriptFile ()
   from /usr/local/lib/scribus/plugins//libscriptplugin.so
0000037 0xb61b288f in ScripterCore::runStartupScript ()
   from /usr/local/lib/scribus/plugins//libscriptplugin.so
0000038 0xb61c00a8 in ScriptPlugin::initPlugin ()
   from /usr/local/lib/scribus/plugins//libscriptplugin.so
---Type <return> to continue, or q <return> to quit---
0000039 0x086b5b34 in PluginManager::enablePlugin ()
0000040 0x086b76e0 in PluginManager::initPlugin ()
0000041 0x086b7b88 in PluginManager::initPlugs ()
0000042 0x089befd9 in ScribusCore::initScribusCore ()
0000043 0x089bf417 in ScribusCore::startGUI ()
0000044 0x089b41f9 in ScribusQApp::init ()
0000045 0x08c61594 in mainApp ()
0000046 0x08c61602 in main ()
(gdb)
TagsNo tags attached.
Patch

Relationships

duplicate of 0003209 closedh_a_j_s Python crashes constantly Scripter and documentation is wrong. 

Activities

2009-03-17 01:59

 

qtcrash.py (105 bytes)   
try:
    print "importing qt"
    import qt
    print "qt imported"
except:
    print "Cannot import qt"
qtcrash.py (105 bytes)   

jghali

2009-03-17 07:32

administrator   ~0021344

Duplicate. See issue 0003209

eob

2009-03-17 14:57

reporter   ~0021348

Hi,

Thanks for looking at this issue.

I don't think this is a duplicate of 3209, which seems to be a longstanding problem to do with running using PyQt in a non-extension script.

In contrast this bug is a problem, new in 1.3.5, of running PyQt in an extension script.

It seems to be a regression in 1.3.5 compared to 1.3.4 and 1.3.3. I believe PyQt would not crash those previous versions of Scribus when used in a startup extension script.

Let me know if there is any way I can help. I currently am building from source from the Subversion trunk. I am happy to re-build in debug mode and poke around in a debugger.

Thanks,
__
Eamonn

jghali

2009-03-17 15:50

administrator   ~0021349

1.3.5svn is based on Qt4, so i strongly doubt PyQt will work as bindings provided by PyQt are based on Qt2/Qt3 which are binary incompatible with Qt4. Be sure to use PyQt4 first.

jghali

2009-03-17 15:57

administrator   ~0021350

Sample PyQt4 script from PyQt4 tutorial (http://zetcode.com/tutorials/pyqt4/firstprograms/):

 #!/usr/bin/python

 # simple.py

 import sys
 from PyQt4 import QtGui

 app = QtGui.QApplication(sys.argv)

 widget = QtGui.QWidget()
 widget.resize(250, 150)
 widget.setWindowTitle('simple')
 widget.show()

 sys.exit(app.exec_())

eob

2009-03-17 20:56

reporter   ~0021352

Thanks. This gets me past my problem. I have been able to successfully use PyQt4 in a startup scripts.

subik

2009-03-23 07:58

manager   ~0021387

I'll add a note in the documentation.

cbradney

2009-03-23 13:26

administrator   ~0021388

subik, are we able to tell python to only load a certain version of pyqt? ie >=4

subik

2009-03-23 20:39

manager   ~0021390

note for myself: to study http://www.python.org/dev/peps/pep-0302/

plinnell

2010-12-13 15:14

viewer   ~0025116

As KDE3/Qt3 is not shipping in fewer and fewer distros, its not a major issue IMO.

Issue History

Date Modified Username Field Change
2009-03-17 01:59 eob New Issue
2009-03-17 01:59 eob File Added: qtcrash.py
2009-03-17 07:32 jghali Note Added: 0021344
2009-03-17 07:32 jghali Relationship added duplicate of 0003209
2009-03-17 07:32 jghali Duplicate ID 0 => 3209
2009-03-17 07:32 jghali Status new => resolved
2009-03-17 07:32 jghali Resolution open => duplicate
2009-03-17 07:32 jghali Assigned To => jghali
2009-03-17 07:32 jghali Status resolved => closed
2009-03-17 14:57 eob Note Added: 0021348
2009-03-17 14:57 eob Status closed => feedback
2009-03-17 14:57 eob Resolution duplicate => reopened
2009-03-17 15:50 jghali Note Added: 0021349
2009-03-17 15:57 jghali Note Added: 0021350
2009-03-17 20:56 eob Note Added: 0021352
2009-03-17 21:12 jghali Assigned To jghali =>
2009-03-23 07:58 subik Note Added: 0021387
2009-03-23 07:58 subik Assigned To => subik
2009-03-23 07:58 subik Projection none => minor fix
2009-03-23 07:58 subik ETA none => 2-3 days
2009-03-23 07:58 subik Target Version => 1.3.5svn
2009-03-23 13:26 cbradney Note Added: 0021388
2009-03-23 20:39 subik Note Added: 0021390
2010-12-13 15:06 plinnell Status feedback => resolved
2010-12-13 15:06 plinnell Resolution reopened => no change required
2010-12-13 15:14 plinnell Note Added: 0025116
2010-12-13 15:14 plinnell Status resolved => closed