#7486 HIGH 8.2.0 (: Sugar shell crashes when threads used.

Zarro Boogs per Child bugtracker at laptop.org
Sat Jul 12 03:50:23 EDT 2008


#7486: Sugar shell crashes when threads used.
--------------------+-------------------------------------------------------
 Reporter:  cscott  |         Owner:  marco                            
     Type:  defect  |        Status:  new                              
 Priority:  high    |     Milestone:  8.2.0 (was Update.2)             
Component:  sugar   |       Version:  Development build as of this date
 Keywords:          |   Next_action:  never set                        
 Verified:  0       |     Blockedby:                                   
 Blocking:          |  
--------------------+-------------------------------------------------------
 Sugar never calls gtk.gdk.threads_init(), so any attempt to use threads in
 code called by the sugar shell (control panel code in particular) causes
 sugar to crash -- python throws an assertion about its GILlock.

 The fix is very simple: in /usr/share/sugar/shell/main.py, right after:
 {{{
 pygtk.require('2.0')
 import gtk
 import gobject
 }}}
 add the line:
 {{{
 gtk.gdk.threads_init()
 }}}

 Voila! No more crashes.

 Found this bug while writing the 'activity update' sugar control panel,
 which uses threads to keep the UI responsive while it is
 doing network operations in the background to update activity
 version status.

-- 
Ticket URL: <http://dev.laptop.org/ticket/7486>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system


More information about the Bugs mailing list