2.99 crash when right click on a not selected brush in Tool Options
Environment/Versions
- GIMP version: current master
- Package: self-built
- Operating System: Windows 10 Home, 64-bit
Description of the bug
When the Paintbrush is selected in Tools (probably the same with other similar tools), open the brush selection button in the ToolOptions and right-click on one of the brushes that is not the currently active one. Instead of a popup menu you get a crash.
Reproduction
Is the bug reproducible? Always
Reproduction steps:
- Select Paintbrush tool.
- Open the brush selection button in its tool options.
- Right-click on one of the brushes that is not the active one
- Crash
Expected result:
No crash and showing the popup menu.
Actual result:
Crash
Additional information
Backtrace:
Error occurred on Sunday, December 17, 2023 at 15:42:54.
gimp-2.99.exe caused an Access Violation at location 00007FF7596F53FD in module gimp-2.99.exe Reading from location FFFFFFFFFFFFFFFF.
AddrPC Params
00007FF7596F53FD 000002C6C948CF60 00000000FFFFFFFF 0000000000000000 gimp-2.99.exe!gimp_container_view_get_container+0x1d
00007FF7597817F5 000002C6ECAF80C0 000002C6ECE1A650 000002C6ECE1A650 gimp-2.99.exe!gimp_container_icon_view_button_press+0xc5 [D:/msys64/home/Jacob/build/gimp/../../gimp/app/widgets/gimpcontainericonview.c @ 667]
665: gimp_container_view_item_selected (container_view, renderer->viewable);
666: /* Show the context menu. */
> 667: if (gimp_container_view_get_container (container_view))
668: gimp_editor_popup_menu_at_pointer (GIMP_EDITOR (icon_view), (GdkEvent *) bevent);
669: }
00007FFA6194328C 000000C8E77FF400 000000C8E77FF400 000000C8E77FF400 libgtk-3-0.dll!_gtk_marshal_BOOLEAN__BOXED+0x5c [D:/msys64/home/Jacob/build/gtk/gtk/gtkmarshalers.c @ 84]
82: callback = (GMarshalFunc_BOOLEAN__BOXED) (marshal_data ? marshal_data : cc->callback);
83:
> 84: v_return = callback (data1,
85: g_marshal_value_peek_boxed (param_values + 1),
86: data2);
00007FFAA1C68124 0000000000000000 000000C8E77FF570 000002C6C94B4080 libgobject-2.0-0.dll!g_closure_invoke+0x134
00007FFAA1C7B2F7 000000C800000000 000002C600000000 0000000000000000 libgobject-2.0-0.dll!g_param_spec_variant+0x2007
00007FFAA1C7C389 0000000000000000 000002C600000046 00007FFA00000000 libgobject-2.0-0.dll!g_param_spec_variant+0x3099
00007FFAA1C823BB 0000000000000000 00007FFAA1C8BF39 00007FFA00000000 libgobject-2.0-0.dll!g_signal_emit+0x5b
00007FFA61C006F2 000002C600000000 00007FFA61C29BEA 000002C6EB40DAA0 libgtk-3-0.dll!gtk_widget_event_internal.part.0+0x182
00007FFA61AAF5D9 FFFFFFFFFFFFFFFF 00007FFAB262E703 0000000000000000 libgtk-3-0.dll!propagate_event+0x159 [D:/msys64/home/Jacob/build/gtk/../../gtk/gtk/gtkmain.c @ 2588]
2586: handled_event = event->type != GDK_SCROLL;
2587: else
> 2588: handled_event = gtk_widget_event (widget, event);
2589:
2590: tmp = gtk_widget_get_parent (widget);
00007FFA61AB1447 0000000000000000 000002C6C9474780 0000000000000000 libgtk-3-0.dll!gtk_main_do_event+0x6a7
00007FFA6EFBF329 000000C8E77FF960 00007FFAB2629400 00007FFAB262A3E0 libgdk-3-0.dll!_gdk_event_emit+0x29 [D:/msys64/home/Jacob/build/gtk/../../gtk/gdk/gdkevents.c @ 73]
71:
72: if (_gdk_event_func)
> 73: (*_gdk_event_func) (event, _gdk_event_data);
74:
75: if (gdk_drag_context_handle_dest_event (event))
00007FFA6EFF1FD0 0000000000000000 00007FFAB30E07C0 0000000000000000 libgdk-3-0.dll!gdk_event_dispatch+0x40 [D:/msys64/home/Jacob/build/gtk/../../gtk/gdk/win32/gdkevents-win32.c @ 4141]
4139: GdkWin32Selection *sel_win32 = _gdk_win32_selection_get ();
4140:
> 4141: _gdk_event_emit (event);
4142:
4143: gdk_event_free (event);
00007FFA793BEC6C 000002C600000000 000002C6806F7AF0 000000C800000D5D libglib-2.0-0.dll!g_clear_list+0x12bc
00007FFA793C1983 000002C600000000 00007FFAB1EA9C9C 000000C8E77FFB74 libglib-2.0-0.dll!g_get_monotonic_time+0xa73
00007FFA793C20AD 000002C6807517C0 00007FF7596496B3 0000000000000000 libglib-2.0-0.dll!g_main_context_iteration+0x2d
00007FFA7AD78CB3 00007FFA7939B610 0000000000000000 000002C6C94CE280 libgio-2.0-0.dll!g_application_run+0x183
00007FF7596253FE 000002C6C8C01710 000002C6C8C23060 000002C6C7450860 gimp-2.99.exe!app_run+0x24e [D:/msys64/home/Jacob/build/gimp/../../gimp/app/app.c @ 317]
315: G_CALLBACK (app_activate_callback),
316: NULL);
> 317: retval = g_application_run (app, 0, NULL);
318:
319: if (! retval)
00007FF7598A151E 0000000000000000 000002C6C8C7C050 00007FF759A9C0C8 gimp-2.99.exe!main+0x52e [D:/msys64/home/Jacob/build/gimp/../../gimp/app/main.c @ 793]
791: user_gimprc_file = g_file_new_for_commandline_arg (user_gimprc);
792:
> 793: retval = app_run (argv[0],
794: filenames,
795: system_gimprc_file,
00007FF7594512EE 0000000000000000 0000000000000000 0000000000000000 gimp-2.99.exe!__tmainCRTStartup+0x16e [C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtexe.c @ 267]
00007FF759451406 0000000000000000 0000000000000000 0000000000000000 gimp-2.99.exe!mainCRTStartup+0x16 [C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtexe.c @ 188]
00007FFAB2577344 0000000000000000 0000000000000000 0000000000000000 KERNEL32.DLL!BaseThreadInitThunk+0x14
00007FFAB30E26B1 0000000000000000 0000000000000000 0000000000000000 ntdll.dll!RtlUserThreadStart+0x21
Note that this crash does not happen on 2.10.34 except for a critical in the terminal and no popup: Gimp-Widgets-CRITICAL: gimp_container_view_item_context: assertion 'GIMP_IS_VIEWABLE (viewable)' failed
I think it might be related to the change in commit eed28c09 by @nielsdg.