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

Warn if the crash backtrace printed is missing debugging information #55565

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

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Dec 2, 2021

This is caused by the binary not including debugging symbols. Such backtraces generally not useful, as they don't pinpoint which file is the cause of the crash (let alone the line number).

See #55547 for an example where this message would help troubleshooting.

To test this PR locally, add a CRASH_NOW(); call here and recompile: https://github.com/Calinou/godot/blob/24ad30b5141a2b9a078a11971a4c07e5cec68a95/editor/editor_node.cpp#L627

Preview

With debug symbols

================================================================
handle_crash: Program crashed with signal 4
Engine version: Godot Engine v4.0.dev.custom_build (8bb0f2aff1adf013155281756aec86984c095a76)
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /lib64/libc.so.6(+0x3d320) [0x7f3c61e62320] (??:0)
[2] EditorNode::_notification(int) (/home/hugo/Documents/Git/godotengine/godot/editor/editor_node.cpp:627)
[3] EditorNode::_notificationv(int, bool) (/home/hugo/Documents/Git/godotengine/godot/./editor/editor_node.h:99)
[4] Object::notification(int, bool) (/home/hugo/Documents/Git/godotengine/godot/core/object/object.cpp:846)
[5] Node::_propagate_ready() (/home/hugo/Documents/Git/godotengine/godot/scene/main/node.cpp:188)
[6] Node::_propagate_ready() (/home/hugo/Documents/Git/godotengine/godot/scene/main/node.cpp:179)
[7] Node::_set_tree(SceneTree*) (/home/hugo/Documents/Git/godotengine/godot/scene/main/node.cpp:?)
[8] SceneTree::initialize() (/home/hugo/Documents/Git/godotengine/godot/scene/main/scene_tree.cpp:402)
[9] OS_LinuxBSD::run() (/home/hugo/Documents/Git/godotengine/godot/platform/linuxbsd/os_linuxbsd.cpp:?)
[10] bin/godot.linuxbsd.tools.64.llvm(main+0x1c6) [0x462dc36] (/home/hugo/Documents/Git/godotengine/godot/platform/linuxbsd/godot_linuxbsd.cpp:58)
[11] /lib64/libc.so.6(__libc_start_main+0xd5) [0x7f3c61e4cb75] (??:0)
[12] bin/godot.linuxbsd.tools.64.llvm(_start+0x2e) [0x462d9ae] (??:?)
-- END OF BACKTRACE --
================================================================
[1]    25649 IOT instruction (core dumped)  bin/godot.linuxbsd.tools.64.llvm /tmp/4/project.godot

Without debug symbols

================================================================
handle_crash: Program crashed with signal 4
Engine version: Godot Engine v4.0.dev.custom_build (8bb0f2aff1adf013155281756aec86984c095a76)
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /lib64/libc.so.6(+0x3d320) [0x7f7ad00d6320] (??:0)
[2] EditorNode::_notification(int) (??:?)
[3] EditorNode::_notificationv(int, bool) (??:?)
[4] Object::notification(int, bool) (??:?)
[5] Node::_propagate_ready() (??:?)
[6] Node::_propagate_ready() (??:?)
[7] Node::_set_tree(SceneTree*) (??:?)
[8] SceneTree::initialize() (??:?)
[9] OS_LinuxBSD::run() (??:?)
[10] bin/godot.linuxbsd.tools.64.llvm(main+0x1c6) [0x462dc36] (??:?)
[11] /lib64/libc.so.6(__libc_start_main+0xd5) [0x7f7ad00c0b75] (??:0)
[12] bin/godot.linuxbsd.tools.64.llvm(_start+0x2e) [0x462d9ae] (??:?)

WARNING: This backtrace does not include source information for most files.
As a result, this backtrace is probably not useful to include in a bug report.
To get a useful backtrace, compile a debug build (without stripping its symbols) and run the build until it crashes.

-- END OF BACKTRACE --
================================================================
[1]    26043 IOT instruction (core dumped)  bin/godot.linuxbsd.tools.64.llvm /tmp/4/project.godot

TODO

  • Port to Linux/*BSD.
  • Port to Windows.
  • Port to macOS.

@Calinou Calinou force-pushed the crash-handler-backtrace-warn-if-not-useful branch 2 times, most recently from dcb6e13 to be52385 Compare December 2, 2021 21:38
@Calinou Calinou added this to the 4.0 milestone Dec 2, 2021
This is caused by the binary not including debugging symbols.
Such backtraces generally not useful, as they don't pinpoint which
file is the cause of the crash (let alone the line number).
@Calinou Calinou force-pushed the crash-handler-backtrace-warn-if-not-useful branch from be52385 to 0dad28c Compare December 3, 2021 18:07
@Calinou Calinou changed the title Warn if the crash backtrace printed is missing debugging informatio Warn if the crash backtrace printed is missing debugging information Dec 3, 2021
@YuriSizov YuriSizov modified the milestones: 4.0, 4.x Feb 9, 2023
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