-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Crash if inspector tooltip is dismissed when saving scene #91652
Comments
I haven't been able to reproduce this on my system, so debugging is difficult for me. What build options did you use? Or other tips on how I can reproduce the problem?
I would guess this is due to 1. input forwarding: Lines 3774 to 3784 in e001bc7
2. connected signals, since there is Lines 3842 to 3847 in e001bc7
3. using godot/editor/editor_inspector.cpp Lines 987 to 988 in e001bc7
|
Also can't reproduce. I'm on Windows. |
Mainly an ASan enabled build:
|
Thanks, I reproduced the bug with these options, I'll take a look. |
I found the root of the problem, but I'm not sure how to solve it. Full stack traceDetails
Filtered stack trace
Description0. Freeing the popupI added the following debug code so that the subsequent line numbers in Line 3763 in 107fd30
case NOTIFICATION_PREDELETE:
print_line("EditorHelpBitTooltip NOTIFICATION_PREDELETE"); // <-- Breakpoint.
break; 8-9.
|
#ifndef ANDROID_ENABLED | |
Main::iteration(); // this will not work on a lot of platforms, so it's only meant for the editor | |
#endif |
29. EditorHelpBitTooltip::_input_from_window()
calls push_input()
Forward the input event to the parent viewport.
Lines 3774 to 3784 in 107fd30
// Forwards non-mouse input to the parent viewport. | |
void EditorHelpBitTooltip::_input_from_window(const Ref<InputEvent> &p_event) { | |
if (p_event->is_action_pressed(SNAME("ui_cancel"), false, true)) { | |
hide(); // Will be deleted on its timer. | |
} else { | |
const Ref<InputEventMouse> mouse_event = p_event; | |
if (mouse_event.is_null()) { | |
get_parent_viewport()->push_input(p_event); | |
} | |
} | |
} |
30. One step before crash
Line 1622: this
is freed (EditorHelpBitTooltip
< PopupPanel
< Popup
< Window
).
Line 1624: We call its method is_inside_tree()
.
Lines 1619 to 1626 in 107fd30
// If the event needs to be handled in a Window-derived class, then it should overwrite | |
// `_input_from_window` instead of subscribing to the `window_input` signal, because the signal | |
// filters out internal events. | |
_input_from_window(p_ev); | |
if (p_ev->get_device() != InputEvent::DEVICE_ID_INTERNAL && is_inside_tree()) { | |
emit_signal(SceneStringNames::get_singleton()->window_input, p_ev); | |
} |
And then the crash from the first post:
==21556==ERROR: AddressSanitizer: heap-use-after-free on address 0x5200002d4380 at pc 0x63e4ad49bcbb bp 0x7ffe13c5d1a0 sp 0x7ffe13c5d190
READ of size 4 at 0x5200002d4380 thread T0
#0 0x63e4ad49bcba in Node::is_inside_tree() const scene/main/node.h:449
#1 0x63e4b31b84b5 in Window::_window_input(Ref<InputEvent> const&) scene/main/window.cpp:1624
Tested versions
master[7cdad33]
System information
Godot v4.3.dev (7cdad33) - Arch Linux #1 SMP PREEMPT_DYNAMIC Thu, 02 May 2024 17:49:46 +0000 - X11 - GLES3 (Compatibility) - NVIDIA GeForce RTX 3060 Ti (nvidia; 550.78) - 13th Gen Intel(R) Core(TM) i5-13400F (16 Threads)
Issue description
Saving scene won't dismiss inspector's tooltip. But if you move the mouse cursor out of the tooltip area when saving scene, the tooltip is dismissed and the editor crashes.
Peek.2024-05-07.16-49.mp4
ASan Output
Steps to reproduce
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: