godotengine / godot

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

Click active on for AnimationTree causes segfault. #23302

Closed spongeboburu closed 5 years ago

spongeboburu commented 6 years ago

Godot version: 3.1 master

OS/device including version: Fedora 28, 64-bit

Issue description: A tree animation setup in a test project, it is valid (i.e the animation is connected to out), when clicking "active on" to activate it there is a crash.

Little bt

Thread 1 "godot.x11.tools" received signal SIGSEGV, Segmentation fault.
0x000000000286a1c8 in AnimationTree::_process_graph (this=0x638a160, p_delta=0.0166666675) at scene/animation/animation_tree.cpp:823
823                 if (track->type != a->track_get_type(i)) {
(gdb) bt
#0  0x000000000286a1c8 in AnimationTree::_process_graph (this=0x638a160, p_delta=0.0166666675) at scene/animation/animation_tree.cpp:823
#1  0x000000000286da9b in AnimationTree::_notification (this=0x638a160, p_what=25) at scene/animation/animation_tree.cpp:1248
#2  0x0000000002871710 in AnimationTree::_notificationv (this=0x638a160, p_notification=25, p_reversed=false) at scene/animation/animation_tree.h:164
#3  0x0000000002f49a4a in Object::notification (this=0x638a160, p_notification=25, p_reversed=false) at core/object.cpp:978
#4  0x00000000022f5002 in SceneTree::_notify_group_pause (this=0x5c23f00, p_group=..., p_notification=25) at scene/main/scene_tree.cpp:958
#5  0x00000000022f2dbd in SceneTree::idle (this=0x5c23f00, p_time=0.0166666675) at scene/main/scene_tree.cpp:509
#6  0x0000000001143fa5 in Main::iteration () at main/main.cpp:1856
#7  0x0000000001119c79 in OS_X11::run (this=0x7fffffffd090) at platform/x11/os_x11.cpp:2817
#8  0x000000000110c8cf in main (argc=3, argv=0x7fffffffd7c8) at platform/x11/godot_x11.cpp:55
(gdb) p track
$1 = (AnimationTree::TrackCache *) 0x0

Steps to reproduce: I can only reproduce this bug in a specific project, I tried making new projects and basically the same thing, but some condition to induce the crash is missing. It is however consistently reproducible in the test project.

Minimal reproduction project: firstpersonshooter.zip

ibrahn commented 6 years ago

Something somewhere along the dae to godot path is very ill, illegal and uninitialised access all over the place, I've not managed to get a real handle on what's going on.

Of note in this case though: There's a node named door-colonly. At some stage during import, the -colonly is stripped off (using _fixstr in resource_importer_scene) for the node, but remains in the animations. So the animations can't find the node they're looking for.

Zireael07 commented 6 years ago

-colonly is, as the name suggests, used for creating collisions automatically when importing to Godot.

spongeboburu commented 6 years ago

This is indeed a problem with the export/import.

I guess I should've mentioned I manually edited the track paths so the animation would work. I filed a bug in the godot exporter (https://github.com/godotengine/collada-exporter/issues/89), but I'm thinking it's probably an import rather than export issue.

reduz commented 5 years ago

For reference, the problem here is that something that was a child of a -colonly was animated. When imported, the object was removed thus the animation path became invalid ( image) . Still it should not crash, will fix this asap: