robmcmullen / omnivore

Hex editor and debugging emulator, sponsored by the Player/Missile Podcast
Mozilla Public License 2.0
53 stars 7 forks source link

Crash on mac at application exit #102

Closed robmcmullen closed 7 years ago

robmcmullen commented 7 years ago

The app usually crashes when exiting with a big huge stack trace:

0   libwx_osx_cocoau-3.0.dylib      0x00000001034911bc wxMenu::DoRemove(wxMenuItem*) + 156
1   libwx_osx_cocoau-3.0.dylib      0x000000010361866d wxMenuBase::DoDelete(wxMenuItem*) + 13
2   libwx_osx_cocoau-3.0.dylib      0x0000000103618702 wxMenuBase::Delete(wxMenuItem*) + 18
3   _core_.so                       0x000000010309c083 _wrap_Menu_Delete + 323
4   org.python.python               0x00000001000c2d32 PyEval_EvalFrameEx + 20898
5   org.python.python               0x00000001000c4f93 PyEval_EvalCodeEx + 2115
6   org.python.python               0x00000001000c33c0 PyEval_EvalFrameEx + 22576
7   org.python.python               0x00000001000c3bcf PyEval_EvalFrameEx + 24639
8   org.python.python               0x00000001000c3bcf PyEval_EvalFrameEx + 24639
9   org.python.python               0x00000001000c4f93 PyEval_EvalCodeEx + 2115
10  org.python.python               0x000000010003e990 function_call + 176
11  org.python.python               0x000000010000cde2 PyObject_Call + 98
12  org.python.python               0x00000001000bf70f PyEval_EvalFrameEx + 7039
13  org.python.python               0x00000001000c4f93 PyEval_EvalCodeEx + 2115
14  org.python.python               0x000000010003e990 function_call + 176
15  org.python.python               0x000000010000cde2 PyObject_Call + 98
16  org.python.python               0x00000001000bf70f PyEval_EvalFrameEx + 7039
17  org.python.python               0x00000001000c4f93 PyEval_EvalCodeEx + 2115
18  org.python.python               0x00000001000c33c0 PyEval_EvalFrameEx + 22576
19  org.python.python               0x00000001000c4f93 PyEval_EvalCodeEx + 2115
20  org.python.python               0x000000010003e990 function_call + 176
21  org.python.python               0x000000010000cde2 PyObject_Call + 98
22  org.python.python               0x000000010001f43d instancemethod_call + 365
23  org.python.python               0x000000010000cde2 PyObject_Call + 98
24  org.python.python               0x00000001000c0c10 PyEval_EvalFrameEx + 12416
25  org.python.python               0x00000001000c4f93 PyEval_EvalCodeEx + 2115
26  org.python.python               0x000000010003e990 function_call + 176
27  org.python.python               0x000000010000cde2 PyObject_Call + 98
28  org.python.python               0x000000010001f43d instancemethod_call + 365
29  org.python.python               0x000000010000cde2 PyObject_Call + 98
30  org.python.python               0x000000010007ab6a slot_tp_call + 74
31  org.python.python               0x000000010000cde2 PyObject_Call + 98
32  ctraits.so                      0x000000010b2da113 call_notifiers + 483 (ctraits.c:2123)
33  ctraits.so                      0x000000010b2d8e64 setattr_event + 132 (ctraits.c:2212)
34  org.python.python               0x000000010005bd15 PyObject_SetAttr + 133
35  org.python.python               0x00000001000beda6 PyEval_EvalFrameEx + 4630
36  org.python.python               0x00000001000c4f93 PyEval_EvalCodeEx + 2115
37  org.python.python               0x000000010003e990 function_call + 176
38  org.python.python               0x000000010000cde2 PyObject_Call + 98
39  org.python.python               0x00000001000bf70f PyEval_EvalFrameEx + 7039
40  org.python.python               0x00000001000c4f93 PyEval_EvalCodeEx + 2115
41  org.python.python               0x000000010003e990 function_call + 176
42  org.python.python               0x000000010000cde2 PyObject_Call + 98
43  org.python.python               0x00000001000bf70f PyEval_EvalFrameEx + 7039
44  org.python.python               0x00000001000c4f93 PyEval_EvalCodeEx + 2115
45  org.python.python               0x00000001000c33c0 PyEval_EvalFrameEx + 22576
46  org.python.python               0x00000001000c4f93 PyEval_EvalCodeEx + 2115
47  org.python.python               0x000000010003e990 function_call + 176
48  org.python.python               0x000000010000cde2 PyObject_Call + 98
49  org.python.python               0x000000010001f43d instancemethod_call + 365
50  org.python.python               0x000000010000cde2 PyObject_Call + 98
51  org.python.python               0x00000001000c0c10 PyEval_EvalFrameEx + 12416
52  org.python.python               0x00000001000c4f93 PyEval_EvalCodeEx + 2115
53  org.python.python               0x000000010003e990 function_call + 176
54  org.python.python               0x000000010000cde2 PyObject_Call + 98
55  org.python.python               0x000000010001f43d instancemethod_call + 365
56  org.python.python               0x000000010000cde2 PyObject_Call + 98
57  org.python.python               0x000000010007ab6a slot_tp_call + 74
58  org.python.python               0x000000010000cde2 PyObject_Call + 98
59  ctraits.so                      0x000000010b2da113 call_notifiers + 483 (ctraits.c:2123)
60  ctraits.so                      0x000000010b2de5ad trait_property_changed + 221 (ctraits.c:1256)
61  ctraits.so                      0x000000010b2ddca0 _has_traits_property_changed + 80 (ctraits.c:1282)
62  org.python.python               0x00000001000c2f7d PyEval_EvalFrameEx + 21485
63  org.python.python               0x00000001000c4f93 PyEval_EvalCodeEx + 2115
64  org.python.python               0x00000001000c33c0 PyEval_EvalFrameEx + 22576
65  org.python.python               0x00000001000c4f93 PyEval_EvalCodeEx + 2115
66  org.python.python               0x000000010003e990 function_call + 176
67  org.python.python               0x000000010000cde2 PyObject_Call + 98
68  org.python.python               0x00000001000bf70f PyEval_EvalFrameEx + 7039
69  org.python.python               0x00000001000c4f93 PyEval_EvalCodeEx + 2115
70  org.python.python               0x000000010003e990 function_call + 176
71  org.python.python               0x000000010000cde2 PyObject_Call + 98
72  org.python.python               0x00000001000bf70f PyEval_EvalFrameEx + 7039
73  org.python.python               0x00000001000c4f93 PyEval_EvalCodeEx + 2115
74  org.python.python               0x00000001000c33c0 PyEval_EvalFrameEx + 22576
75  org.python.python               0x00000001000c4f93 PyEval_EvalCodeEx + 2115
76  org.python.python               0x000000010003e990 function_call + 176
77  org.python.python               0x000000010000cde2 PyObject_Call + 98
78  org.python.python               0x000000010001f43d instancemethod_call + 365
79  org.python.python               0x000000010000cde2 PyObject_Call + 98
80  org.python.python               0x00000001000c0c10 PyEval_EvalFrameEx + 12416
81  org.python.python               0x00000001000c4f93 PyEval_EvalCodeEx + 2115
82  org.python.python               0x000000010003e990 function_call + 176
83  org.python.python               0x000000010000cde2 PyObject_Call + 98
84  org.python.python               0x000000010001f43d instancemethod_call + 365
85  org.python.python               0x000000010000cde2 PyObject_Call + 98
86  org.python.python               0x000000010007ab6a slot_tp_call + 74
87  org.python.python               0x000000010000cde2 PyObject_Call + 98
88  ctraits.so                      0x000000010b2da113 call_notifiers + 483 (ctraits.c:2123)
89  ctraits.so                      0x000000010b2d89ca setattr_trait + 1114 (ctraits.c:2400)
90  org.python.python               0x000000010005bd15 PyObject_SetAttr + 133
91  org.python.python               0x00000001000beda6 PyEval_EvalFrameEx + 4630
92  org.python.python               0x00000001000c3bcf PyEval_EvalFrameEx + 24639
93  org.python.python               0x00000001000c3bcf PyEval_EvalFrameEx + 24639
94  org.python.python               0x00000001000c4f93 PyEval_EvalCodeEx + 2115
95  org.python.python               0x00000001000c33c0 PyEval_EvalFrameEx + 22576
96  org.python.python               0x00000001000c3bcf PyEval_EvalFrameEx + 24639
97  org.python.python               0x00000001000c3bcf PyEval_EvalFrameEx + 24639
98  org.python.python               0x00000001000c4f93 PyEval_EvalCodeEx + 2115
99  org.python.python               0x000000010003e990 function_call + 176
100 org.python.python               0x000000010000cde2 PyObject_Call + 98
101 org.python.python               0x000000010001f43d instancemethod_call + 365
102 org.python.python               0x000000010000cde2 PyObject_Call + 98
103 org.python.python               0x00000001000bc8c7 PyEval_CallObjectWithKeywords + 87
104 _core_.so                       0x000000010300c1b8 wxPyCallback::EventThunker(wxEvent&) + 312
105 libwx_osx_cocoau-3.0.dylib      0x0000000103427af4 wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) + 84
106 libwx_osx_cocoau-3.0.dylib      0x0000000103428bef wxEvtHandler::SearchDynamicEventTable(wxEvent&) + 111
107 libwx_osx_cocoau-3.0.dylib      0x0000000103429d58 wxEvtHandler::TryHereOnly(wxEvent&) + 40
108 libwx_osx_cocoau-3.0.dylib      0x0000000103429f39 wxEvtHandler::ProcessEvent(wxEvent&) + 265
109 libwx_osx_cocoau-3.0.dylib      0x0000000103427beb wxEvtHandler::DoTryChain(wxEvent&) + 75
110 libwx_osx_cocoau-3.0.dylib      0x0000000103429e1a wxEvtHandler::ProcessEventLocally(wxEvent&) + 74
111 libwx_osx_cocoau-3.0.dylib      0x0000000103429e75 wxEvtHandler::ProcessEvent(wxEvent&) + 69
112 libwx_osx_cocoau-3.0.dylib      0x000000010366ecf4 wxWindowBase::TryAfter(wxEvent&) + 116
113 libwx_osx_cocoau-3.0.dylib      0x0000000103429f53 wxEvtHandler::ProcessEvent(wxEvent&) + 291
114 libwx_osx_cocoau-3.0.dylib      0x0000000103429826 wxEvtHandler::SafelyProcessEvent(wxEvent&) + 22
115 libwx_osx_cocoau-3.0.dylib      0x000000010366dc80 wxWindowBase::HandleWindowEvent(wxEvent&) const + 16
116 libwx_osx_cocoau-3.0.dylib      0x000000010361ba40 wxMenuBase::SendEvent(int, int) + 256
117 libwx_osx_cocoau-3.0.dylib      0x00000001034919a5 wxMenu::HandleCommandProcess(wxMenuItem*, wxWindow*) + 101

