[Bugs] #1123 UNSP: Sugar crashing when saving a journal entry upon closing an activity

SugarLabs Bugs bugtracker-noreply at sugarlabs.org
Thu Aug 27 18:20:19 EDT 2009


#1123: Sugar crashing when saving a journal entry upon closing an activity
------------------------------------------+---------------------------------
    Reporter:  sdz                        |          Owner:  alsroot    
        Type:  defect                     |         Status:  reopened   
    Priority:  Unspecified by Maintainer  |      Milestone:  0.86       
   Component:  sugar                      |        Version:  0.85.x     
    Severity:  Blocker                    |     Resolution:             
    Keywords:  r+                         |   Distribution:  Unspecified
Status_field:  New                        |  
------------------------------------------+---------------------------------
Changes (by benzea):

  * status:  closed => reopened
  * resolution:  fixed =>


Comment:

 Reopening for now.

 I have tried to reproduce a couple of time today (I removed the above
 patch for that, but don't think that is really relevant). So, I did get a
 backtrace with an X crash in the end which looks something like the
 following (sorry, no proper python bt):
 {{{
 -> X error here
 /home/benjamin/Projects/sugar-jhbuild/install/lib/python2.5/site-
 packages/sugar/wm.py (37): get_bundle_id
 /home/benjamin/Projects/sugar-jhbuild/install/lib/python2.5/site-
 packages/jarabe/model/shell.py (196): get_type
 /home/benjamin/Projects/sugar-jhbuild/install/lib/python2.5/site-
 packages/jarabe/model/shell.py (200): is_journal
 /home/benjamin/Projects/sugar-jhbuild/install/lib/python2.5/site-
 packages/jarabe/view/buddymenu.py (125): _update_invite_menu
 /home/benjamin/Projects/sugar-jhbuild/install/lib/python2.5/site-
 packages/jarabe/view/buddymenu.py (79): _add_buddy_items
 /home/benjamin/Projects/sugar-jhbuild/install/lib/python2.5/site-
 packages/jarabe/view/buddymenu.py (51): __init__
 /home/benjamin/Projects/sugar-jhbuild/install/lib/python2.5/site-
 packages/jarabe/view/buddyicon.py (33): __init__
 /home/benjamin/Projects/sugar-jhbuild/install/lib/python2.5/site-
 packages/jarabe/desktop/meshbox.py (810): _add_alone_buddy
 /home/benjamin/Projects/sugar-jhbuild/install/lib/python2.5/site-
 packages/jarabe/desktop/meshbox.py (791): _buddy_added_cb
 /home/benjamin/Projects/sugar-jhbuild/install/lib/python2.5/site-
 packages/jarabe/model/neighborhood.py (218): _buddy_appeared_cb
 /home/benjamin/Projects/sugar-jhbuild/install/lib/python2.5/site-
 packages/sugar/presence/presenceservice.py (204):
 _emit_buddy_appeared_signal
 -> idle callback handler here
 }}}

 So, what seems to happen is that sugar tries to query the activity boundle
 of a destroyed X window here. It looks like a very hard to hit race
 condition here, but it can happen. I'll attach a patch that should work
 around this (though I have never been able to see a backtrace or even get
 a crash after I applied it).

 The race condition would be:
  1. Activity is closed
  2. Buddy appears; idle handler registered
  3. idle handler _emit_buddy_appeared_signal starts running (sugar-session
 main loop is blocked)
  4. Activities X window is destroyed (sugar-session does not recieve the X
 event as the main loop blocked)
  5. sugar-session rebuilds the invite menu (_update_invite_menu)
  6. sugar-session tries to get a property of the destroyed window
  7. sugar will/would be notified that the window disappeared and the
 activity is not the active one anymore

-- 
Ticket URL: <http://dev.sugarlabs.org/ticket/1123#comment:12>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list