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

[WIP] Add option to replay backtraces. #91655

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented May 7, 2024

  • Cleanup crash log output.
  • Add option to replay trace (with external debug symbols).

TODO:

  • Common code
  • macOS
  • Linux
  • Windows/MinGW
  • Windows/MSVC
  • Cleanup

Sample output:

Stripped binary crash - click to expand
% ./godot.macos.editor.arm64 --path ../../godot-tests/_crash
Godot Engine v4.3.dev.custom_build.a4f74dd1b (2024-05-07 09:56:53 UTC) - https://godotengine.org
Vulkan 1.2.280 - Forward+ - Using Device #0: Apple - Apple M1

ERROR: noooo
   at: crash (core/core_bind.cpp:241)

================================================================
Program crashed with signal 5
Engine version: Godot Engine v4.3.dev.custom_build (a4f74dd1bbd7a3a0696d14001fb0b244667fb4c5)
Please include this when reporting the bug to the project developer.

Dumping the backtrace...
================================================================
GwAAAAcAAAAEAAAAAQAAAG8AAAAEAAAABQAAAG1hY29zAAAABAAAAAEAAABhAAAABAAAAAUAAABhcm02NAAAAAQAAAABAAAAdgAAAAQAAAAoAAAAYTRmNzRkZDFiYmQ3YTNhMDY5NmQxNDAwMWZiMGIyNDQ2NjdmYjRjNQQAAAABAAAAcwAAAAIAAAAFAAAABAAAAAEAAABtAAAAIgAAAAMAAAA8AAAAL1ZvbHVtZXMvQmFja3VwL1Byb2plY3RzL2dvZG90L2Jpbi9nb2RvdC5tYWNvcy5lZGl0b3IuYXJtNjQAKQAAAC91c3IvbGliL3N5c3RlbS9saWJzeXN0ZW1fcGxhdGZvcm0uZHlsaWIAAAAADgAAAC91c3IvbGliL2R5bGQAAAAEAAAAAQAAAGQAAAAeAAAAGQAAAABwPgCERQAAqCkjBGSj0wBATc4A9C6BBFygUwTMYIEE8BqRAgwXkQI0FJECLL+aAqx9iALAiYgC5PGIAviQjQJkmI8CcJI+AMyPPgDY10wE4LJMBLiXPwAwFz4AFMpAAOBgAAAEAAAAAQAAAHQAAAAdAAAAGQAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAA=
================================================================

  1:  3e7000 godot.macos.editor.arm64 - ???
  2:    4584 libsystem_platform.dylib - _sigtramp + 38
  3: 42329a8 godot.macos.editor.arm64 - ???
  4:  d3a364 godot.macos.editor.arm64 - ???
  5:  ce4d40 godot.macos.editor.arm64 - ???
  6: 4812ef4 godot.macos.editor.arm64 - ???
  7: 453a05c godot.macos.editor.arm64 - ???
  8: 48160cc godot.macos.editor.arm64 - ???
  9: 2911af0 godot.macos.editor.arm64 - ???
 10: 291170c godot.macos.editor.arm64 - ???
 11: 2911434 godot.macos.editor.arm64 - ???
 12: 29abf2c godot.macos.editor.arm64 - ???
 13: 2887dac godot.macos.editor.arm64 - ???
 14: 28889c0 godot.macos.editor.arm64 - ???
 15: 288f1e4 godot.macos.editor.arm64 - ???
 16: 28d90f8 godot.macos.editor.arm64 - ???
 17: 28f9864 godot.macos.editor.arm64 - ???
 18:  3e9270 godot.macos.editor.arm64 - ???
 19:  3e8fcc godot.macos.editor.arm64 - ???
 20: 44cd7d8 godot.macos.editor.arm64 - ???
 21: 44cb2e0 godot.macos.editor.arm64 - ???
 22:  3f97b8 godot.macos.editor.arm64 - ???
 23:  3e1730 godot.macos.editor.arm64 - ???
 24:  40ca14 godot.macos.editor.arm64 - ???
 25:    60e0                     dyld - start + 938

