Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 151040 - DBUS Session breaks pygtk FileChooserDialog (Segfault)
Summary: DBUS Session breaks pygtk FileChooserDialog (Segfault)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-12 09:46 UTC by Alexander Rink
Modified: 2006-10-12 11:25 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Rink 2006-10-12 09:46:33 UTC
While tracking down a segfault problem in exaile we found that this little python script already segfaults when clicking on the button and works if the SessionBus line is commented out. 

<- CODE ->
#!/usr/bin/python
 
import pygtk, dbus
pygtk.require("2.0")
import gtk
 
session_bus = dbus.SessionBus()
 
frame = gtk.Window()
button = gtk.Button("click me")
frame.add(button)
 
def somefunction(widget):
    dialog = gtk.FileChooserDialog("Choose a file",
        frame, gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER,
        buttons=('Open', gtk.RESPONSE_OK, 'Cancel',
        gtk.RESPONSE_CANCEL))
    print dialog.run()
    dialog.destroy()
 
button.connect('clicked', somefunction)
 
frame.resize(100, 20)
frame.show_all()
 
gtk.main()
<- CODE ->

These are the versions I am using:
dev-lang/python-2.4.3-r4 
sys-apps/dbus-0.62-r1
dev-python/pygtk-2.10.1 
x11-libs/gtk+-2.10.6  

If any additional information are needed just drop me a short line
Comment 1 Alexander Rink 2006-10-12 11:20:50 UTC
Adding this solves the problem:

import pygtk, dbus, gobject, dbus.glib
gobject.threads_init()
dbus.glib.threads_init()
Comment 2 Mart Raudsepp gentoo-dev 2006-10-12 11:25:08 UTC
I believe a newer D-Bus will be less problematic when you don't init threads first.
See http://www.j5live.com/?p=246 and http://www.j5live.com/?p=252