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

Very random crashes when executing SubViewport.set_size_2d_override_stretch #65456

Closed
qarmin opened this issue Sep 7, 2022 · 0 comments · Fixed by #65477
Closed

Very random crashes when executing SubViewport.set_size_2d_override_stretch #65456

qarmin opened this issue Sep 7, 2022 · 0 comments · Fixed by #65477

Comments

@qarmin
Copy link
Contributor

qarmin commented Sep 7, 2022

Godot version

4.0.alpha.custom_build. 4b164b8

System information

Ubuntu 22.04 - Nvidia GTX 970, Gnome shell 42 X11

Issue description

When executing random SubViewport function, then after a while(usually after 30min of project running in CI), I have this crash

drivers/vulkan/rendering_device_vulkan.cpp:9014:68: runtime error: index 8 out of bounds for type 'VkSampleCountFlagBits [7]'
=================================================================
==15042==ERROR: AddressSanitizer: global-buffer-overflow on address 0x55605079d800 at pc 0x55603a80e2e2 bp 0x7ffd22933f40 sp 0x7ffd22933f30
READ of size 4 at 0x55605079d800 thread T0
    #0 0x55603a80e2e1 in RenderingDeviceVulkan::_ensure_supported_sample_count(RenderingDevice::TextureSamples) const drivers/vulkan/rendering_device_vulkan.cpp:9014
    #1 0x55603a70ddf7 in RenderingDeviceVulkan::texture_create(RenderingDevice::TextureFormat const&, RenderingDevice::TextureView const&, Vector<Vector<unsigned char> > const&) drivers/vulkan/rendering_device_vulkan.cpp:1736
    #2 0x556048cf51ea in RendererRD::TextureStorage::_update_render_target(RendererRD::TextureStorage::RenderTarget*) servers/rendering/renderer_rd/storage_rd/texture_storage.cpp:2203
    #3 0x556048cfbf37 in RendererRD::TextureStorage::render_target_set_size(RID, int, int, unsigned int) servers/rendering/renderer_rd/storage_rd/texture_storage.cpp:2329
    #4 0x55604a4e467f in RendererViewport::viewport_set_size(RID, int, int) servers/rendering/renderer_viewport.cpp:840
    #5 0x556047e52272 in RenderingServerDefault::viewport_set_size(RID, int, int) servers/rendering/rendering_server_default.h:583
    #6 0x5560419a3c13 in Viewport::_set_size(Vector2i const&, Vector2i const&, Rect2i const&, Transform2D const&, bool) scene/main/viewport.cpp:799
    #7 0x556041a5ac96 in SubViewport::set_size_2d_override_stretch(bool) scene/main/viewport.cpp:4072
    #8 0x556033940369 in void call_with_variant_args_helper<__UnexistingClass, bool, 0ul>(__UnexistingClass*, void (__UnexistingClass::*)(bool), Variant const**, Callable::CallError&, IndexSequence<0ul>) core/variant/binder_common.h:262
    #9 0x556033939049 in void call_with_variant_args_dv<__UnexistingClass, bool>(__UnexistingClass*, void (__UnexistingClass::*)(bool), Variant const**, int, Callable::CallError&, Vector<Variant> const&) core/variant/binder_common.h:409
    #10 0x556033932620 in MethodBindT<bool>::call(Object*, Variant const**, int, Callable::CallError&) core/object/method_bind.h:320
    #11 0x55604c4be894 in Object::callp(StringName const&, Variant const**, int, Callable::CallError&) core/object/object.cpp:733
    #12 0x55604c4bd0cb in Object::callv(StringName const&, Array const&) core/object/object.cpp:670
    #13 0x55604c53b02c in void call_with_variant_args_ret_helper<__UnexistingClass, Variant, StringName const&, Array const&, 0ul, 1ul>(__UnexistingClass*, Variant (__UnexistingClass::*)(StringName const&, Array const&), Variant const**, Variant&, Callable::CallError&, IndexSequence<0ul, 1ul>) core/variant/binder_common.h:680
    #14 0x55604c534415 in void call_with_variant_args_ret_dv<__UnexistingClass, Variant, StringName const&, Array const&>(__UnexistingClass*, Variant (__UnexistingClass::*)(StringName const&, Array const&), Variant const**, int, Variant&, Callable::CallError&, Vector<Variant> const&) core/variant/binder_common.h:493
    #15 0x55604c52c80e in MethodBindTR<Variant, StringName const&, Array const&>::call(Object*, Variant const**, int, Callable::CallError&) core/object/method_bind.h:481
    #16 0x5560357d6917 in GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) modules/gdscript/gdscript_vm.cpp:1644
    #17 0x55603520bc71 in GDScriptInstance::callp(StringName const&, Variant const**, int, Callable::CallError&) modules/gdscript/gdscript.cpp:1627
    #18 0x55604c4be497 in Object::callp(StringName const&, Variant const**, int, Callable::CallError&) core/object/object.cpp:711
    #19 0x55604ba76de7 in Variant::callp(StringName const&, Variant const**, int, Variant&, Callable::CallError&) core/variant/variant_call.cpp:1048
    #20 0x5560357d444c in GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) modules/gdscript/gdscript_vm.cpp:1555
    #21 0x55603520bc71 in GDScriptInstance::callp(StringName const&, Variant const**, int, Callable::CallError&) modules/gdscript/gdscript.cpp:1627
    #22 0x5560417eb4c9 in bool Node::_gdvirtual__process_call<false>(double) scene/main/node.h:237
    #23 0x556041750f92 in Node::_notification(int) scene/main/node.cpp:56
    #24 0x556033e00319 in Node::_notificationv(int, bool) scene/main/node.h:45
    #25 0x55604c4bfd71 in Object::notification(int, bool) core/object/object.cpp:790
    #26 0x5560418aba3a in SceneTree::_notify_group_pause(StringName const&, int) scene/main/scene_tree.cpp:917
    #27 0x55604189c717 in SceneTree::process(double) scene/main/scene_tree.cpp:465
    #28 0x5560336e7c39 in Main::iteration() main/main.cpp:2992
    #29 0x55603352caf3 in OS_LinuxBSD::run() platform/linuxbsd/os_linuxbsd.cpp:538
    #30 0x556033513892 in main platform/linuxbsd/godot_linuxbsd.cpp:72
    #31 0x7fec82c06082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082)
    #32 0x55603351332d in _start (/home/runner/work/Qarminer/Qarminer/godot.linuxbsd.tools.x86_64.san+0x36e3632d)

0x55605079d800 is located 4 bytes to the right of global variable 'rasterization_sample_count' defined in 'drivers/vulkan/rendering_device_vulkan.cpp:1233:29' (0x55605079d7e0) of size 28
0x55605079d800 is located 32 bytes to the left of global variable 'logic_operations' defined in 'drivers/vulkan/rendering_device_vulkan.cpp:1243:17' (0x55605079d820) of size 64

This may be regression(probably happens max ~1 month)

if (sample_count_flags & rasterization_sample_count[sample_count]) {

Git blame shows that this lines were added in #63003 so CC @Geometror

Steps to reproduce

Not easily reproducible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants