sirjuddington / SLADE

It's a Doom editor
https://slade.mancubus.net
GNU General Public License v2.0
711 stars 109 forks source link

Crash when trying to edit line properties #817

Closed fluffymormegil closed 6 years ago

fluffymormegil commented 7 years ago

SLADE Version: git e97eb64 Operating System: Linux

Issue Details:

The dialog box that pops up when you press ENTER/RETURN with one or more lines selected is badly garbled, with the tab bar being obscured by a texture-related window, and then (in a debug build) crashes with an assertion failure in the guts of Gtk+ / GLib. while switching between tabs.

(Shortly prior to the crash there's also a warning from Gtk that something is trying to set the parent of an already-parented widget.)

gdb backtrace follows:

#0  0x00007fffefa10fcf in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007fffefa123fa in __GI_abort () at abort.c:89
#2  0x00007ffff102e5a5 in g_assertion_message (domain=domain@entry=0x7ffff2bfdb5b "Gtk", file=file@entry=0x7ffff2c0bc78 "/build/gtk+2.0-1aCJs4/gtk+2.0-2.24.31/gtk/gtkcontainer.c", line=line@entry=2743, func=func@entry=0x7ffff2c0c680 <__func__.40725> "IA__gtk_container_propagate_expose", message=message@entry=0x55555c410c80 "assertion failed: (child->parent == GTK_WIDGET (container))")
    at ././glib/gtestutils.c:2432
#3  0x00007ffff102e63a in g_assertion_message_expr (domain=domain@entry=0x7ffff2bfdb5b "Gtk", file=file@entry=0x7ffff2c0bc78 "/build/gtk+2.0-1aCJs4/gtk+2.0-2.24.31/gtk/gtkcontainer.c", line=line@entry=2743, func=func@entry=0x7ffff2c0c680 <__func__.40725> "IA__gtk_container_propagate_expose", expr=expr@entry=0x7ffff2c0be20 "child->parent == GTK_WIDGET (container)") at ././glib/gtestutils.c:2455
#4  0x00007ffff29f4455 in IA__gtk_container_propagate_expose (container=
    0x55555affa6c0 [wxPizza], child=0x55555aff2d20 [wxPizza], event=0x7fffffffb940) at ./gtk/gtkcontainer.c:2743
#5  0x00007ffff2a2ae18 in gtk_fixed_forall (container=<optimized out>, include_internals=<optimized out>, callback=0x7ffff29f4530 <gtk_container_expose_child>, callback_data=0x7fffffffb3d0) at ./gtk/gtkfixed.c:452
#6  0x00007ffff29f2f5c in gtk_container_expose (widget=widget@entry=0x55555affa6c0 [wxPizza], event=0x7fffffffb940) at ./gtk/gtkcontainer.c:2661
#11 0x00007ffff12fbfbf in <emit signal ??? on instance 0x55555affa6c0 [wxPizza]> (instance=instance@entry=0x55555affa6c0, signal_id=<optimized out>, detail=detail@entry=0) at ././gobject/gsignal.c:3447
    #7  0x00007ffff2a6d7bc in _gtk_marshal_BOOLEAN__BOXED (closure=0x55555715cd80, return_value=0x7fffffffb590, n_param_values=<optimized out>, param_values=0x7fffffffb5f0, invocation_hint=<optimized out>, marshal_data=<optimized out>)
    at ./gtk/gtkmarshalers.c:86
    #8  0x00007ffff12e0f75 in g_closure_invoke (closure=closure@entry=0x55555715cd80, return_value=return_value@entry=0x7fffffffb590, n_param_values=2, param_values=param_values@entry=0x7fffffffb5f0, invocation_hint=invocation_hint@entry=0x7fffffffb570) at ././gobject/gclosure.c:804
    #9  0x00007ffff12f337d in signal_emit_unlocked_R (node=node@entry=0x55555715cdd0, detail=detail@entry=0, instance=instance@entry=0x55555affa6c0, emission_return=emission_return@entry=0x7fffffffb700, instance_and_params=instance_and_params@entry=0x7fffffffb5f0) at ././gobject/gsignal.c:3673
    #10 0x00007ffff12fb67f in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffb7b0) at ././gobject/gsignal.c:3401
#12 0x00007ffff2b858ac in gtk_widget_event_internal (widget=widget@entry=0x55555affa6c0 [wxPizza], event=event@entry=0x7fffffffb940) at ./gtk/gtkwidget.c:5010
#13 0x00007ffff2b85c61 in IA__gtk_widget_send_expose (widget=widget@entry=0x55555affa6c0 [wxPizza], event=event@entry=0x7fffffffb940) at ./gtk/gtkwidget.c:4839
#14 0x00007ffff2a6c5a2 in IA__gtk_main_do_event (event=0x7fffffffb940)
    at ./gtk/gtkmain.c:1621
