Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

enlightenment bug

By: a guest on Sep 9th, 2011  |  syntax: C++  |  size: 12.85 KB  |  views: 46  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. So I've been chasing this one a while... happens when I raise certain Java/Swing windows... For some reason this always blows e out of the water rather than invoking the white-box abend handler, dunno why.
  2.  
  3. Program received signal SIGSEGV, Segmentation fault.
  4. 0x080848c9 in eina_list_data_get (list=0x28) at /Development/Programs/e17/build/include/eina-1/eina/eina_inline_list.x:47
  5. 47         return list->data;
  6. (gdb) bt
  7. #0  0x080848c9 in eina_list_data_get (list=0x28) at /Development/Programs/e17/build/include/eina-1/eina/eina_inline_list.x:47
  8. #1  0x08088542 in e_border_raise (bd=0x98d3188) at e_border.c:1636
  9. #2  0x080e54f0 in _e_focus_raise_timer (data=0x98d3188) at e_focus.c:200
  10. #3  0xb7708e5c in _ecore_call_task_cb (func=0x80e54c8 <_e_focus_raise_timer>, data=0x98d3188) at ecore_private.h:246
  11. #4  0xb770a06e in _ecore_timer_expired_call (when=1244.7803629980001) at ecore_timer.c:731
  12. #5  0xb7709f00 in _ecore_timer_expired_timers_call (when=1244.7803629980001) at ecore_timer.c:685
  13. #6  0xb77071a6 in _ecore_main_loop_iterate_internal (once_only=0) at ecore_main.c:1683
  14. #7  0xb7705b78 in ecore_main_loop_begin () at ecore_main.c:861
  15. #8  0x08073329 in main (argc=1, argv=0xbfbc94d4) at e_main.c:945
  16.  
  17. (gdb) print list
  18. $1 = (const Eina_List *) 0x28
  19. (gdb) list
  20. 42
  21. 43      static inline void *
  22. 44      eina_list_data_get(const Eina_List *list)
  23. 45      {
  24. 46         if (!list) return NULL;
  25. 47         return list->data;
  26. 48      }
  27.  
  28. (gdb) up
  29. #1  0x08088542 in e_border_raise (bd=0x98d3188) at e_border.c:1636
  30. 1636            EINA_LIST_REVERSE_FOREACH(bd->transients, l, child)
  31. (gdb) list
  32. 1622    EAPI void
  33. 1623    e_border_raise(E_Border *bd)
  34. 1624    {
  35. 1625       E_Event_Border_Stack *ev;
  36. 1626       E_Border *last = NULL, *child;
  37. 1627       Eina_List *l;
  38. 1628
  39. 1629       E_OBJECT_CHECK(bd);
  40. 1630       E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE);
  41. 1631
  42. 1632       ecore_x_window_shadow_tree_flush();
  43. 1633
  44. 1634       if (e_config->transient.raise)
  45. 1635         {
  46. 1636            EINA_LIST_REVERSE_FOREACH(bd->transients, l, child)
  47. 1637            {
  48. 1638               /* Don't stack iconic transients. If the user wants these shown,
  49. 1639                * thats another option.
  50. 1640                */
  51. (gdb) print l
  52. $2 = (Eina_List *) 0x28
  53. (gdb) print bd->transients
  54. $3 = (Eina_List *) 0xb74523f0
  55. (gdb) print child
  56. $4 = (E_Border *) 0x1175
  57.  
  58. Looks like someone forgot to initialise their variable:
  59. e/src/bin/e_border.c:
  60. 1627       Eina_List *l;
  61. tsk, tsk, tsk.
  62.  
  63. Or maybe not... EINA_LIST_REVERSE_FOREACH does more than I thought (I occasionally hate macros).
  64.  
  65. (aside, eina_list_data_get can return NULL, if that happens e_border_raise will go boom)
  66.  
  67. looks like one of the entries in bd->transients is duff, let's have a butchers at that then:
  68. (gdb) print bd
  69. $7 = (E_Border *) 0x98d3188
  70. (gdb) print bd->transients
  71. $8 = (Eina_List *) 0xb74523f0
  72. (gdb) print *bd->transients
  73. $9 = {data = 0xa733180, next = 0x985e278, prev = 0x9822f20, accounting = 0x9822f20, __magic = 159441632}
  74. (gdb) print *bd->transients->prev
  75. $10 = {data = 0x28, next = 0x409, prev = 0xb74523f0, accounting = 0xb74523f0, __magic = 0}
  76. (gdb) print *bd->transients->prev->prev
  77. $11 = {data = 0xa733180, next = 0x985e278, prev = 0x9822f20, accounting = 0x9822f20, __magic = 159441632}
  78. (gdb) print *bd->transients->prev->prev->prev
  79. $12 = {data = 0x28, next = 0x409, prev = 0xb74523f0, accounting = 0xb74523f0, __magic = 0}
  80. (gdb) print *bd->transients->prev->prev->prev->prev
  81. $13 = {data = 0xa733180, next = 0x985e278, prev = 0x9822f20, accounting = 0x9822f20, __magic = 159441632}
  82. (gdb) print *bd->transients->prev->prev->prev->prev->prev
  83. $14 = {data = 0x28, next = 0x409, prev = 0xb74523f0, accounting = 0xb74523f0, __magic = 0}
  84. (gdb) print *bd->transients->prev->prev->prev->prev->prev->prev
  85. $15 = {data = 0xa733180, next = 0x985e278, prev = 0x9822f20, accounting = 0x9822f20, __magic = 159441632}
  86. (gdb) print *bd->transients->prev->prev->prev->prev->prev->prev->prev
  87. $16 = {data = 0x28, next = 0x409, prev = 0xb74523f0, accounting = 0xb74523f0, __magic = 0}
  88. (gdb) print *bd->transients->next
  89. $17 = {data = 0x9814bf8, next = 0x19, prev = 0x985e800, accounting = 0x97fde68, __magic = 1348927604}
  90. (gdb) print *bd->transients->next->next
  91. Cannot access memory at address 0x19
  92.  
  93. hmmm, that's not a pretty list! Infinite loop in the reverse and a guaranteed segfault going forward, lovely.
  94.  
  95. Who gave us this list then?
  96. (gdb) print *bd
  97. $20 = {e_obj_inherit = {magic = -1220205016, type = 159377376, references = 159377376, del_func = 0x97fe7e0,
  98.     cleanup_func = 0x98cfe48, free_att_func = 0x98d6458, del_att_func = 0x98d10e0, del_fn_list = 0x97f4600, data = 0x983d4d8,
  99.     walking_list = 0, deleted = 1 '\001'}, mouse = {current = {x = 0, y = 0, w = 0, h = 0, mx = 563, my = 239}, last_down = {{
  100.         x = 1162, y = 227, w = 797, h = 1200, mx = 1267, my = 402}, {x = 0, y = 0, w = 0, h = 0, mx = 0, my = 0}, {x = 0, y = 0,
  101.         w = 0, h = 0, mx = 0, my = 0}}, last_up = {{x = 46, y = 64, w = 0, h = 0, mx = 151, my = 239}, {x = 0, y = 0, w = 0,
  102.         h = 0, mx = 0, my = 0}, {x = 0, y = 0, w = 0, h = 0, mx = 0, my = 0}}}, moveinfo = {down = {x = 0, y = 0, w = 0, h = 0,
  103.       mx = 1267, my = 402, button = 1}}, win = 8409539, x = 46, y = 64, w = 797, h = 1200, ref = 0, zone = 0x0, desk = 0x996b0a0,
  104.   handlers = 0x0, fx = {x = 0, y = 0, start = {x = 0, y = 0, t = 0}}, client_inset = {l = 0, r = 0, t = 27, b = 4},
  105.   bg_ecore_evas = 0xa46b308, bg_evas = 0x97d6dc8, bg_win = 8409540, bg_object = 0xa6d0f90, icon_object = 0xa6d6fd0,
  106.   event_win = 8409544, internal_icon = 0x0, internal_icon_key = 0x0, client = {shell_win = 8409545, win = 37748796, x = 0, y = 0,
  107.     w = 797, h = 1169, border = {changed = 0 '\000', user_selected = 0 '\000', name = 0x97ab878 "default"}, shaped = 0 '\000',
  108.     argb = 0 '\000', icccm = {title = 0x0, name = 0x98142c0 "sun-awt-X11-XFramePeer",
  109.       class = 0x97a9d90 "com-ibm-sdwb-cmvc-client-dc-CMVC", icon_name = 0x0, machine = 0x0, min_w = 0, min_h = 0, max_w = 32767,
  110.       max_h = 32767, base_w = -1, base_h = -1, step_w = -1, step_h = -1, start_x = 0, start_y = 0, min_aspect = 0, max_aspect = 0,
  111.       initial_state = ECORE_X_WINDOW_STATE_HINT_NORMAL, state = ECORE_X_WINDOW_STATE_HINT_WITHDRAWN, icon_pixmap = 0,
  112.       icon_mask = 0, icon_window = 0, window_group = 0, transient_for = 0, client_leader = 37748744, gravity = ECORE_X_GRAVITY_NW,
  113.       window_role = 0x0, take_focus = 1 '\001', accepts_focus = 0 '\000', urgent = 0 '\000', delete_request = 1 '\001',
  114.       request_pos = 1 '\001', command = {argc = 0, argv = 0x0}, fetch = {title = 0 '\000', name_class = 0 '\000',
  115.         icon_name = 0 '\000', machine = 0 '\000', hints = 1 '\001', size_pos_hints = 0 '\000', protocol = 0 '\000',
  116.         transient_for = 0 '\000', client_leader = 0 '\000', window_role = 0 '\000', state = 0 '\000', command = 0 '\000'}}, mwm = {
  117.       func = ECORE_X_MWM_HINT_FUNC_ALL, decor = ECORE_X_MWM_HINT_DECOR_ALL, input = ECORE_X_MWM_HINT_INPUT_MODELESS,
  118.       exists = 1 '\001', borderless = 0 '\000', fetch = {hints = 0 '\000'}}, netwm = {pid = -1, desktop = 0, name = 0x989da20 "",
  119.       icon_name = 0x989da20 "", icons = 0x98cf320, num_icons = 1, user_time = 0, strut = {left = 0, right = 0, top = 0,
  120.         bottom = 0, left_start_y = 0, left_end_y = 0, right_start_y = 0, right_end_y = 0, top_start_x = 0, top_end_x = 0,
  121.         bottom_start_x = 0, bottom_end_x = 0}, ping = 0 '\000', sync = {request = 0 '\000', wait = 0, alarm = 0, counter = 0,
  122.         serial = 0, send_time = 0}, state = {modal = 0 '\000', sticky = 0 '\000', maximized_v = 0 '\000', maximized_h = 0 '\000',
  123.         shaded = 0 '\000', skip_taskbar = 0 '\000', skip_pager = 0 '\000', hidden = 0 '\000', fullscreen = 0 '\000',
  124.         stacking = E_STACKING_NONE}, action = {move = 0 '\000', resize = 0 '\000', minimize = 0 '\000', shade = 0 '\000',
  125.         stick = 0 '\000', maximized_h = 0 '\000', maximized_v = 0 '\000', fullscreen = 0 '\000', change_desktop = 0 '\000',
  126.         close = 0 '\000'}, type = ECORE_X_WINDOW_TYPE_UNKNOWN, extra_types = 0x0, extra_types_num = 0, startup_id = 0, fetch = {
  127.         name = 0 '\000', icon_name = 0 '\000', icon = 0 '\000', user_time = 0 '\000', strut = 0 '\000', type = 0 '\000',
  128.         state = 0 '\000'}, update = {state = 0 '\000'}}, e = {state = {centered = 0 '\000'}, fetch = {state = 0 '\000'}},
  129.     qtopia = {fetch = {soft_menu = 0 '\000', soft_menus = 0 '\000'}, soft_menu = 0 '\000', soft_menus = 0 '\000'}, vkbd = {
  130.       fetch = {state = 0 '\000', vkbd = 0 '\000'}, state = ECORE_X_VIRTUAL_KEYBOARD_STATE_UNKNOWN, vkbd = 0 '\000'}, illume = {
  131.       conformant = {fetch = {conformant = 0 '\000'}, conformant = 0 '\000'}, quickpanel = {fetch = {state = 0 '\000', priority = {
  132.             major = 0, minor = 0}, quickpanel = 0 '\000', zone = 0 '\000'}, state = ECORE_X_ILLUME_QUICKPANEL_STATE_UNKNOWN,
  133.         priority = {major = 0, minor = 0}, quickpanel = 0 '\000', zone = 0}, drag = {fetch = {drag = 0 '\000', locked = 0 '\000'},
  134.         drag = 0 '\000', locked = 0 '\000'}}, initial_attributes = {root = 214, x = 1162, y = 200, w = 797, h = 1169, border = 0,
  135.       depth = 24, visible = 0 '\000', viewable = 0 '\000', override = 0 '\000', input_only = 0 '\000', save_under = 0 '\000',
  136.       event_mask = {mine = 15400960, all = 32219260, no_propagate = ECORE_X_EVENT_MASK_NONE}, window_gravity = ECORE_X_GRAVITY_NW,
  137.       pixel_gravity = ECORE_X_GRAVITY_NW, colormap = 32, visual = 0x9763a20}}, shape = 0x98207d8, visible = 0,
  138.   await_hide_event = 0, moving = 0, focused = 0, new_client = 0, re_manage = 0, placed = 1, shading = 0, shaded = 0, iconic = 0,
  139.   deskshow = 0, sticky = 0, shaped = 0, shaped_input = 0, need_shape_merge = 0, need_shape_export = 0, fullscreen = 0,
  140.   need_fullscreen = 0, already_unparented = 1, need_reparent = 0, button_grabbed = 0, delete_requested = 0, ping_ok = 0, hung = 0,
  141.   take_focus = 0, want_focus = 0, user_skip_winlist = 0, need_maximize = 0, maximized = E_MAXIMIZE_NONE, borderless = 0,
  142.   offer_resistance = 1 '\001', bordername = 0x0, lock_user_location = 0, lock_client_location = 0, lock_user_size = 0,
  143.   lock_client_size = 0, lock_user_stacking = 0, lock_client_stacking = 0, lock_user_iconify = 0, lock_client_iconify = 0,
  144.   lock_user_desk = 0, lock_client_desk = 0, lock_user_sticky = 0, lock_client_sticky = 0, lock_user_shade = 0,
  145.   lock_client_shade = 0, lock_user_maximize = 0, lock_client_maximize = 0, lock_user_fullscreen = 0, lock_client_fullscreen = 0,
  146.   lock_border = 0, lock_close = 0, lock_focus_in = 0, lock_focus_out = 0, lock_life = 0, internal = 0, internal_no_remember = 0,
  147.   stolen = 0, internal_ecore_evas = 0x0, ping = 0, changed = 0 '\000', icon_preference = 0 '\000', ignore_first_unmap = 0 '\000',
  148.   resize_mode = 11 '\v', saved = {x = 0, y = 0, w = 0, h = 0, layer = 100, zone = 0, maximized = E_MAXIMIZE_NONE},
  149.   pre_res_change = {valid = 0 '\000', x = 0, y = 0, w = 0, h = 0, saved = {x = 0, y = 0, w = 0, h = 0}}, shade = {start = 0,
  150.     val = 0, x = 0, y = 0, dir = E_DIRECTION_UP, anim = 0x0}, shelf_fix = {x = 0, y = 0, modified = 0}, stick_desks = 0x0,
  151.   border_menu = 0x0, border_locks_dialog = 0x0, border_remember_dialog = 0x0, border_border_dialog = 0x0,
  152.   border_prop_dialog = 0x0, pending_move_resize = 0x0, changes = {visible = 1 '\001', pos = 0 '\000', size = 0 '\000',
  153.     stack = 0 '\000', prop = 0 '\000', border = 0 '\000', reset_gravity = 0 '\000', shading = 0 '\000', shaded = 0 '\000',
  154.     shape = 0 '\000', shape_input = 0 '\000', icon = 0 '\000'}, drag = {start = 0 '\000', x = 0, y = 0}, layer = 100,
  155.   cur_mouse_action = 0x0, raise_timer = 0xa2eb970, ping_poller = 0x0, kill_timer = 0x0, shape_rects_num = 0, shape_rects = 0x0,
  156.   remember = 0x0, modal = 0x0, leader = 0x0, group = 0x0, parent = 0x21, transients = 0xb74523f0, desktop = 0xb74523f0,
  157.   pointer = 0x0, comp_hidden = 0 '\000', post_move = 0 '\000', post_resize = 0 '\000', post_show = 0 '\000', post_job = 0x0,
  158.   argb = 0 '\000', tmp_input_hidden = 1064}
  159.  
  160. so it looks like the border is roughly sane, except for the transients that is.
  161. go up the stack to see where we were fed the border from:
  162.   195_e_focus_raise_timer(void* data)
  163.   196{
  164.   197   E_Border *bd;
  165.   198
  166.   199   bd = data;
  167.   200   if (!bd->lock_user_stacking) e_border_raise(bd);
  168.   201   bd->raise_timer = NULL;
  169.   202   return ECORE_CALLBACK_CANCEL;
  170.  
  171. doesn't look like he could have messed up the data... go up the stack again!
  172. (gdb) up
  173. #2  0xb7708e5c in _ecore_call_task_cb (func=0x80e54c8 <_e_focus_raise_timer>, data=0x98d3188) at ecore_private.h:246
  174. 246        r = func(data);
  175.  240static inline Eina_Bool
  176.  241_ecore_call_task_cb(Ecore_Task_Cb func, void *data)
  177.  242{
  178.  243   Eina_Bool r;
  179.  244
  180.  245   _ecore_unlock();
  181.  246   r = func(data);
  182.  247   _ecore_lock();
  183.  
  184. nah, not 'im either. up again!:
  185. (gdb) up
  186. #3  0xb770a06e in _ecore_timer_expired_call (when=1244.7803629980001) at ecore_timer.c:731
  187. 731             if (!_ecore_call_task_cb(timer->func, timer->data))
  188.  
  189. nuts, doesn't look like I'm going to figure this out today...