Segmentation fault on Ubuntu 13.10 when using guiqwt

Bug #1249571 reported by Ningfei Li
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-qt4 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Ubuntu 13.10
Package: python-qt4 (4.10.3-1ubuntu1)
Package: python-sip (4.15.2-1ubuntu1)

In Python, when I tried "guiqwt.tests.run()" and ran any script with plot function in it, it would cause the segmentation fault. But when I revert python-qt4 adn python-sip to the version in Ubuntu 13.04: python-qt4 (4.10-0ubuntu3) ) and python-sip (4.14.5-0ubuntu1), everything works fine.

I traced the bug, found that: with new version of python-qt4 and python-sip, the guiqwt script will stuck there in this line: self.emit(SIG_PLOT_LABELS_CHANGED, self).

After googling it, I find this segfault problem also affect some other users/packages:
https://bbs.archlinux.org/viewtopic.php?id=168667
https://bugs.archlinux.org/task/36652

So this seems not a bug of python-guiqwt but a build problem with the python-qt4 and python-sip.

I tried to build latest snapshot version of PyQt and sip and install them locally. But this seg fault still exist.

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 1249571] [NEW] Segmentation fault on Ubuntu 13.10 when using guiqwt

Try rebuilding python-guiqwt. I think it will work then.

Revision history for this message
Ningfei Li (ningfei) wrote :

@Scott

Thanks for your reply!
Since python-guiqwt is almost a pure python package. I don't think a rebuilding will work. I had tried it and still got that segfault.

If you step into the code when you plot, you will find that the script stucks there at this line:
self.emit(SIG_PLOT_LABELS_CHANGED, self) in baseplot.py (in python-guiqwt directory). "self" here is a BasePlot class inherited from QwtPlot. And QwtPlot is imported as this : from PyQt4.Qwt5 import QwtPlot. I also tried to rebuild python-qwt5-qt4. But segfault again...

The signal SIG_PLOT_LABELS_CHANGED here is import from signal.py (also in python-guiqwt directory): SIG_PLOT_LABELS_CHANGED = SIGNAL('plot_labels_changed(PyQt_PyObject)').

The SIGNAL here is import via this: from guidata.qt.QtCore import SIGNAL. Here the python-guidata is also a pure python package, in which there exist a script QtCore.py with the following lines that might be related:
from PyQt4.QtCore import *
from PyQt4.QtCore import pyqtSignal as Signal

So that's why I think it can be a upstream problem with pyqt4...

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 1249571] Re: Segmentation fault on Ubuntu 13.10 when using guiqwt

OK. Thanks for the analysis. If you can extract a reduced test case that
demonstrates the problem, I'll send it upstream to see about a fix.

Revision history for this message
Ningfei Li (ningfei) wrote :

Hi Scott,

Thanks again for your quick reply! Here I can give a short test script to reproduce this problem (as in attachment).
It's basically a test case provided in guiqwt.tests (histogram.py).
During debugging, it will stucks at line 12: win = CurveDialog(edit=False, toolbar=True, wintitle="Histogram test")
Then you trace into it to plot.py, curve.py and then baseplot.py. Finally you will be here in baseplot.py: self.emit(SIG_PLOT_LABELS_CHANGED, self) in function: def update_axis_style(self, axis_id)

Package: python-qt4 (4.10.3-1ubuntu1)
Package: python-sip (4.15.2-1ubuntu1)

reverting to python-qt4 (4.10-0ubuntu3) ) and python-sip (4.14.5-0ubuntu1) then everything works fine.

Revision history for this message
Ningfei Li (ningfei) wrote :

Hi Scott,

I just find a fixed package here: https://bugs.launchpad.net/ubuntu/+source/pyqwt5/+bug/1243102 that solves my problem!
It seems it's a problem with python-qwt5-qt4 rather than python-qt4. At least my guiqwt package works fine now.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.