#15 0x00007ffff26c8aef in _gdk_window_process_updates_recurse (window=window@entry=0x55555c415a20 [GdkWindow], expose_region=expose_region@entry=0x55555c0f8d90) at ./gdk/gdkwindow.c:5479
---Type <return> to continue, or q <return> to quit---
#16 0x00007ffff26c8a95 in _gdk_window_process_updates_recurse (window=window@entry=0x55555a9eba20 [GdkWindow], expose_region=expose_region@entry=0x55555c410ed0) at ./gdk/gdkwindow.c:5452
#17 0x00007ffff26c8a95 in _gdk_window_process_updates_recurse (window=window@entry=0x55555954b900 [GdkWindow], expose_region=expose_region@entry=0x7fffc8005840) at ./gdk/gdkwindow.c:5452
#18 0x00007ffff26c8a95 in _gdk_window_process_updates_recurse (window=window@entry=0x55555a9eb900 [GdkWindow], expose_region=expose_region@entry=0x555559ab76a0) at ./gdk/gdkwindow.c:5452
#19 0x00007ffff26f7de5 in _gdk_windowing_window_process_updates_recurse (window=window@entry=0x55555a9eb900 [GdkWindow], region=region@entry=0x555559ab76a0)
    at ./gdk/x11/gdkwindow-x11.c:5643
#20 0x00007ffff26c55c1 in gdk_window_process_updates_internal (window=0x55555a9eb900 [GdkWindow]) at ./gdk/gdkwindow.c:5646
#21 0x00007ffff26c5ed8 in IA__gdk_window_process_all_updates ()
    at ./gdk/gdkwindow.c:5752
#22 0x00007ffff29f2bf1 in gtk_container_idle_sizer (data=<optimized out>)
    at ./gtk/gtkcontainer.c:1360
#23 0x00007ffff26a4d37 in gdk_threads_dispatch (data=0x55555c3e61a0)
    at ./gdk/gdk.c:534
#24 0x00007ffff10076aa in g_main_dispatch (context=0x5555571583c0)
    at ././glib/gmain.c:3203
#25 0x00007ffff10076aa in g_main_context_dispatch (context=context@entry=0x5555571583c0) at ././glib/gmain.c:3856
#26 0x00007ffff1007a60 in g_main_context_iterate (context=0x5555571583c0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at ././glib/gmain.c:3929
#27 0x00007ffff1007d82 in g_main_loop_run (loop=0x55555c3e66c0)
    at ././glib/gmain.c:4125
#28 0x00007ffff2a6b3b7 in IA__gtk_main () at ./gtk/gtkmain.c:1268
#29 0x00007ffff5332e65 in wxGUIEventLoop::DoRun() (this=0x55555c1017c0)
    at ../src/gtk/evtloop.cpp:65
#30 0x00007ffff486727b in wxEventLoopBase::Run() (this=this@entry=0x55555c1017c0) at ../src/common/evtloopcmn.cpp:78
#31 0x00007ffff53b5bcd in wxDialog::ShowModal() (this=0x7fffffffbf40)
    at ../src/gtk/dialog.cpp:181
#32 0x0000555556253ae7 in MapEditor::editObjectProperties(std::vector<MapObject*, std::allocator<MapObject*> >&) (list=std::vector of length 1, capacity 1 = {...}) at /home/mormegil/src/doom/slade-dev/src/MapEditor/MapEditor.cpp:272
#33 0x0000555556201968 in Edit2D::editObjectProperties() (this=0x555559788bc8)
    at /home/mormegil/src/doom/slade-dev/src/MapEditor/Edit/Edit2D.cpp:198
#34 0x000055555621a237 in MapEditor::Input::handleKeyBind2d(wxString const&) (this=0x555559789848, name=...)
    at /home/mormegil/src/doom/slade-dev/src/MapEditor/Edit/Input.cpp:925
#35 0x0000555556218dc7 in MapEditor::Input::onKeyBindPress(wxString) (this=0x555559789848, name=...)
    at /home/mormegil/src/doom/slade-dev/src/MapEditor/Edit/Input.cpp:564
#36 0x00005555560ad250 in KeyBind::keyPressed(keypress_t) (key=...)
    at /home/mormegil/src/doom/slade-dev/src/General/KeyBind.cpp:377