... seemingly ad infinitum

but I think the real culprit is in the ctraits stuff. I think a trait change event is being called after the menu item (or whatever) has been deleted.

robmcmullen commented 7 years ago

Gettin' closer:

name: 'changed'
obj: <pyface.ui.wx.action.menu_manager.MenuManager object at 0x11339d170>
old_value: <undefined>
new_value: True
obj_dict: {'_groups': [<pyface.action.group.Separator object at 0x112bbb590>, <pyface.action.group.Separator object at 0x112bbb5f0>, <pyface.action.group.Separator object at 0x112bbb650>, <pyface.action.group.Separator object at 0x112bbb6b0>, <pyface.action.group.Separator object at 0x113324c50>, <pyface.action.group.Separator object at 0x113324cb0>, <pyface.action.group.Separator object at 0x1133525f0>, <pyface.action.group.Group object at 0x113352170>, <pyface.action.group.Separator object at 0x113352710>, <pyface.action.group.Separator object at 0x113352770>, <pyface.action.group.Separator object at 0x1133527d0>, <pyface.action.group.Separator object at 0x113352dd0>, <pyface.tasks.action.dock_pane_toggle_group.DockPaneToggleGroup object at 0x113352830>, <pyface.tasks.action.task_toggle_group.TaskToggleGroup object at 0x113352890>, <pyface.action.group.Separator object at 0x113352e30>, <pyface.action.group.Separator object at 0x113352e90>, <pyface.action.group.Separator object at 0x113352ef0>, <pyface.action.group.Group object at 0x11339d1d0>], 'name': u'View', 'parent': <pyface.action.group.Group object at 0x1134172f0>, 'controller': <pyface.tasks.action.task_action_controller.TaskActionController object at 0x11338a170>, 'separator': False, 'id': 'View'}
robmcmullen commented 7 years ago

Looks like it is in the view menu. Lots of sub-menus there. Maybe we have to explicitly remove the sub-menus somehow?

robmcmullen commented 7 years ago

The workaround causes the Segments menu to fail; the items in this menu are all radio buttons and they aren't erased when switching tabs among open files.

This menu seems to work on Mac even before the hack, so maybe it's just when the app is exiting? So a possible hack is to include a flag in pyface when the app is about to close so it won't delete radio buttons then.

robmcmullen commented 7 years ago

This also happens when adding a task to a window that has radio buttons when the current task has radio buttons. One way this can happen:

File -> New -> Blank Atari DOS SD image File -> New -> Jumpman Level

crash

robmcmullen commented 7 years ago

Should add a workaround for the 1.0 release, and if that means turning all radio buttons into regular menu items, maybe that's what it takes.

robmcmullen commented 7 years ago

That workaround does seem to keep it from crashing...

robmcmullen commented 7 years ago

Because of how the trait callbacks work, I can change all the radios to toggles and it still works! Every menu item gets a trait notification and sets itself to the correct state. Woohoo!