Closed qarmin closed 1 year ago
The Control node has not been added to the tree, so the cached theme property has not been updated.
This is a regression after using cached theme properties. It may be necessary to check the get_minimum_size
of all Control derived classes.
Edit:
The same check may be required for StyleBox
.
Maybe it would be better to defer set_size
to NOTIFICATION_POST_ENTER_TREE
.
There is a lot of other crashes related to theme_cache
.
With this build option I cannot open editor due other crash
scene/gui/tab_container.cpp:289:52: runtime error: member access within null pointer of type 'struct Texture2D'
================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.beta.custom_build (e69b7083d45c5d8698508cce7086d361c4b1f44c)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] ./godot.linuxbsd.editor.dev.x86_64.san(+0x286fa7f4) [0x56419079b7f4] (??:0)
[2] /lib/x86_64-linux-gnu/libc.so.6(+0x43090) [0x7f4469480090] (??:0)
[3] TabContainer::_update_margins() (??:0)
[4] TabContainer::set_popup(Node*) (??:0)
[5] EditorNode::EditorNode() (??:0)
[6] Main::start() (??:0)
[7] ./godot.linuxbsd.editor.dev.x86_64.san(main+0x3ce) [0x5641907989b7] (??:0)
[8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f4469461083] (??:0)
[9] ./godot.linuxbsd.editor.dev.x86_64.san(_start+0x2e) [0x56419079852e] (??:0)
-- END OF BACKTRACE --
================================================================
Aborted (core dumped)
in this line
int menu_width = theme_cache.menu_icon->get_width();
Probably crash happens, because svg module is disabled and not produce any valid files, but not sure about it
Edit: After enabling svg module, there is no crash anymore
I don't see how it is related to theme cache, if it depends on which module is or is not available. Theme cache does just that, it caches the return values of the theme fetching methods. There can be issues with some null values in cache, but they are related to the order of operation in control's code, not which modules we have enabled. So if having SVG disabled makes theme methods return null pointers, then it's a problem with general theming code.
Perhaps the correct fallback value is never hit, but I also don't think we have a correct fallback value for icons. And we don't have guards for absolutely every theme sub-resource that we use throughout the codebase... I guess we should bundle some raster image with the engine to fallback to.
Godot version
4.0.alpha.custom_build. 4b164b8e4
System information
Ubuntu 22.04 - Nvidia GTX 970, Gnome shell 42 X11
Issue description
I used minimal Godot editor build, compiled with this command:
Prebuild binaries for linux can be found here - https://github.com/qarmin/GodotBuilds/actions (just choose latest build and dowload "Editor Minimal" or "Editor Minimal Sanitizers")
When executing
Godot crashes with this backtrace
This example was found by Godot fuzzer - Qarminer, so it is quite unlikelly that this code could be used in real project, but still this should be handled gracefully.
Steps to reproduce
Above
Minimal reproduction project
No response