---Type <return> to continue, or q <return> to quit---
#37 0x0000555556218ac4 in MapEditor::Input::keyDown(wxString const&) const (this=0x555559789848, key=...)
    at /home/mormegil/src/doom/slade-dev/src/MapEditor/Edit/Input.cpp:502
#38 0x0000555556306fb8 in MapCanvas::onKeyDown(wxKeyEvent&) (this=
    0x555559720c70, e=...)
    at /home/mormegil/src/doom/slade-dev/src/MapEditor/UI/MapCanvas.cpp:255
#39 0x00007ffff482540e in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const (this=0x555557126fa0, handler=0x555559720c70, functor=..., event=...) at ../src/common/appbase.cpp:623
#40 0x00007ffff49aaea5 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) (entry=..., handler=<optimized out>, event=...) at ../src/common/event.cpp:1392
#41 0x00007ffff49ab29d in wxEvtHandler::SearchDynamicEventTable(wxEvent&) (this=0x555559720c70, event=...) at ../src/common/event.cpp:1751
#42 0x00007ffff49ab31f in wxEvtHandler::TryHereOnly(wxEvent&) (this=0x555559720c70, event=...) at ../src/common/event.cpp:1585
#43 0x00007ffff49ab3d3 in wxEvtHandler::TryBeforeAndHere(wxEvent&) (event=..., this=0x555559720c70) at ../include/wx/event.h:3671
#44 0x00007ffff49ab3d3 in wxEvtHandler::ProcessEventLocally(wxEvent&) (this=0x555559720c70, event=...) at ../src/common/event.cpp:1522
#45 0x00007ffff49ab435 in wxEvtHandler::ProcessEvent(wxEvent&) (this=0x555559720c70, event=...) at ../src/common/event.cpp:1495
#46 0x00007ffff49ab1a7 in wxEvtHandler::SafelyProcessEvent(wxEvent&) (this=<optimized out>, event=...) at ../src/common/event.cpp:1613
#47 0x00007ffff55488ec in wxWindowBase::HandleWindowEvent(wxEvent&) const (this=this@entry=0x555559720c70, event=...) at ../src/common/wincmn.cpp:1525
#48 0x00007ffff536657b in gtk_window_key_press_callback(GtkWidget*, GdkEventKey*, wxWindow*) (gdk_event=0x55555a9ec820, win=0x555559720c70)
    at ../src/gtk/window.cpp:993
#53 0x00007ffff12fbfbf in <emit signal ??? on instance 0x55555add8ae0 [wxPizza]> (instance=instance@entry=0x55555add8ae0, signal_id=<optimized out>, detail=detail@entry=0) at ././gobject/gsignal.c:3447
    #49 0x00007ffff2a6d7bc in _gtk_marshal_BOOLEAN__BOXED (closure=0x55555978bb90, return_value=0x7fffffffd6a0, n_param_values=<optimized out>, param_values=0x7fffffffd700, invocation_hint=<optimized out>, marshal_data=<optimized out>)
    at ./gtk/gtkmarshalers.c:86
    #50 0x00007ffff12e0f75 in g_closure_invoke (closure=0x55555978bb90, return_value=return_value@entry=0x7fffffffd6a0, n_param_values=2, param_values=param_values@entry=0x7fffffffd700, invocation_hint=invocation_hint@entry=0x7fffffffd680)
    at ././gobject/gclosure.c:804
    #51 0x00007ffff12f2f82 in signal_emit_unlocked_R (node=node@entry=0x55555715cbf0, detail=detail@entry=0, instance=instance@entry=0x55555add8ae0, emission_return=emission_return@entry=0x7fffffffd810, instance_and_params=instance_and_params@entry=0x7fffffffd700) at ././gobject/gsignal.c:3635
    #52 0x00007ffff12fb67f in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffd8c0) at ././gobject/gsignal.c:3401
#54 0x00007ffff2b858ac in gtk_widget_event_internal (widget=widget@entry=0x55555add8ae0 [wxPizza], event=event@entry=0x55555a9ec820) at ./gtk/gtkwidget.c:5010
---Type <return> to continue, or q <return> to quit---
#55 0x00007ffff2b85b77 in IA__gtk_widget_event (widget=widget@entry=0x55555add8ae0 [wxPizza], event=event@entry=0x55555a9ec820) at ./gtk/gtkwidget.c:4807
#56 0x00007ffff2b992df in IA__gtk_window_propagate_key_event (window=window@entry=0x55555828b4a0 [GtkWindow], event=event@entry=0x55555a9ec820)
    at ./gtk/gtkwindow.c:5199
#57 0x00007ffff53528a8 in wxgtk_tlw_key_press_event(GtkWidget*, GdkEventKey*) (widget=widget@entry=0x55555828b4a0 [GtkWindow], event=0x55555a9ec820)
    at ../src/gtk/toplevel.cpp:243
#62 0x00007ffff12fbfbf in <emit signal ??? on instance 0x55555828b4a0 [GtkWindow]> (instance=instance@entry=0x55555828b4a0, signal_id=<optimized out>, detail=detail@entry=0) at ././gobject/gsignal.c:3447
    #58 0x00007ffff2a6d7bc in _gtk_marshal_BOOLEAN__BOXED (closure=0x555559783fd0, return_value=0x7fffffffdbb0, n_param_values=<optimized out>, param_values=0x7fffffffdc10, invocation_hint=<optimized out>, marshal_data=<optimized out>)
    at ./gtk/gtkmarshalers.c:86
    #59 0x00007ffff12e0f75 in g_closure_invoke (closure=0x555559783fd0, return_value=return_value@entry=0x7fffffffdbb0, n_param_values=2, param_values=param_values@entry=0x7fffffffdc10, invocation_hint=invocation_hint@entry=0x7fffffffdb90)
    at ././gobject/gclosure.c:804
    #60 0x00007ffff12f2f82 in signal_emit_unlocked_R (node=node@entry=0x55555715cbf0, detail=detail@entry=0, instance=instance@entry=0x55555828b4a0, emission_return=emission_return@entry=0x7fffffffdd20, instance_and_params=instance_and_params@entry=0x7fffffffdc10) at ././gobject/gsignal.c:3635
    #61 0x00007ffff12fb67f in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffddd0) at ././gobject/gsignal.c:3401
#63 0x00007ffff2b858ac in gtk_widget_event_internal (widget=widget@entry=0x55555828b4a0 [GtkWindow], event=event@entry=0x55555a9ec820)
    at ./gtk/gtkwidget.c:5010
#64 0x00007ffff2b85b77 in IA__gtk_widget_event (widget=widget@entry=0x55555828b4a0 [GtkWindow], event=event@entry=0x55555a9ec820) at ./gtk/gtkwidget.c:4807
#65 0x00007ffff2a6c05f in IA__gtk_propagate_event (widget=0x55555828b4a0 [GtkWindow], event=0x55555a9ec820) at ./gtk/gtkmain.c:2475
#66 0x00007ffff2a6c33b in IA__gtk_main_do_event (event=0x55555a9ec820)
    at ./gtk/gtkmain.c:1696
#67 0x00007ffff26e1cbc in gdk_event_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>) at ./gdk/x11/gdkevents-x11.c:2425
#68 0x00007ffff10077f7 in g_main_dispatch (context=0x5555571583c0)
    at ././glib/gmain.c:3203
#69 0x00007ffff10077f7 in g_main_context_dispatch (context=context@entry=0x5555571583c0) at ././glib/gmain.c:3856
#70 0x00007ffff1007a60 in g_main_context_iterate (context=0x5555571583c0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at ././glib/gmain.c:3929
#71 0x00007ffff1007d82 in g_main_loop_run (loop=0x5555571e5f20)
    at ././glib/gmain.c:4125
#72 0x00007ffff2a6b3b7 in IA__gtk_main () at ./gtk/gtkmain.c:1268
#73 0x00007ffff5332e65 in wxGUIEventLoop::DoRun() (this=0x5555593e1080)
    at ../src/gtk/evtloop.cpp:65
---Type <return> to continue, or q <return> to quit---
#74 0x00007ffff486727b in wxEventLoopBase::Run() (this=0x5555593e1080)
    at ../src/common/evtloopcmn.cpp:78
#75 0x00007ffff482c776 in wxAppConsoleBase::MainLoop() (this=0x555557126fa0)
    at ../src/common/appbase.cpp:334
#76 0x00007ffff48b8cd0 in wxEntry(int&, wchar_t**) (argc=<optimized out>, argv=<optimized out>) at ../src/common/init.cpp:495
#77 0x0000555555f2020c in main(int, char**) (argc=1, argv=0x7fffffffe2b8)
    at /home/mormegil/src/doom/slade-dev/src/Application/SLADEWxApp.cpp:475
(gdb) 
fluffymormegil commented 6 years ago

Looks like the use of WxUtils::createPadPanel when building the dialog box is the culprit here. (The tabs that work correctly are added as pages directly, instead of being wrapped in whatever sorcery createPadPanel does - which sorcery, incidentally, was producing GTK warnings about trying to parent an already-parented widget.

PR will follow shortly.