Segmentation fault when starting GMusic Player

Bug #823468 reported by Christoph Langner
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
GMusic
Fix Committed
Medium
Chris Case

Bug Description

Hello, i'm running Ubuntu Natty here. When I try to start your program, I get an segmentation fault

$ bzr clone http://dev.skewedaspect.com/bzr/gmusic/trunk
$ cd trunk
$ ./gmusic.py
No handlers could be found for logger "Qt"
/usr/lib/pymodules/python2.7/gtk-2.0/gtk/__init__.py:127: RuntimeWarning: PyOS_InputHook is not available for interactive use of PyGTK
  set_interactive(1)
./logging.conf
[INFO ] gmusic: Welcome to GMusic v0.2.0
[INFO ] gmusic.remote: Initializing GMain Remote Control support...
[DEBUG ] gmusic.main: Creating widgets
Creating new NetworkAccessManager.
Making new shiny NetworkCookieJar.
Speicherzugriffsfehler

Thanks
Christoph

Revision history for this message
Chris Case (morgul) wrote :

Are you using PyQt4 or PySide, and which version?

(In theory, PyQt should be supported, but it's had limited testing.)

It's very interesting that it's a segfault; as this is all python code, that tells me it must be an issue with the Qt bindings.

I'll give it a shot on natty with PyQt, and see if it segfaults for me.
--Chris

Revision history for this message
Chris Case (morgul) wrote :

This needs to be confirmed on Ubuntu Natty.

Changed in gmusic-player:
assignee: nobody → Chris Case (morgul)
importance: Undecided → High
Revision history for this message
Christoph Langner (chrissss) wrote :

I've got PyQt4 4.8.3-2 here...

$ dpkg -l python-qt4 | grep ii
ii python-qt4 4.8.3-2 Python bindings for Qt4
$ dpkg -l python-pyside | grep ii
Kein Paket gefunden, das auf python-pyside passt.

Revision history for this message
Chris Case (morgul) wrote :

If you install pyside, I'll bet it just works.

(I haven't had time to confirm issues in PyQt yet.)

$ sudo apt-get install python-pyside

(If you'd rather not install pyside, and just wait for PyQt support to be fixed, I should be able to look into this this evening.)

--Chris

Revision history for this message
Christoph Langner (chrissss) wrote :

Yep, after installing python-pyside it starts.

Revision history for this message
Chris Case (morgul) wrote :

This appears to be a 'bug' in PyQt4 4.7.2 and up. From the mailinglist, it's not actually a bug, rather, an unspecified requirement. (There are reasons I prefer PySide. *sigh*)

Here's the bug report and response:
http://www.riverbankcomputing.com/pipermail/pyqt/2010-May/026591.html

I'm going to see how difficult it is to make the change, and ensure it doesn't break things on PySide. Meanwhile, I've just committed code that allows you to specify which qt bindings to use:

./gmusic.py --PyQt4
./gmusic.py --PySide

That should help with debugging this.

--Chris

Changed in gmusic-player:
status: New → Confirmed
Revision history for this message
Chris Case (morgul) wrote :

It was as simple as setting the parent of the NetworkAccessManager. However, a few other bugs have become evident, therefore, I'm going to keep this bug open until the application runs appropriately.

Changed in gmusic-player:
status: Confirmed → In Progress
Revision history for this message
Chris Case (morgul) wrote :

r28 has a fix for all issues I discovered while testing under PyQt. The segfault is fixed, as is some broken behavior with notifications.

Please pull the latest, and try with:

$./gmusic.py --PyQt4

Let me know if that works for you.

Changed in gmusic-player:
status: In Progress → Fix Committed
Revision history for this message
Christoph Langner (chrissss) wrote :

Now I get a crash right after loggin into Google Music...

$ ./gmusic.py --PyQt4
No handlers could be found for logger "Qt"
/usr/lib/pymodules/python2.7/gtk-2.0/gtk/__init__.py:127: RuntimeWarning: PyOS_InputHook is not available for interactive use of PyGTK
  set_interactive(1)
[INFO ] gmusic: Welcome to GMusic v0.2.0
[INFO ] gmusic.remote: Initializing GMain Remote Control support...
[DEBUG ] gmusic.main: Creating widgets
Making new shiny NetworkCookieJar.
[DEBUG ] gmusic.playerpage: Loading plugins.
/tmp/trunk/resources
[WARNING ] gmusic.remote: Failed to start local server. Error: QLocalServer::listen: Address in use
[DEBUG ] gmusic.main: Showing tray icon
[DEBUG ] gmusic.playerpage: Getting dict of playlists
[DEBUG ] gmusic.playerpage: Getting dict of playlists
/build/buildd/icedtea-web-1.1.1/build/../plugin/icedteanp/IcedTeaNPPlugin.cc:2020: thread 0x1d65700: Error: Invalid plugin function table.
No bp log location saved, using default.
[000:001] Browser XEmbed support present: 1
[000:001] Browser toolkit is not Gtk2 (0).
[000:001] Using Xt toolkit
** (gmusic.py:1375): DEBUG: NP_Initialize
** (gmusic.py:1375): DEBUG: NP_Initialize succeeded
** (gmusic.py:1375): DEBUG: NP_Initialize
** (gmusic.py:1375): DEBUG: NP_Initialize succeeded
** (gmusic.py:1375): DEBUG: NP_Initialize
** (gmusic.py:1375): DEBUG: NP_Initialize succeeded
** (gmusic.py:1375): DEBUG: NP_Initialize
** (gmusic.py:1375): DEBUG: NP_Initialize succeeded
** (gmusic.py:1375): DEBUG: NP_Shutdown
[DEBUG ] gmusic.playerpage: Getting dict of playlists
Speicherzugriffsfehler

Revision history for this message
Chris Case (morgul) wrote :

I'm unable to reproduce that crash on kubuntu. I don't have access to an ubuntu machine atm; I'll have to try on another machine, and see if I can reproduce the new crash. For now, PySide is the recommended toolkit to use. (I had no idea PyQt support was going to be this problematic.)

Changed in gmusic-player:
importance: High → Medium
status: Fix Committed → Incomplete
Revision history for this message
Alin Andrei (nilarimogard) wrote :

I can confirm that it crashes with a segmentation fault after trying to log in for me too. I'm running Ubuntu 11.04 32bit.

Revision history for this message
Jiří Janoušek (fenryxo) wrote :

I can also confirm SIGSEGV after logging in. Revision 33, Ubuntu 11.04 32bit, pyside 1.0.1-1ubuntu0.1. Output:

$./gmusic.py --PySide
[INFO ] gmusic: Welcome to GMusic v0.2.0
[INFO ] gmusic.remote: Initializing GMain Remote Control support...
[DEBUG ] gmusic.main: Creating widgets
Making new shiny NetworkCookieJar.
[DEBUG ] gmusic.playerpage: Loading plugins.
[WARNING ] gmusic.remote: Failed to start local server. Error: QLocalServer::listen: Address in use
[INFO ] gmusic.remote: Removing socket file.
[INFO ] gmusic.remote: Retrying local server connection...
[INFO ] gmusic.remote: Local server started successfully.
[DEBUG ] gmusic.main: Showing tray icon
[DEBUG ] gmusic.playerpage: Getting dict of playlists
[DEBUG ] gmusic.playerpage: Getting dict of playlists
No bp log location saved, using default.
[000:001] Browser XEmbed support present: 1
[000:001] Browser toolkit is not Gtk2 (0).
[000:001] Using Xt toolkit
** (gmusic.py:30469): DEBUG: NP_Initialize
** (gmusic.py:30469): DEBUG: NP_Initialize succeeded
** (gmusic.py:30469): DEBUG: NP_Initialize
** (gmusic.py:30469): DEBUG: NP_Initialize succeeded
** (gmusic.py:30469): DEBUG: NP_Initialize
** (gmusic.py:30469): DEBUG: NP_Initialize succeeded
/build/buildd/icedtea-web-1.1.1/build/../plugin/icedteanp/IcedTeaNPPlugin.cc:2020: thread 0xa313118: Error: Invalid plugin function table.
** (gmusic.py:30469): DEBUG: NP_Initialize
** (gmusic.py:30469): DEBUG: NP_Initialize succeeded
[DEBUG ] gmusic.playerpage: Getting dict of playlists
Neoprávněný přístup do paměti (SIGSEGV)

Revision history for this message
Chris Case (morgul) wrote :

Do you get the same segfault if you run without specifying --PySide? Also, do you get the segfault if you run with --PyQt4?

As far as I was aware, this segfault was PyQt4 specific. (And I still remain unable to reproduce it on any of my ubuntu machines.)

I'll look into changing the network manager implementation, and see if that solves the problem.

Revision history for this message
Alin Andrei (nilarimogard) wrote :

I get the segfault both with and without --PySide or --PyQt4. Here is the output when running it with --PyQt4:

./gmusic.py --PyQt4
No handlers could be found for logger "Qt"
/usr/lib/pymodules/python2.7/gtk-2.0/gtk/__init__.py:127: RuntimeWarning: PyOS_InputHook is not available for interactive use of PyGTK
  set_interactive(1)
[INFO ] gmusic: Welcome to GMusic v0.2.0
[INFO ] gmusic.remote: Initializing GMain Remote Control support...
[DEBUG ] gmusic.main: Creating widgets
Making new shiny NetworkCookieJar.
[DEBUG ] gmusic.playerpage: Loading plugins.
[WARNING ] gmusic.remote: Failed to start local server. Error: QLocalServer::listen: Address in use
[INFO ] gmusic.remote: Removing socket file.
[INFO ] gmusic.remote: Retrying local server connection...
[INFO ] gmusic.remote: Local server started successfully.
[DEBUG ] gmusic.main: Showing tray icon
[DEBUG ] gmusic.playerpage: Getting dict of playlists
No bp log location saved, using default.
[000:001] Browser XEmbed support present: 1
[000:001] Browser toolkit is not Gtk2 (0).
[000:001] Using Xt toolkit
** (gmusic.py:27831): DEBUG: NP_Initialize
** (gmusic.py:27831): DEBUG: NP_Initialize succeeded
Failed to open debug file '/home/andrei/tmp/mozdebug'
** (gmusic.py:27831): DEBUG: NP_Initialize
** (gmusic.py:27831): DEBUG: NP_Initialize succeeded
** (gmusic.py:27831): DEBUG: NP_Initialize
** (gmusic.py:27831): DEBUG: NP_Initialize succeeded
/build/buildd/icedtea-web-1.1.1/build/../plugin/icedteanp/IcedTeaNPPlugin.cc:2020: thread 0x9e93538: Error: Invalid plugin function table.
** (gmusic.py:27831): DEBUG: NP_Initialize
** (gmusic.py:27831): DEBUG: NP_Initialize succeeded
[DEBUG ] gmusic.playerpage: Getting dict of playlists
[DEBUG ] gmusic.playerpage: Getting dict of playlists
Segmentation fault

Revision history for this message
Chris Case (morgul) wrote :

Alright. The latest code has some minor fixes to the Qt module, but those shouldn't be related to the issue.

If you could run it in gdb or catchsegv, and send the backtrace, that would be very helpful.

All you should need to do is:

$sudo apt-get install gdb
...
$ gdb python
(gdb) r ./gmusic.py
...
(gdb) bt full

Please send a bt for both pyside and pyqt4. Thanks!

Revision history for this message
Alin Andrei (nilarimogard) wrote :

OK, see the attached files. I hope I did this right, I don't have any experience with gdb.

Revision history for this message
Alin Andrei (nilarimogard) wrote :

Attaching backtrace for pyside too

Revision history for this message
Chris Case (morgul) wrote :

Perfect. That's exactly what I was looking for.

The problem seems to be a segfault caused in flash. Can you tell me what version of flash you're running, and how you installed it? It seems to be getting flash from the .mozilla folder in your home directory... Unfortunately, I'm not sure how to control Webkit's plugin search path...

I wonder, have you installed "flashplugin-installer" or "flashplugin-nonfree"? Try installing those (one installs the other, and I don't remember which is which) and see if that solves your problem.

I may have to open a bug with QtWebkit...

Revision history for this message
Alin Andrei (nilarimogard) wrote :

That was Flash 11 beta 2. But I've tried with Flash from the Ubuntu repositories too and it still crashes.

Revision history for this message
Chris Case (morgul) wrote :

I was able to reproduce the segfault under flash 11. It turns out that flash 11 and QtWebKit don't properly initialize gobject's threads, which causes the crash. Unfortunately, this fix introduces a segfault on exit under PySide. I will investigate that more, but it seems acceptable, in order to allow Flash 11 support.

It should be noted that from my research, it seems that this should fix the problem with flash 10 as well, on some systems.

If you could give it a shot, and report back, that would be wonderful.

Changed in gmusic-player:
status: Incomplete → Fix Committed
Revision history for this message
Alin Andrei (nilarimogard) wrote :

Unfortunately using the latest code, it still crashes both using PySide and PyQt4.

Revision history for this message
Chris Case (morgul) wrote :

What revision are you at? Launchpad hasn't synced the repository yet; it's still on revision 37. r38 is the revision I checked the fix into.

As a way to double, if you check classes/playerwindow.py, you should see a comment that starts with "XXX: Hack..." If you don't have that, it's not the latest revision.

If, however, it's still crashing on r38, if you could send me another backtrace? (I only need Pyside or PyQt, not both.)

Revision history for this message
Alin Andrei (nilarimogard) wrote :

Indeed, I was running rev37. After getting the latest code via http://dev.skewedaspect.com/bzr/gmusic/trunk , it works. So fixed confirmed. Thank you!

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.