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

[crash] Segfault while attempting to play() a length-changed animation #403

Closed
bertiebaggio opened this issue May 11, 2014 · 4 comments
Closed

Comments

@bertiebaggio
Copy link

Preamble: crash seems to be caused by calling SomeAnimationNode.play("animation", -1, -1, false) to play an animation backwards when that animation has had its length changed.

In my scenario, it was an animation that previously played fine forwards and backwards, but I shortened it to 1 second (from 10s). After this calling play() as above caused the segfault detailed below.

Deleting and re-creating the animation solved the crash. I would speculate it may be related to similar occurences, such as physics bodies not colliding because the associated collision shape has been 'forgotten'; here recreating the shape also solves the issue.


 gdb output with backtrace:


    Program received signal SIGSEGV, Segmentation fault.
    0x083a33d0 in Ref<Animation>::operator-> (this=0xc) at core/reference.h:120
    120                     return reference;

    (gdb) backtrace
    #0  0x083a33d0 in Ref<Animation>::operator-> (this=0xc) at core/reference.h:120
    #1  0x087dc31b in AnimationPlayer::play (this=0x9cfa6c0, p_name=..., p_custom_blend=-1, p_custom_scale=-1, p_from_end=true)
        at scene/animation/animation_player.cpp:910
    #2  0x087e907f in MethodBind4<StringName const&, float, float, bool>::call (this=0x9a3c6a0, p_object=0x9cfa6c0, p_args=0xbfffd94c,
        p_arg_count=4, r_error=...) at core/method_bind.inc:2391
    #3  0x08b33ab0 in Object::call (this=0x9cfa6c0, p_method=..., p_args=0xbfffd94c, p_argcount=4, r_error=...) at core/object.cpp:890
    #4  0x08b9e9d1 in Variant::call (this=0xbfffd8d4, p_method=..., p_args=0xbfffd94c, p_argcount=4, r_error=...) at core/variant_call.cpp:857
    #5  0x080b3ee0 in GDFunction::call (this=0x9bc22cc, p_instance=0x9ba4590, p_args=0xbfffe0c4, p_argcount=0, r_err=...)
        at modules/gdscript/gd_script.cpp:631
    #6  0x080bb546 in GDInstance::call (this=0x9ba4590, p_method=..., p_args=0xbfffe0c4, p_argcount=0, r_error=...)
        at modules/gdscript/gd_script.cpp:1945
    #7  0x08b339b1 in Object::call (this=0x9ba4040, p_method=..., p_args=0xbfffe0c4, p_argcount=0, r_error=...) at core/object.cpp:869
    #8  0x08b9e9d1 in Variant::call (this=0x9ce94ac, p_method=..., p_args=0xbfffe0c4, p_argcount=0, r_error=...) at core/variant_call.cpp:857
    #9  0x080b3ee0 in GDFunction::call (this=0x9ba907c, p_instance=0x9ce9460, p_args=0xbfffe780, p_argcount=1, r_err=...)
        at modules/gdscript/gd_script.cpp:631
    #10 0x080bb5ee in GDInstance::call_multilevel (this=0x9ce9460, p_method=..., p_args=0xbfffe780, p_argcount=1)
        at modules/gdscript/gd_script.cpp:1961
    #11 0x08b32fb8 in Object::call_multilevel (this=0x9ce90c0, p_method=..., p_args=0xbfffe780, p_argcount=1) at core/object.cpp:609
    #12 0x085e94be in SceneMainLoop::_call_input_pause (this=0x9b4ffa0, p_group=..., p_method=..., p_input=...) at scene/main/scene_main_loop.cpp:667
    #13 0x085c59bb in Viewport::input (this=0x9b500a0, p_event=...) at scene/main/viewport.cpp:879
    #14 0x085c5870 in Viewport::_vp_input (this=0x9b500a0, p_ev=...) at scene/main/viewport.cpp:858
    #15 0x082c210f in MethodBind1<InputEvent const&>::call (this=0x99dee40, p_object=0x9b500a0, p_args=0xbfffea34, p_arg_count=1, r_error=...)
        at core/method_bind.inc:609
    #16 0x08b33ab0 in Object::call (this=0x9b500a0, p_method=..., p_args=0xbfffea34, p_argcount=1, r_error=...) at core/object.cpp:890
    #17 0x08b3369d in Object::call (this=0x9b500a0, p_name=..., p_arg1=..., p_arg2=..., p_arg3=..., p_arg4=..., p_arg5=...) at core/object.cpp:766
    #18 0x085e7c4f in SceneMainLoop::call_group (this=0x9b4ffa0, p_call_flags=2, p_group=..., p_function=..., p_arg1=..., p_arg2=..., p_arg3=...,
        p_arg4=..., p_arg5=...) at scene/main/scene_main_loop.cpp:207
    #19 0x085e8698 in SceneMainLoop::input_event (this=0x9b4ffa0, p_event=...) at scene/main/scene_main_loop.cpp:418
    #20 0x08be6049 in InputDefault::parse_input_event (this=0x9747ed0, p_event=...) at core/os/input.cpp:245
    #21 0x0805031a in OS_X11::handle_key_event (this=0xbffff170, p_event=0xbfffef5c) at platform/x11/os_x11.cpp:655
    #22 0x08050c23 in OS_X11::process_xevents (this=0xbffff170) at platform/x11/os_x11.cpp:843
    #23 0x08051f67 in OS_X11::run (this=0xbffff170) at platform/x11/os_x11.cpp:1275
    #24 0x0804df2b in main (argc=3, argv=0xbffff4d4) at platform/x11/godot_x11.cpp:41

More info available on request.

@reduz
Copy link
Member

reduz commented May 11, 2014

nice find, this was a weird bug, it seems it was triggered when playing
animaitons backwards

On Sun, May 11, 2014 at 11:59 AM, bertiebaggio notifications@github.comwrote:

Preamble: crash seems to be caused by calling
SomeAnimationNode.play("animation", -1, -1, false) to play an animation
backwards when that animation has had its length changed.

In my scenario, it was an animation that previously played fine forwards
and backwards, but I shortened it to 1 second (from 10s). After this
calling play() as above caused the segfault detailed below.

Deleting and re-creating the animation solved the crash. I would speculate
it may be related to similar occurences, such as physics bodies not
colliding because the associated collision shape has been 'forgotten'; here
recreating the shape also solves the issue.

gdb output with backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x083a33d0 in Ref<Animation>::operator-> (this=0xc) at core/reference.h:120
120                     return reference;

(gdb) backtrace
#0  0x083a33d0 in Ref<Animation>::operator-> (this=0xc) at core/reference.h:120
#1  0x087dc31b in AnimationPlayer::play (this=0x9cfa6c0, p_name=..., p_custom_blend=-1, p_custom_scale=-1, p_from_end=true)
    at scene/animation/animation_player.cpp:910
#2  0x087e907f in MethodBind4<StringName const&, float, float, bool>::call (this=0x9a3c6a0, p_object=0x9cfa6c0, p_args=0xbfffd94c,
    p_arg_count=4, r_error=...) at core/method_bind.inc:2391
#3  0x08b33ab0 in Object::call (this=0x9cfa6c0, p_method=..., p_args=0xbfffd94c, p_argcount=4, r_error=...) at core/object.cpp:890
#4  0x08b9e9d1 in Variant::call (this=0xbfffd8d4, p_method=..., p_args=0xbfffd94c, p_argcount=4, r_error=...) at core/variant_call.cpp:857
#5  0x080b3ee0 in GDFunction::call (this=0x9bc22cc, p_instance=0x9ba4590, p_args=0xbfffe0c4, p_argcount=0, r_err=...)
    at modules/gdscript/gd_script.cpp:631
#6  0x080bb546 in GDInstance::call (this=0x9ba4590, p_method=..., p_args=0xbfffe0c4, p_argcount=0, r_error=...)
    at modules/gdscript/gd_script.cpp:1945
#7  0x08b339b1 in Object::call (this=0x9ba4040, p_method=..., p_args=0xbfffe0c4, p_argcount=0, r_error=...) at core/object.cpp:869
#8  0x08b9e9d1 in Variant::call (this=0x9ce94ac, p_method=..., p_args=0xbfffe0c4, p_argcount=0, r_error=...) at core/variant_call.cpp:857
#9  0x080b3ee0 in GDFunction::call (this=0x9ba907c, p_instance=0x9ce9460, p_args=0xbfffe780, p_argcount=1, r_err=...)
    at modules/gdscript/gd_script.cpp:631
#10 0x080bb5ee in GDInstance::call_multilevel (this=0x9ce9460, p_method=..., p_args=0xbfffe780, p_argcount=1)
    at modules/gdscript/gd_script.cpp:1961
#11 0x08b32fb8 in Object::call_multilevel (this=0x9ce90c0, p_method=..., p_args=0xbfffe780, p_argcount=1) at core/object.cpp:609
#12 0x085e94be in SceneMainLoop::_call_input_pause (this=0x9b4ffa0, p_group=..., p_method=..., p_input=...) at scene/main/scene_main_loop.cpp:667
#13 0x085c59bb in Viewport::input (this=0x9b500a0, p_event=...) at scene/main/viewport.cpp:879
#14 0x085c5870 in Viewport::_vp_input (this=0x9b500a0, p_ev=...) at scene/main/viewport.cpp:858
#15 0x082c210f in MethodBind1<InputEvent const&>::call (this=0x99dee40, p_object=0x9b500a0, p_args=0xbfffea34, p_arg_count=1, r_error=...)
    at core/method_bind.inc:609
#16 0x08b33ab0 in Object::call (this=0x9b500a0, p_method=..., p_args=0xbfffea34, p_argcount=1, r_error=...) at core/object.cpp:890
#17 0x08b3369d in Object::call (this=0x9b500a0, p_name=..., p_arg1=..., p_arg2=..., p_arg3=..., p_arg4=..., p_arg5=...) at core/object.cpp:766
#18 0x085e7c4f in SceneMainLoop::call_group (this=0x9b4ffa0, p_call_flags=2, p_group=..., p_function=..., p_arg1=..., p_arg2=..., p_arg3=...,
    p_arg4=..., p_arg5=...) at scene/main/scene_main_loop.cpp:207
#19 0x085e8698 in SceneMainLoop::input_event (this=0x9b4ffa0, p_event=...) at scene/main/scene_main_loop.cpp:418
#20 0x08be6049 in InputDefault::parse_input_event (this=0x9747ed0, p_event=...) at core/os/input.cpp:245
#21 0x0805031a in OS_X11::handle_key_event (this=0xbffff170, p_event=0xbfffef5c) at platform/x11/os_x11.cpp:655
#22 0x08050c23 in OS_X11::process_xevents (this=0xbffff170) at platform/x11/os_x11.cpp:843
#23 0x08051f67 in OS_X11::run (this=0xbffff170) at platform/x11/os_x11.cpp:1275
#24 0x0804df2b in main (argc=3, argv=0xbffff4d4) at platform/x11/godot_x11.cpp:41

More info available on request.


Reply to this email directly or view it on GitHubhttps://github.com//issues/403
.

@reduz
Copy link
Member

reduz commented May 11, 2014

will push fixes later tonight

On Sun, May 11, 2014 at 1:13 PM, Juan Linietsky reduzio@gmail.com wrote:

nice find, this was a weird bug, it seems it was triggered when playing
animaitons backwards

On Sun, May 11, 2014 at 11:59 AM, bertiebaggio notifications@github.comwrote:

Preamble: crash seems to be caused by calling
SomeAnimationNode.play("animation", -1, -1, false) to play an animation
backwards when that animation has had its length changed.

In my scenario, it was an animation that previously played fine forwards
and backwards, but I shortened it to 1 second (from 10s). After this
calling play() as above caused the segfault detailed below.

Deleting and re-creating the animation solved the crash. I would
speculate it may be related to similar occurences, such as physics bodies
not colliding because the associated collision shape has been 'forgotten';
here recreating the shape also solves the issue.

gdb output with backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x083a33d0 in Ref<Animation>::operator-> (this=0xc) at core/reference.h:120
120                     return reference;

(gdb) backtrace
#0  0x083a33d0 in Ref<Animation>::operator-> (this=0xc) at core/reference.h:120
#1  0x087dc31b in AnimationPlayer::play (this=0x9cfa6c0, p_name=..., p_custom_blend=-1, p_custom_scale=-1, p_from_end=true)
    at scene/animation/animation_player.cpp:910
#2  0x087e907f in MethodBind4<StringName const&, float, float, bool>::call (this=0x9a3c6a0, p_object=0x9cfa6c0, p_args=0xbfffd94c,
    p_arg_count=4, r_error=...) at core/method_bind.inc:2391
