godot: Game crashes if it has a 3D camera and windowsize is reduced to 1 pixel wide/tall.
Godot version: Godot 3.0.3
OS/device including version: Ubuntu 18.04 64bit on AMD Cayman (HD 6950) and Mesa 18.0.0-rc5. Intel® Core™ i5-4570 CPU @ 3.20GHz × 4
Issue description: In a 3d scene with camera, if scene is played in windowed mode and the user reduces the size of the window to 1 pixel (or less) tall or wide, the game will silently crash.
This bug gives the following terminal output when launched from Godot editor
ERROR: operator[]: FATAL: Index p_index=0 out of size (size()=0)
At: core/vector.h:138.
handle_crash: Program crashed with signal 4
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f995f509f20] (??:0)
[2] /home/johannesg/bin/Godot_v3.0.3-stable_x11.64() [0xbd5267] (<artificial>:?)
[3] /home/johannesg/bin/Godot_v3.0.3-stable_x11.64() [0xc0af84] (<artificial>:?)
[4] /home/johannesg/bin/Godot_v3.0.3-stable_x11.64() [0xc84ffa] (<artificial>:?)
[5] /home/johannesg/bin/Godot_v3.0.3-stable_x11.64() [0x176879d] (<artificial>:?)
[6] /home/johannesg/bin/Godot_v3.0.3-stable_x11.64() [0x1769377] (<artificial>:?)
[7] /home/johannesg/bin/Godot_v3.0.3-stable_x11.64() [0x1784be0] (<artificial>:?)
[8] /home/johannesg/bin/Godot_v3.0.3-stable_x11.64() [0x17872d1] (<artificial>:?)
[9] /home/johannesg/bin/Godot_v3.0.3-stable_x11.64() [0x85e435] (??:?)
[10] /home/johannesg/bin/Godot_v3.0.3-stable_x11.64() [0x6ce7ad] (??:?)
[11] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f995f4ecb97] (??:0)
[12] /home/johannesg/bin/Godot_v3.0.3-stable_x11.64() [0x6dabbe] (??:?)
-- END OF BACKTRACE --
This bug gives the following terminal output when the project is exported and launched directly.
ERROR: operator[]: FATAL: Index p_index=0 out of size (size()=0)
At: core/vector.h:138.
Illegal instruction (core dumped)
Steps to reproduce:
- Create a new scene with only a 3d Camera.
- Play the scene
- Resize window so that it takes up as little vertical or horizontal space as possible. 1 pixel or less.
Minimal reproduction project:
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (15 by maintainers)
Commits related to this issue
- Merge pull request #20026 from taylorjoshuaw/fix-window-height-crash Temporary fix to issue #19628 and #19207 — committed to godotengine/godot by mhilbrunner 6 years ago
- Don't post process on tiny render targets, fixes #19628 (cherry picked from commit a78b42c058cecc939b54101956b5ca9a7b415c85) — committed to akien-mga/godot by reduz 6 years ago
I should correct my own previous statement : it’s also crashing in X11 with glow enabled 😢 Thanks to @lekoder narrowing down the problem, I found that it is coming from this line :
in file rasterizer_scene_gles3.cpp (around line 3931). The problem is that when the window is reduced to 0 in width or height, the array
storage->frame.current_rt->effects.mip_maps[0].sizes
only has 1 dimension, so trying to acces[i+1]
is impossible,i
having a value from0
tomax_glow_level+1
My first try was simply
and no more crash no matter how I resized the window, but it’s like the first bug from the OP, I just put a patch, not a solution 🤔 For the solution, I don’t exactly know how to correct it, @taylorjoshuaw could you please take a look at it ?
Hi,
I can confirm this bug using master from 5c5aafa
I could trace it down to RasterizerSceneGLES3::_post_process in file drivers/gles3/rasterizer_scene_gles3.cpp
Here is the result of exporting test project in debug and reducing window’s height down to 0 :
Only solution I found to limit this problem was to add
just before
in function
_post_process
around line 3584 in file drivers/gles3/rasterizer_scene_gles3.cppBut I think the real solution would be to find why the array storage->frame.current_rt->effects.mip_maps[0].sizes becomes null… am I wrong ?