-- END OF BACKTRACE --
================================================================
zsh: abort      ./godot.macos.editor.arm64 --path ../../godot-tests/_crash
Trace replay (same binary, but external `.dSYM` moved to the executable folder) - click to expand
% ./godot.macos.editor.arm64 --decode-trace GwAAAAcAAAAEAAAAAQAAAG8AAAAEAAAABQAAAG1hY29zAAAABAAAAAEAAABhAAAABAAAAAUAAABhcm02NAAAAAQAAAABAAAAdgAAAAQAAAAoAAAAYTRmNzRkZDFiYmQ3YTNhMDY5NmQxNDAwMWZiMGIyNDQ2NjdmYjRjNQQAAAABAAAAcwAAAAIAAAAFAAAABAAAAAEAAABtAAAAIgAAAAMAAAA8AAAAL1ZvbHVtZXMvQmFja3VwL1Byb2plY3RzL2dvZG90L2Jpbi9nb2RvdC5tYWNvcy5lZGl0b3IuYXJtNjQAKQAAAC91c3IvbGliL3N5c3RlbS9saWJzeXN0ZW1fcGxhdGZvcm0uZHlsaWIAAAAADgAAAC91c3IvbGliL2R5bGQAAAAEAAAAAQAAAGQAAAAeAAAAGQAAAABwPgCERQAAqCkjBGSj0wBATc4A9C6BBFygUwTMYIEE8BqRAgwXkQI0FJECLL+aAqx9iALAiYgC5PGIAviQjQJkmI8CcJI+AMyPPgDY10wE4LJMBLiXPwAwFz4AFMpAAOBgAAAEAAAAAQAAAHQAAAAdAAAAGQAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAA=
================================================================

  1:  3e7000 godot.macos.editor.arm64 - handle_crash(int) (in godot.macos.editor.arm64) (crash_handler_macos.mm:74)
  2:    4584 libsystem_platform.dylib - _sigtramp + 38
  3: 42329a8 godot.macos.editor.arm64 - core_bind::OS::crash(String const&) (in godot.macos.editor.arm64) (core_bind.cpp:241)
  4:  d3a364 godot.macos.editor.arm64 - MethodBindT<String const&>::validated_call(Object*, Variant const**, Variant*) const (in godot.macos.editor.arm64) (method_bind.h:359)
  5:  ce4d40 godot.macos.editor.arm64 - GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) (in godot.macos.editor.arm64) (gdscript_vm.cpp:2145)
  6: 4812ef4 godot.macos.editor.arm64 - Object::callp(StringName const&, Variant const**, int, Callable::CallError&) (in godot.macos.editor.arm64) (object.cpp:820)
  7: 453a05c godot.macos.editor.arm64 - Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (in godot.macos.editor.arm64) (callable.cpp:0)
  8: 48160cc godot.macos.editor.arm64 - Object::emit_signalp(StringName const&, Variant const**, int) (in godot.macos.editor.arm64) (object.cpp:1221)
  9: 2911af0 godot.macos.editor.arm64 - BaseButton::_pressed() (in godot.macos.editor.arm64) (base_button.cpp:138)
 10: 291170c godot.macos.editor.arm64 - BaseButton::on_action_event(Ref<InputEvent>) (in godot.macos.editor.arm64) (base_button.cpp:177)
 11: 2911434 godot.macos.editor.arm64 - BaseButton::gui_input(Ref<InputEvent> const&) (in godot.macos.editor.arm64) (base_button.cpp:69)
 12: 29abf2c godot.macos.editor.arm64 - Control::_call_gui_input(Ref<InputEvent> const&) (in godot.macos.editor.arm64) (control.cpp:0)
 13: 2887dac godot.macos.editor.arm64 - Viewport::_gui_call_input(Control*, Ref<InputEvent> const&) (in godot.macos.editor.arm64) (viewport.cpp:1561)
 14: 28889c0 godot.macos.editor.arm64 - Viewport::_gui_input_event(Ref<InputEvent>) (in godot.macos.editor.arm64) (viewport.cpp:1827)
 15: 288f1e4 godot.macos.editor.arm64 - Viewport::push_input(Ref<InputEvent> const&, bool) (in godot.macos.editor.arm64) (viewport.cpp:3249)
 16: 28d90f8 godot.macos.editor.arm64 - Window::_window_input(Ref<InputEvent> const&) (in godot.macos.editor.arm64) (window.cpp:0)
 17: 28f9864 godot.macos.editor.arm64 - void call_with_variant_args_helper<Window, Ref<InputEvent> const&, 0ul>(Window*, void (Window::*)(Ref<InputEvent> const&), Variant const**, Callable::CallError&, IndexSequence<0ul>) (in godot.macos.editor.arm64) (binder_common.h:304)
 18:  3e9270 godot.macos.editor.arm64 - Variant Callable::call<Ref<InputEvent>>(Ref<InputEvent>) const (in godot.macos.editor.arm64) (variant.h:874)
 19:  3e8fcc godot.macos.editor.arm64 - DisplayServerMacOS::_dispatch_input_event(Ref<InputEvent> const&) (in godot.macos.editor.arm64) (display_server_macos.mm:385)
 20: 44cd7d8 godot.macos.editor.arm64 - Input::_parse_input_event_impl(Ref<InputEvent> const&, bool) (in godot.macos.editor.arm64) (input.cpp:774)
 21: 44cb2e0 godot.macos.editor.arm64 - Input::flush_buffered_events() (in godot.macos.editor.arm64) (input.cpp:1045)
 22:  3f97b8 godot.macos.editor.arm64 - DisplayServerMacOS::process_events() (in godot.macos.editor.arm64) (display_server_macos.mm:3023)
 23:  3e1730 godot.macos.editor.arm64 - OS_MacOS::run() (in godot.macos.editor.arm64) (os_macos.mm:781)
 24:  40ca14 godot.macos.editor.arm64 - main (in godot.macos.editor.arm64) (godot_main_macos.mm:89)
 25:    60e0                     dyld - ???

-- END OF BACKTRACE --
================================================================

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.

None yet

2 participants