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 when the skeleton of a Polygon2d was removed #20677

Closed
ghost opened this issue Aug 2, 2018 · 4 comments
Closed

Crash when the skeleton of a Polygon2d was removed #20677

ghost opened this issue Aug 2, 2018 · 4 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Aug 2, 2018

Godot version:
v3.1.dev.calinou.6c569c9

OS/device including version:
Ubuntu 18.04

Issue description:
Godot Engine crashed and close when the skeleton of a Polygon2d was removed,

Steps to reproduce:
Add a Skeleton2d to a Polygon2d, sync bones, then paint vertex and then try to remove the skeleton clicking the "Broom" icon of Polygon2D's Skeleton property in the inspector.

Minimal reproduction project:
polygon2d.zip

@akien-mga akien-mga added this to the 3.1 milestone Aug 13, 2018
@reduz
Copy link
Member

reduz commented Aug 24, 2018

I can't reproduce. I added some extra checks but still not sure how this could cause a crash. More information or trying to reproduce the crash with a more recent build would be appreciated.

reduz added a commit that referenced this issue Aug 24, 2018
@ghost
Copy link
Author

ghost commented Aug 25, 2018

Well, that's weird. I download the most recent build and the same file above, and make the same things.
When I click the broom icon, the editor closes.
screenshot_20180825_084250

Output:

handle_crash: Program crashed with signal 11
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f9016d39f20] (??:0)
[2] /tmp/.mount_godot-bN0wfc/usr/bin/godot() [0x1470ad4] (??:0)
[3] /tmp/.mount_godot-bN0wfc/usr/bin/godot() [0x1470d59] (??:0)
[4] /tmp/.mount_godot-bN0wfc/usr/bin/godot() [0x18a13ea] (??:0)
[5] /tmp/.mount_godot-bN0wfc/usr/bin/godot() [0x18a6647] (??:0)
[6] /tmp/.mount_godot-bN0wfc/usr/bin/godot() [0x22a0934] (??:0)
[7] /tmp/.mount_godot-bN0wfc/usr/bin/godot() [0x18154e9] (??:0)
[8] /tmp/.mount_godot-bN0wfc/usr/bin/godot() [0x489ea5] (??:0)
[9] /tmp/.mount_godot-bN0wfc/usr/bin/godot() [0x22a56ee] (??:0)
[10] /tmp/.mount_godot-bN0wfc/usr/bin/godot() [0x226da41] (??:0)
[11] /tmp/.mount_godot-bN0wfc/usr/bin/godot() [0x226dcdf] (??:0)
[12] /tmp/.mount_godot-bN0wfc/usr/bin/godot() [0x145b5ec] (??:0)
[13] /tmp/.mount_godot-bN0wfc/usr/bin/godot() [0x435ebf] (??:0)
[14] /tmp/.mount_godot-bN0wfc/usr/bin/godot() [0x421841] (??:0)
[15] /tmp/.mount_godot-bN0wfc/usr/bin/godot() [0x41403f] (??:0)
[16] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f9016d1cb97] (??:0)
[17] /tmp/.mount_godot-bN0wfc/usr/bin/godot() [0x4178cf] (??:0)
-- END OF BACKTRACE --

Also happen when I try to do this, from a new project.

@akien-mga
Copy link
Member

akien-mga commented Aug 26, 2018

