godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.18k stars 21.2k forks source link

Editor sometimes crashes when selecting meshes with materials in the 3D viewport #69859

Closed jmdejong closed 1 year ago

jmdejong commented 1 year ago

Godot version

v4.0.beta.custom_build (1ac7e5a3343ef9f4ecc7c494f7212b7c718520c8)

System information

archlinux; nvidia RTX 3060 video card (proprietary drivers);

Issue description

When switching tabs to a tab that has the material editor open and is showing a material that has 'toon' specular shading, the editor crashes.

$ godot.linuxbsd.editor.x86_64 project.godot 
Godot Engine v4.0.beta.custom_build.1ac7e5a33 - https://godotengine.org
Vulkan API 1.3.224 - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce RTX 3060 Laptop GPU

WARNING: Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
     at: _editor_init (modules/gltf/register_types.cpp:61)
WARNING: FBX file import is enabled in the project settings, but no FBX2glTF path is configured in the editor settings. FBX files will not be imported.
     at: _editor_init (modules/gltf/register_types.cpp:85)

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.beta.custom_build (1ac7e5a3343ef9f4ecc7c494f7212b7c718520c8)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x38a00) [0x7f792495ea00] (??:0)
[2] godot.linuxbsd.editor.x86_64(+0x4d40a8d) [0x556ccf212a8d] (??:0)
[3] godot.linuxbsd.editor.x86_64(+0x22dc7c5) [0x556ccc7ae7c5] (??:0)
[4] godot.linuxbsd.editor.x86_64(+0x1ccfe38) [0x556ccc1a1e38] (??:0)
[5] godot.linuxbsd.editor.x86_64(+0x4a241b6) [0x556cceef61b6] (??:0)
[6] godot.linuxbsd.editor.x86_64(+0x475dfd7) [0x556ccec2ffd7] (??:0)
[7] godot.linuxbsd.editor.x86_64(+0x4a1f969) [0x556cceef1969] (??:0)
[8] godot.linuxbsd.editor.x86_64(+0x4a1fcac) [0x556cceef1cac] (??:0)
[9] godot.linuxbsd.editor.x86_64(+0x2b9609f) [0x556ccd06809f] (??:0)
[10] godot.linuxbsd.editor.x86_64(+0xae0f3b) [0x556ccafb2f3b] (??:0)
[11] godot.linuxbsd.editor.x86_64(+0xa89431) [0x556ccaf5b431] (??:0)
[12] godot.linuxbsd.editor.x86_64(+0xa7b8e9) [0x556ccaf4d8e9] (??:0)
[13] /usr/lib/libc.so.6(+0x23290) [0x7f7924949290] (??:0)
[14] /usr/lib/libc.so.6(__libc_start_main+0x8a) [0x7f792494934a] (??:0)
[15] godot.linuxbsd.editor.x86_64(+0xa87725) [0x556ccaf59725] (??:0)
-- END OF BACKTRACE --
================================================================
Aborted (core dumped)

Steps to reproduce

After crashing once it might crash immediately when starting the editor. Removing the .godot folder seems to prevent that

Minimal reproduction project

tooncrash.zip

Calinou commented 1 year ago

I think the node selection is the issue, not the toon material part. I've had numerous crashes when clicking meshes in the 3D editor viewport in 4.0.beta f692b4768 (a good dozen or so at this point).

jmdejong commented 1 year ago

I just checked and the crash happens indeed when no shader is selected.

It just crashes when going to the tab of a scene where the (standard) material editor is opened.

lostminds commented 1 year ago

I'm also getting reproducable crashes every time I'm clicking meshes (simple plane meshinstance3d with a shader material) to select them in the viewport on 4.0.beta8 on macOS 13. However, clicking the same meshes in the node tree to select them works fine, so at least in my case it's something to do with viewport click selection rather than node selection in general.

Calinou commented 1 year ago

Can you reproduce this in any of the earlier 4.0 betas to determine when the regression started?

lostminds commented 1 year ago

Just tried it now on 4.0.beta7 and it didn't crash there selecting a mesh that crashes the editor if I click it in beta8

lostminds commented 1 year ago

Tried it now in beta 9 and it doesn't crash clicking the mesh in the viewport. So maybe it was just in beta 8?

akien-mga commented 1 year ago

Confirmed, the MRP crashes in beta 8 but doesn't crash in beta 9, so it seems this was fixed.