#3  0x08b33ab0 in Object::call (this=0x9cfa6c0, p_method=..., p_args=0xbfffd94c, p_argcount=4, r_error=...) at core/object.cpp:890
#4  0x08b9e9d1 in Variant::call (this=0xbfffd8d4, p_method=..., p_args=0xbfffd94c, p_argcount=4, r_error=...) at core/variant_call.cpp:857
#5  0x080b3ee0 in GDFunction::call (this=0x9bc22cc, p_instance=0x9ba4590, p_args=0xbfffe0c4, p_argcount=0, r_err=...)
    at modules/gdscript/gd_script.cpp:631
#6  0x080bb546 in GDInstance::call (this=0x9ba4590, p_method=..., p_args=0xbfffe0c4, p_argcount=0, r_error=...)
    at modules/gdscript/gd_script.cpp:1945
#7  0x08b339b1 in Object::call (this=0x9ba4040, p_method=..., p_args=0xbfffe0c4, p_argcount=0, r_error=...) at core/object.cpp:869
#8  0x08b9e9d1 in Variant::call (this=0x9ce94ac, p_method=..., p_args=0xbfffe0c4, p_argcount=0, r_error=...) at core/variant_call.cpp:857
#9  0x080b3ee0 in GDFunction::call (this=0x9ba907c, p_instance=0x9ce9460, p_args=0xbfffe780, p_argcount=1, r_err=...)
    at modules/gdscript/gd_script.cpp:631
#10 0x080bb5ee in GDInstance::call_multilevel (this=0x9ce9460, p_method=..., p_args=0xbfffe780, p_argcount=1)
    at modules/gdscript/gd_script.cpp:1961
#11 0x08b32fb8 in Object::call_multilevel (this=0x9ce90c0, p_method=..., p_args=0xbfffe780, p_argcount=1) at core/object.cpp:609
#12 0x085e94be in SceneMainLoop::_call_input_pause (this=0x9b4ffa0, p_group=..., p_method=..., p_input=...) at scene/main/scene_main_loop.cpp:667
#13 0x085c59bb in Viewport::input (this=0x9b500a0, p_event=...) at scene/main/viewport.cpp:879
#14 0x085c5870 in Viewport::_vp_input (this=0x9b500a0, p_ev=...) at scene/main/viewport.cpp:858
#15 0x082c210f in MethodBind1<InputEvent const&>::call (this=0x99dee40, p_object=0x9b500a0, p_args=0xbfffea34, p_arg_count=1, r_error=...)
    at core/method_bind.inc:609
#16 0x08b33ab0 in Object::call (this=0x9b500a0, p_method=..., p_args=0xbfffea34, p_argcount=1, r_error=...) at core/object.cpp:890
#17 0x08b3369d in Object::call (this=0x9b500a0, p_name=..., p_arg1=..., p_arg2=..., p_arg3=..., p_arg4=..., p_arg5=...) at core/object.cpp:766
#18 0x085e7c4f in SceneMainLoop::call_group (this=0x9b4ffa0, p_call_flags=2, p_group=..., p_function=..., p_arg1=..., p_arg2=..., p_arg3=...,
    p_arg4=..., p_arg5=...) at scene/main/scene_main_loop.cpp:207
#19 0x085e8698 in SceneMainLoop::input_event (this=0x9b4ffa0, p_event=...) at scene/main/scene_main_loop.cpp:418
#20 0x08be6049 in InputDefault::parse_input_event (this=0x9747ed0, p_event=...) at core/os/input.cpp:245
#21 0x0805031a in OS_X11::handle_key_event (this=0xbffff170, p_event=0xbfffef5c) at platform/x11/os_x11.cpp:655
#22 0x08050c23 in OS_X11::process_xevents (this=0xbffff170) at platform/x11/os_x11.cpp:843
#23 0x08051f67 in OS_X11::run (this=0xbffff170) at platform/x11/os_x11.cpp:1275
#24 0x0804df2b in main (argc=3, argv=0xbffff4d4) at platform/x11/godot_x11.cpp:41

More info available on request.


Reply to this email directly or view it on GitHubhttps://github.com//issues/403
.

@bertiebaggio
Copy link
Author

Excellent thanks!

@adolson
Copy link
Contributor

adolson commented Dec 9, 2014

close

@reduz reduz closed this as completed Dec 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants