FS#33544 - [eric4] segmentation fault on startup

Attached to Project: Arch Linux
Opened by Pavel (nyshtyak) - Thursday, 24 January 2013, 11:11 GMT
Last edited by Ray Rashif (schivmeister) - Sunday, 17 February 2013, 19:59 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Ray Rashif (schivmeister)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

Description:
eric4 (as well as eric5) application cannot start and produces segfault.

Additional info:
* package version(s):
extra/eric4 4.5.8-1
extra/python2-qscintilla 2.7-1

* config and/or log files etc.


Steps to reproduce:
1. Install eric4 package:
#pacman -S eric4
2. Run eric4:
$eric4
=>Segmentation fault (core dumped)


Sorry, I cannot attach core dump as I cannot find it in my file system. Putting strace in attachment instead. Hope this will help.
This task depends upon

Closed by  Ray Rashif (schivmeister)
Sunday, 17 February 2013, 19:59 GMT
Reason for closing:  Fixed
Additional comments about closing:  4.5.8-2
Comment by Eric (gnarly) - Thursday, 24 January 2013, 14:11 GMT
Have you tried to download the software directly from the authors website and run it then?

http://eric-ide.python-projects.org/eric-download.html
Comment by Pavel (nyshtyak) - Thursday, 24 January 2013, 14:20 GMT
You are right. Same behaviour with downloaded package. So I guess problem is in upstream.
Comment by Eric (gnarly) - Thursday, 24 January 2013, 16:51 GMT
Most likely some config on your machine.
Comment by Felix Yan (felixonmars) - Monday, 28 January 2013, 13:58 GMT
Downgrading qtwebkit to 2.2.2-1 solved it here, any 2.3* version would segfault as well.
Comment by Ray Rashif (schivmeister) - Monday, 28 January 2013, 13:59 GMT
Problem is in some kind of incompatibility with our software; upstream may have to update their codebase. I am still not up-to-date for several weeks and I cannot reproduce this. So the question is which (library) update. I'll take a look at the trace.

edit: So it's qtwebkit, thanks Felix :)
Comment by Pavel (nyshtyak) - Monday, 28 January 2013, 14:20 GMT
So, waiting while upstream fixing incompatibility with qtwebkit 2.3, right? Have anyone opened ticket in eric's bugtracker at the moment?
Comment by Ray Rashif (schivmeister) - Monday, 28 January 2013, 14:40 GMT
To make matters worse, the qtwebkit version we have is not a stable one (2.2.x was not building according to Andrea's commit log). As such, I don't know if upstream would entertain a bug report right now, but it's worth a try.
Comment by Felix Yan (felixonmars) - Monday, 28 January 2013, 14:54 GMT
Just a FYI, eric5 (package eric) crashes here too.
Comment by Felix Yan (felixonmars) - Monday, 28 January 2013, 15:01 GMT
Hi, I've made some progress, the following one got segfault here:

$ python -c "from PyQt4.QtWebKit import QWebSettings; QWebSettings.globalSettings()"
Segmentation fault (core dumped)

So this should be a purely(?) qtwebkit/pyqt bug. I've tried rebuild pyqt with latest qtwebkit but no luck.
Comment by Yichao Yu (yuyichao) - Monday, 28 January 2013, 15:10 GMT
Not really. PyQt can crash if you are not using it correctly due to the difference between c++(qobject) and python(object) (which may or may not considered a bug for a python module...) (e.g. haven't set correct parent on some objects and, in this case, haven't create a QApplication before you use any Qt api's.)

The following code runs without any segfault.

python -c "from PyQt4.Qt import *; app = QApplication([]); from PyQt4.QtWebKit import QWebSettings; a = QWebSettings.globalSettings(); print(3)"
Comment by Felix Yan (felixonmars) - Monday, 28 January 2013, 15:16 GMT
@yuyichao
Eric called QWebSettings.globalSettings() before creating a QApplication() (in class declaration) just as my snippet of code did. This does not crash when using qtwebkit 2.2.2-1, but segfaults with 2.3*.

Dunno who takes the responsibility though, got an idea?
Comment by Felix Yan (felixonmars) - Monday, 28 January 2013, 15:32 GMT
I've made a patch for eric5, a dirty hack but works, thanks to @yuyichao :)
Comment by Ray Rashif (schivmeister) - Sunday, 10 February 2013, 16:34 GMT
  • Field changed: Summary ([eric][eric4] segmentation fault on startup → [eric4] segmentation fault on startup)
Hey guys, the eric5 update has fixed itself (not sure if there has been related reports or patches upstream). Please check it out directly from extra. Now it's just eric4.
Comment by Ray Rashif (schivmeister) - Thursday, 14 February 2013, 13:13 GMT
So it looks like anything that calls Preferences will bail because of this. Rather than patching out the entire source base to not load preferences, I vote for just downgrading and holding qtwebkit if this program is critical to your productivity.

Yichao is right that this problem occurs when the QWebSettings method or object is called or initiated inappropriately. You can reproduce this for both Python 2 and 3:

from PyQt4.QtWebKit import QWebSettings
a = QWebSettings.globalSettings()

Patching the program to insert an object instance is not appropriate since it breaks the flow of code and may unintentionally cause other problems that may first go unnoticed, so I will not apply such a patch pending upstream acceptance or acknowledgement (but you can do so at your own discretion).

Anyway, filed the upstream ticket: http://die-offenbachs.homelinux.org:48888/issues/issue81
Comment by Ray Rashif (schivmeister) - Sunday, 17 February 2013, 18:27 GMT
Fixed by defining the web settings as a class method (backport of new code in eric5 for qt5 compat, see [1]). Don't think there'll be any release, so I'll be applying the patch verbatim from eric4 svn changeset r4420:4421.

[1] http://die-offenbachs.homelinux.org:48888/hg/eric5/rev/d041f6bcda5c

Loading...