I can reproduce it with the provided project and the steps to reproduce (click the "Broom" icon of Polygon2D's Skeleton property in the inspector).

Stacktrace:

Thread 1 "godot-git" received signal SIGSEGV, Segmentation fault.
0x000000000277b83b in Node::_get_node (this=0x0, p_path=...) at scene/main/node.cpp:1238
1238            if (!data.inside_tree && p_path.is_absolute()) {
#0  0x000000000277b83b in Node::_get_node (this=0x0, p_path=...) at scene/main/node.cpp:1238
        __FUNCTION__ = "_get_node"
        current = 0x12c7e0e0
        root = 0x12c7e0e0
#1  0x000000000277bee9 in Node::has_node (this=0x0, p_path=...) at scene/main/node.cpp:1311
No locals.
#2  0x0000000002e186e0 in Polygon2D::_notification (this=0x12be2330, p_what=30) at scene/2d/polygon_2d.cpp:215
        bone = 0xf24f70 <_start>
        bone_index = 32767
        r = {<PoolVector<float>::Access> = {_vptr.Access = 0x0, alloc = 0x100000000000000, mem = 0x174aba90}, <No data fields>}
        i = 0
        vc = 8
        bonesw = 0x12c7e050
        weightsw = 0xe083dd0
        bones = {_cowdata = 0x12bbf020, write = {_parent = 0x12bbf020}}
        weights = {_cowdata = 0x12c7e0e0, write = {_parent = 0x12c7e0e0}}
        len = 8
        colors = {_cowdata = 0x7fffffffbf30, write = {_parent = 0x7fffffffbf30}}
        color_len = 235431384
        skeleton_node = 0x0
        points = {_cowdata = 0x12c7e160, write = {_parent = 0x12c7e160}}
        uvs = {_cowdata = 0xe084940, write = {_parent = 0xe084940}}
#3  0x0000000002e20c41 in Polygon2D::_notificationv (this=0x12be2330, p_notification=30, p_reversed=false) at scene/2d/polygon_2d.h:38
No locals.
#4  0x000000000405e1ac in Object::notification (this=0x12be2330, p_notification=30, p_reversed=false) at core/object.cpp:978
No locals.
#5  0x0000000002e47e80 in CanvasItem::_update_callback (this=0x12be2330) at scene/2d/canvas_item.cpp:339
No locals.
#6  0x000000000100037e in MethodBind0::call (this=0x6806790, p_object=0x12be2330, p_args=0x0, p_arg_count=0, r_error=...) at core/method_bind.gen.inc:54
        instance = 0x12be2330
        __FUNCTION__ = "call"
#7  0x000000000405dfe7 in Object::call (this=0x12be2330, p_method=..., p_args=0x0, p_argcount=0, r_error=...) at core/object.cpp:968
        __FUNCTION__ = "call"
        ret = {type = Variant::NIL, _data = {_bool = 32, _int = 93029152, _real = 4.5962508064943493e-316, _transform2d = 0x58b8320 <Memory::mem_usage>, 
            _aabb = 0x58b8320 <Memory::mem_usage>, _basis = 0x58b8320 <Memory::mem_usage>, _transform = 0x58b8320 <Memory::mem_usage>, _ptr = 0x58b8320 <Memory::mem_usage>, 
            _mem = " \203\213\005\000\000\000\000\000\030U\027\020\000\000\001"}}
        _debug_lock = {obj = 0x12be2330}
        method = 0x6806790
#8  0x00000000041027da in MessageQueue::_call_function (this=0x5a0fa60, p_target=0x12be2330, p_func=..., p_args=0x7fffef8e7038, p_argcount=0, p_show_error=false)
    at core/message_queue.cpp:256
        argptrs = 0x0
        ce = {error = Variant::CallError::CALL_OK, argument = 67540140, expected = Variant::NIL}
        __FUNCTION__ = "_call_function"
#9  0x0000000004102a2e in MessageQueue::flush (this=0x5a0fa60) at core/message_queue.cpp:300
#10 0x00000000027e4b7d in SceneTree::iteration (this=0x6e34a50, p_time=0.0166666675) at scene/main/scene_tree.cpp:476
#11 0x0000000000f61f16 in Main::iteration () at main/main.cpp:1773
#12 0x0000000000f33415 in OS_X11::run (this=0x7fffffffd2d0) at platform/x11/os_x11.cpp:2695
#13 0x0000000000f2511b in main (argc=2, argv=0x7fffffffda38) at platform/x11/godot_x11.cpp:55

@reduz reduz self-assigned this Sep 7, 2018
@ibrahn
Copy link
Contributor

ibrahn commented Sep 21, 2018

In Polygon2D's draw notification handling:

if (!skeleton_node->has_node(bone_weights[i].path)) {
Crashes because no skeleton is set.

It's guarded by this:

if (!invert && bone_weights.size()) {
//a skeleton is set! fill indices and weights

Is it fine to just check the skeleton node here or should we be clearing the bone weights when the skeleton is unset?

@reduz reduz closed this as completed in c48027a Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants