godotengine / godot

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

Crash when reimporting modified OBJ scene #14335

Closed Zylann closed 6 years ago

Zylann commented 6 years ago

Godot 3.0 master Windows 10 64 bits, with MSVC debugger attached

I modified an existing OBJ file in my project by adding new meshes in it. I focused Godot, which began to reimport it (The scene containing it was also opened). Then 15 seconds later, it crashed and the debugger raised an exception with the following call stack:

script_instance seems to contains garbage (its address has a recognizable alternating pattern and its __vfptr is 0x0) but maybe this propagated from earlier. Unfortunately I can't see much more (StringName, String or any kind of Godot containers are opaque to my debugging interface :( )

image

Then I reopened Godot and the mesh appears to have been correctly imported.

This crash is random, it's not 100% repro so far.

Full log of the session, I just opened Godot, moved around, instanced a MeshInstance, removed it, decided I would do this in Blender, exported, got back to Godot and boom

Activated GL 3.3 contextOpenGL ES 3.0 Renderer: GeForce 940M/PCIe/SSE2
GLES3: max ubo light: 409
GLES3: max ubo reflections: 455, ubo size: 144
Boot splash path: res://splash.png
ARVR: Registered interface: Native mobile
ERROR: CanvasItem::get_viewport_rect: Condition ' !is_inside_tree() ' is true. returned: Rect2()
   At: scene\2d\canvas_item.cpp:803
ERROR: Control::show_modal: Condition ' !is_inside_tree() ' is true.
   At: scene\gui\control.cpp:2084
ERROR: CanvasItem::get_global_transform: Condition ' !is_inside_tree() ' is true. returned: get_transform()
   At: scene\2d\canvas_item.cpp:363
ERROR: CanvasItem::get_viewport_rect: Condition ' !is_inside_tree() ' is true. returned: Rect2()
   At: scene\2d\canvas_item.cpp:803
ERROR: Control::grab_focus: Condition ' !is_inside_tree() ' is true.
   At: scene\gui\control.cpp:2058
ERROR: Node::get_tree: Condition ' !data.tree ' is true. returned: 0
   At: D:\PROJETS\INFO\GODOT\ENGINE\godot_fork\scene/main/node.h:252
ERROR: EditorData::get_edited_scene_root: Index current_edited_scene=-1 out of size (edited_scene.size()=0)
   At: editor\editor_data.cpp:607
erasing C:\Users\Marc\AppData\Roaming/Godot/projects/Diptera-a2c10d474cabc46098766cab9016ae93/filesystem_update3
WARNING: SceneState::instance: Node './Plane.023_Plane.43' was modified from inside an instance, but it has vanished.
     At: scene\resources\packed_scene.cpp:148
ERROR: PopupMenu::set_item_checked: Index p_idx=-1163005939 out of size (items.size()=4)
   At: scene\gui\popup_menu.cpp:644
fragment uses function: triplanar_texture
fragment uses function: zero_if_equal
vertex uses function: unpack_normal
fragment uses function: unpack_normal
MUST RELOAD? 0
ERROR: EditorSpatialGizmo::intersect_ray: Condition ' !valid ' is true. returned: false
   At: editor\spatial_editor_gizmos.cpp:392
ERROR: EditorSpatialGizmo::intersect_ray: Condition ' !valid ' is true. returned: false
   At: editor\spatial_editor_gizmos.cpp:392
ERROR: EditorSpatialGizmo::intersect_ray: Condition ' !valid ' is true. returned: false
   At: editor\spatial_editor_gizmos.cpp:392
...
[thousands more...]
...
ERROR: EditorSpatialGizmo::intersect_ray: Condition ' !valid ' is true. returned: false
   At: editor\spatial_editor_gizmos.cpp:392
ERROR: EditorSpatialGizmo::intersect_ray: Condition ' !valid ' is true. returned: false
   At: editor\spatial_editor_gizmos.cpp:392
Warning: Ambient light for material 'Material' is ignored in PBR
Warning: Ambient light for material 'None' is ignored in PBR
current material library map2_bevel.mtl has 1
current material None has 1
Added surface :None
current material library map2_bevel.mtl has 1
current material None has 1
Added surface :None
current material library map2_bevel.mtl has 1
current material None has 1
Added surface :None
current material library map2_bevel.mtl has 1
current material Material has 1
Added surface :Material
ERROR: Node::set_name: Condition ' name == "" ' is true.
   At: scene\main\node.cpp:1142
SAVING TO: res://.import/map2_bevel.obj-bd63c7605b61116fca07d1e42810db64.scn
MUST RELOAD? 0
Press <RETURN> to close this window...
reduz commented 6 years ago

Haven't had problems with OBJ files. Would have liked to have an example of that OBJ scene. Closing for now, please reopen if you can have a reproduction sample.

Zylann commented 6 years ago

Like any random crash, I can't reproduce it like magic^^" Also I noticed that about half crashes I get are because MSVC debugger makes them more "likely" (because uninitialized memory is set to some kind of pattern)

reduz commented 6 years ago

If so, a test scene would still work, so it can run on sanitizer

On Dec 26, 2017 3:56 PM, "Marc" notifications@github.com wrote:

Like any random crash, I can't reproduce it like magic^^" Also I noticed that about half crashes I get are because MSVC debugger makes them more "likely" (because uninitialized memory is set to some kind of pattern)

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/14335#issuecomment-354000975, or mute the thread https://github.com/notifications/unsubscribe-auth/AF-Z2w6Ixg1VqA0MhlkjTZYEm7eZdvGAks5tEUFLgaJpZM4Q4lZf .

TheConceptBoy commented 2 years ago

Still experiencing crashing when importing new models but not updating existing ones. If your test won't crash, then I have a suspicion that maybe it's not the importer or file itself but instead something else that is in the project that is causing crashes as a side effect.

living room table.zip

Zireael07 commented 2 years ago

@TheConceptBoy: Considering the original issue is from 2017, I guess you're experiencing a new issue with a similar symptom. Open a new issue please.