Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] Enable crash reporter on MinGW builds. #60944

Closed
wants to merge 1 commit into from

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented May 11, 2022

Enables crash reporter on MinGW builds, stack trace will be readable only if converted *.pdb symbols are provided (e.g., generated from the DWARF symbols used by GCC using this tool - https://github.com/rainers/cv2pdb).

MinGW crash log generation seems to take more time (few seconds vs instant for MSVC) and include some unnecessary frames (since snapshot is taken by our crash handler not by SEH handler).

MSVC crash log example
CrashHandlerException: Program crashed
Engine version: Godot Engine v4.0.alpha.custom_build (ccb583be091d3baf55365235cb35d4487ea3e911)
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[0] core_bind::OS::crash (godot\core\core_bind.cpp:211)
[1] core_bind::OS::crash (godot\core\core_bind.cpp:211)
[2] call_with_ptr_args_helper<core_bind::OS,String const &,0> (godot\core\variant\binder_common.h:257)
[3] call_with_ptr_args<core_bind::OS,String const &> (godot\core\variant\binder_common.h:506)
[4] MethodBindT<core_bind::OS,String const &>::ptrcall (godot\core\object\method_bind.h:345)
[5] GDScriptFunction::call (godot\modules\gdscript\gdscript_vm.cpp:1952)
[6] GDScriptInstance::callp (godot\modules\gdscript\gdscript.cpp:1543)
[7] Node::_gdvirtual__process_call<0> (godot\scene\main\node.h:235)
[8] Node::_notification (godot\scene\main\node.cpp:57)
[9] Node::_notificationv (godot\scene\main\node.h:45)
[10] CanvasItem::_notificationv (godot\scene\main\canvas_item.h:45)
[11] Node2D::_notificationv (godot\scene\2d\node_2d.h:37)
[12] Object::notification (godot\core\object\object.cpp:849)
[13] SceneTree::_notify_group_pause (godot\scene\main\scene_tree.cpp:857)
[14] SceneTree::process (godot\scene\main\scene_tree.cpp:456)
[15] Main::iteration (godot\main\main.cpp:2745)
[16] OS_Windows::run (godot\platform\windows\os_windows.cpp:700)
[17] widechar_main (godot\platform\windows\godot_windows.cpp:175)
[18] _main (godot\platform\windows\godot_windows.cpp:197)
[19] main (godot\platform\windows\godot_windows.cpp:211)
[20] WinMain (godot\platform\windows\godot_windows.cpp:225)
[21] __scrt_common_main_seh (d:\a01\_work\43\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
[22] BaseThreadInitThunk
-- END OF BACKTRACE --
MinGW crash log example
CrashHandlerException: Program crashed with signal 4
Engine version: Godot Engine v4.0.alpha.custom_build (ccb583be091d3baf55365235cb35d4487ea3e911)
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[0] CrashHandlerException (godot\platform\windows\crash_handler_windows.cpp:194)
[1] CrashHandlerException (godot\platform\windows\crash_handler_windows.cpp:194)
[2] _gnu_exception_handler (C:\M\mingw-w64-crt-git\src\mingw-w64\mingw-w64-crt\crt\crt_handler.c:243)
[3] _C_specific_handler
[4] _chkstk
[5] RtlRestoreContext
[6] KiUserExceptionDispatcher
[7] crash (godot\core\core_bind.cpp:211)
[8] call_with_ptr_args_helper<__UnexistingClass, const String&, 0> (godot\.\core\variant\binder_common.h:257)
[9] call_with_ptr_args<__UnexistingClass, const String&> (godot\.\core\variant\binder_common.h:506)
[10] ptrcall (godot\.\core\object\method_bind.h:345)
[11] call (godot\modules\gdscript\gdscript_vm.cpp:1952)
[12] callp (godot\modules\gdscript\gdscript.cpp:1543)
[13] _gdvirtual__process_call<false> (godot\scene\main\node.h:235)
[14] _notification (godot\scene\main\node.cpp:57)
[15] _notificationv (godot\.\scene\main\node.h:45)
[16] _notificationv (godot\.\scene\main\canvas_item.h:45)
[17] _notificationv (godot\.\scene\2d\node_2d.h:37)
[18] notification (godot\core\object\object.cpp:849)
[19] _notify_group_pause (godot\scene\main\scene_tree.cpp:855)
[20] process (godot\scene\main\scene_tree.cpp:456)
[21] iteration (godot\main\main.cpp:2745)
[22] run (godot\platform\windows\os_windows.cpp:700)
[23] widechar_main (godot\platform\windows\godot_windows.cpp:175)
[24] _main (godot\platform\windows\godot_windows.cpp:197)
[25] main (godot\platform\windows\godot_windows.cpp:216)
[26] __tmainCRTStartup (C:\M\mingw-w64-crt-git\src\mingw-w64\mingw-w64-crt\crt\crtexe.c:323)
[27] WinMainCRTStartup (C:\M\mingw-w64-crt-git\src\mingw-w64\mingw-w64-crt\crt\crtexe.c:178)
[28] BaseThreadInitThunk
-- END OF BACKTRACE --

@bruvzg bruvzg added this to the 4.0 milestone May 11, 2022
@bruvzg bruvzg requested a review from a team as a code owner May 11, 2022 13:17
@bruvzg bruvzg force-pushed the mingw_crash_rep branch from 87c4d50 to a193b39 Compare May 11, 2022 13:30
@bruvzg
Copy link
Member Author

bruvzg commented May 13, 2022

Found a better way, without symbols conversion. I'll open a new PR soon.

@bruvzg
Copy link
Member Author

bruvzg commented May 13, 2022

Found a better way, without symbols conversion. I'll open a new PR soon.

New version - #61006
The only downside, it's not working with ASLR enabled, but this should not be an issue for debug builds. (Fixed)

@bruvzg bruvzg deleted the mingw_crash_rep branch May 13, 2022 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants