Godot: Segfaults in BroadPhase2DHashGrid

Created on 2 Jun 2018  路  7Comments  路  Source: godotengine/godot

Godot version: 3.0.3. RC2.official

OS/device including version: MacOS High Sierra

Issue description: The game crashes with the stack trace below

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] 1 libsystem_platform.dylib 0x00007fff614fff5a _sigtramp + 26
[2] 2 ??? 0x00007fb5192ce7b0 0x0 + 140415788181424
[3] BroadPhase2DHashGrid::_unpair_attempt(BroadPhase2DHashGrid::Element, BroadPhase2DHashGrid::Element) (in Godot) + 233
[4] BroadPhase2DHashGrid::_exit_grid(BroadPhase2DHashGrid::Element, Rect2 const&, bool) (in Godot) + 1171
[5] BroadPhase2DHashGrid::remove(unsigned int) (in Godot) + 204
[6] CollisionObject2DSW::_set_space(Space2DSW
) (in Godot) + 188
[7] CollisionObject2D::_notificationv(int, bool) (in Godot) + 130
[8] Object::notification(int, bool) (in Godot) + 22
[9] Node::_propagate_exit_tree() (in Godot) + 947
[10] Node::remove_child(Node) (in Godot) + 347
[11] Node::_notification(int) (in Godot) + 670
[12] predelete_handler(Object
) (in Godot) + 32
[13] SceneTree::_flush_delete_queue() (in Godot) + 123
[14] SceneTree::iteration(float) (in Godot) + 721
[15] Main::iteration() (in Godot) + 522
[16] OS_OSX::run() (in Godot) + 402
[17] main (in Godot) + 866
[18] 18 libdyld.dylib 0x00007fff611f1015 start + 1
[19] 19 ??? 0x000000000000000a 0x0 + 10
-- END OF BACKTRACE --

Steps to reproduce:

The crash seems somewhat random, it happens after a few minutes of running the game, I could not isolate the issue enough to create a sample project reproducing it, seems to happen when there is larger number of objects and setting physics_process on and off a few times on those objects.

Minimal reproduction project:

archived bug crash physics

Most helpful comment

I have a hunch. I'll create a new binary for you to test.

All 7 comments

Can you confirm it is still an issue in RC3 (just in case it was fixed)?

Still happening, slightly different backtrace, just got this one below. I could not get the game to crash at all on Windows.

[1] 1 libsystem_platform.dylib 0x00007fff5d213f5a _sigtramp + 26
[2] 2 ??? 0x0000002500000000 0x0 + 158913789952
[3] BroadPhase2DHashGrid::move(unsigned int, Rect2 const&) (in Godot) + 382
[4] CollisionObject2DSW::_update_shapes() (in Godot) + 189
[5] Area2DSW::set_transform(Transform2D const&) (in Godot) + 79
[6] CollisionObject2D::_notification(int) (in Godot) + 209
[7] CollisionObject2D::_notificationv(int, bool) (in Godot) + 130
[8] Area2D::_notificationv(int, bool) (in Godot) + 35
[9] Object::notification(int, bool) (in Godot) + 22
[10] SceneTree::flush_transform_notifications() (in Godot) + 193
[11] SceneTree::iteration(float) (in Godot) + 413
[12] Main::iteration() (in Godot) + 506
[13] OS_OSX::run() (in Godot) + 402
[14] main (in Godot) + 832
[15] 15 libdyld.dylib 0x00007fff5cf05015 start + 1
[16] 16 ??? 0x0000000000000009 0x0 + 9

Another trace, slightly different but still in starting with BroadPhase2DHashGrid

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] 1 libsystem_platform.dylib 0x00007fff5d213f5a _sigtramp + 26
[2] 2 ??? 0x00007ff9b0ffc080 0x0 + 140710393135232
[3] BroadPhase2DHashGrid::_unpair_attempt(BroadPhase2DHashGrid::Element, BroadPhase2DHashGrid::Element) (in Godot) + 356
[4] BroadPhase2DHashGrid::_exit_grid(BroadPhase2DHashGrid::Element, Rect2 const&, bool) (in Godot) + 1123
[5] BroadPhase2DHashGrid::remove(unsigned int) (in Godot) + 204
[6] CollisionObject2DSW::_set_space(Space2DSW
) (in Godot) + 198
[7] CollisionObject2D::_notificationv(int, bool) (in Godot) + 130
[8] Object::notification(int, bool) (in Godot) + 22
[9] Node::_propagate_exit_tree() (in Godot) + 721
[10] Node::_propagate_exit_tree() (in Godot) + 464
[11] Node::_propagate_exit_tree() (in Godot) + 464
[12] Node::_propagate_exit_tree() (in Godot) + 464
[13] Node::remove_child(Node) (in Godot) + 359
[14] Node::_notification(int) (in Godot) + 670
[15] predelete_handler(Object
) (in Godot) + 32
[16] SceneTree::_change_scene(Node) (in Godot) + 36
[17] MethodBind1::call(Object
, Variant const, int, Variant::CallError&) (in Godot) + 307
[18] Object::call(StringName const&, Variant const
, int, Variant::CallError&) (in Godot) + 414
[19] MessageQueue::_call_function(Object, StringName const&, Variant const, int, bool) (in Godot) + 266
[20] MessageQueue::flush() (in Godot) + 219
[21] SceneTree::idle(float) (in Godot) + 298
[22] Main::iteration() (in Godot) + 855
[23] OS_OSX::run() (in Godot) + 402
[24] main (in Godot) + 832
[25] 25 libdyld.dylib 0x00007fff5cf05015 start + 1
[26] 26 ??? 0x000000000000000a 0x0 + 10
-- END OF BACKTRACE --

I have a hunch. I'll create a new binary for you to test.

This issue still appears to exist, but for set_static instead.

I get the error:
ERROR: set_static: Condition ' !E ' is true. At: servers/physics_2d/broad_phase_2d_hash_grid.cpp:364.

Edit: I am using 3.2-dev (just checked on commit 2fa32d69a53212c46a09a7331fc07e5aa767e504, crash still occurs).
Edit 2: This seems to have something to do with set_cell on tilemap. Now, this issue only occurs when the server sets the cells on behalf of the client (for procedural world generation). I should mention I have a server/client setup in the style of terraria.

Can anyone attach a minimal project?

Closing as there's no minimal project so it's quite difficult to try to reproduce. If you can reproduce it, please attach a project that can be used for that.

Was this page helpful?
0 / 5 - 0 ratings