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

bullet: Sync with upstream 3.07 #44455

Merged
merged 1 commit into from
Dec 18, 2020
Merged

Conversation

akien-mga
Copy link
Member

As usual on a bullet upgrade, this requires a clean build otherwise some of the bullet calling code will trigger crashes.

I'm not sure why but this must be a sign that there's some missing dependency in our bullet code and SCons doesn't force a rebuild of the relevant code that relies on bullet, so we end up linking incompatible Godot .o files with the bullet static library.

Here's an example of a crash on close:

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] /lib64/libc.so.6(+0x3b580) [0x7f07f7a41580] (??:0)
[2] ConcavePolygonShapeBullet::~ConcavePolygonShapeBullet() (/home/akien/Projects/godot/godot.git/modules/bullet/shape_bullet.cpp:370 (discriminator 1))
[3] ConcavePolygonShapeBullet::~ConcavePolygonShapeBullet() (/home/akien/Projects/godot/godot.git/modules/bullet/shape_bullet.cpp:375)
[4] BulletPhysicsServer3D::free(RID) (/home/akien/Projects/godot/godot.git/modules/bullet/bullet_physics_server.cpp:1476 (discriminator 3))
[5] Shape3D::~Shape3D() (/home/akien/Projects/godot/godot.git/scene/resources/shape_3d.cpp:115)
[6] ConcavePolygonShape3D::~ConcavePolygonShape3D() (/home/akien/Projects/godot/godot.git/scene/resources/concave_polygon_shape_3d.h:36)
[7] void memdelete<Shape3D>(Shape3D*) (/home/akien/Projects/godot/godot.git/./core/os/memory.h:118)
[8] Ref<Shape3D>::unref() (/home/akien/Projects/godot/godot.git/./core/object/reference.h:223)
[9] Ref<Shape3D>::~Ref() (/home/akien/Projects/godot/godot.git/./core/object/reference.h:234)
[10] MeshLibrary::ShapeData::~ShapeData() (/home/akien/Projects/godot/godot.git/./scene/resources/mesh_library.h:45)
[11] CowData<MeshLibrary::ShapeData>::_unref(void*) (/home/akien/Projects/godot/godot.git/./core/templates/cowdata.h:206 (discriminator 2))
[12] CowData<MeshLibrary::ShapeData>::~CowData() (/home/akien/Projects/godot/godot.git/./core/templates/cowdata.h:370)
[13] Vector<MeshLibrary::ShapeData>::~Vector() (/home/akien/Projects/godot/godot.git/./core/templates/vector.h:189)
[14] MeshLibrary::Item::~Item() (/home/akien/Projects/godot/godot.git/scene/resources/mesh_library.h:49)
[15] Map<int, MeshLibrary::Item, Comparator<int>, DefaultAllocator>::Element::~Element() (/home/akien/Projects/godot/godot.git/./core/templates/map.h:49)
[16] void memdelete_allocator<Map<int, MeshLibrary::Item, Comparator<int>, DefaultAllocator>::Element, DefaultAllocator>(Map<int, MeshLibrary::Item, Comparator<int>, DefaultAllocator>::Element*) (/home/akien/Projects/godot/godot.git/./core/os/memory.h:130)
[17] Map<int, MeshLibrary::Item, Comparator<int>, DefaultAllocator>::_cleanup_tree(Map<int, MeshLibrary::Item, Comparator<int>, DefaultAllocator>::Element*) (/home/akien/Projects/godot/godot.git/./core/templates/map.h:487)
[18] Map<int, MeshLibrary::Item, Comparator<int>, DefaultAllocator>::_cleanup_tree(Map<int, MeshLibrary::Item, Comparator<int>, DefaultAllocator>::Element*) (/home/akien/Projects/godot/godot.git/./core/templates/map.h:486)
[19] Map<int, MeshLibrary::Item, Comparator<int>, DefaultAllocator>::_cleanup_tree(Map<int, MeshLibrary::Item, Comparator<int>, DefaultAllocator>::Element*) (/home/akien/Projects/godot/godot.git/./core/templates/map.h:486)
[20] Map<int, MeshLibrary::Item, Comparator<int>, DefaultAllocator>::_cleanup_tree(Map<int, MeshLibrary::Item, Comparator<int>, DefaultAllocator>::Element*) (/home/akien/Projects/godot/godot.git/./core/templates/map.h:486)
[21] Map<int, MeshLibrary::Item, Comparator<int>, DefaultAllocator>::clear() (/home/akien/Projects/godot/godot.git/./core/templates/map.h:648)
[22] Map<int, MeshLibrary::Item, Comparator<int>, DefaultAllocator>::~Map() (/home/akien/Projects/godot/godot.git/./core/templates/map.h:665)
[23] MeshLibrary::~MeshLibrary() (/home/akien/Projects/godot/godot.git/scene/resources/mesh_library.cpp:292)
[24] void memdelete<MeshLibrary>(MeshLibrary*) (/home/akien/Projects/godot/godot.git/./core/os/memory.h:118)
[25] Ref<MeshLibrary>::unref() (/home/akien/Projects/godot/godot.git/./core/object/reference.h:223)
[26] Ref<MeshLibrary>::~Ref() (/home/akien/Projects/godot/godot.git/./core/object/reference.h:234)
[27] GridMap::~GridMap() (/home/akien/Projects/godot/godot.git/modules/gridmap/grid_map.cpp:1071)
[28] void memdelete<Node>(Node*) (/home/akien/Projects/godot/godot.git/./core/os/memory.h:118)
[29] Node::_notification(int) (/home/akien/Projects/godot/godot.git/scene/main/node.cpp:166)
[30] Node::_notificationv(int, bool) (/home/akien/Projects/godot/godot.git/./scene/main/node.h:45 (discriminator 14))
[31] Node3D::_notificationv(int, bool) (/home/akien/Projects/godot/godot.git/./scene/3d/node_3d.h:52)
[32] Object::notification(int, bool) (/home/akien/Projects/godot/godot.git/core/object/object.cpp:795)
[33] Object::_predelete() (/home/akien/Projects/godot/godot.git/core/object/object.cpp:355)
[34] predelete_handler(Object*) (/home/akien/Projects/godot/godot.git/core/object/object.cpp:1820)
[35] void memdelete<Node>(Node*) (/home/akien/Projects/godot/godot.git/./core/os/memory.h:111)
[36] EditorData::clear_edited_scenes() (/home/akien/Projects/godot/godot.git/editor/editor_data.cpp:814 (discriminator 2))
[37] EditorNode::_notification(int) (/home/akien/Projects/godot/godot.git/editor/editor_node.cpp:552)
[38] EditorNode::_notificationv(int, bool) (/home/akien/Projects/godot/godot.git/editor/editor_node.h:91 (discriminator 14))
[39] Object::notification(int, bool) (/home/akien/Projects/godot/godot.git/core/object/object.cpp:795)
[40] Node::_propagate_exit_tree() (/home/akien/Projects/godot/godot.git/scene/main/node.cpp:270)
[41] Node::_propagate_exit_tree() (/home/akien/Projects/godot/godot.git/scene/main/node.cpp:258 (discriminator 2))
[42] Node::_set_tree(SceneTree*) (/home/akien/Projects/godot/godot.git/scene/main/node.cpp:2553)
[43] SceneTree::finish() (/home/akien/Projects/godot/godot.git/scene/main/scene_tree.cpp:530)
[44] OS_LinuxBSD::run() (/home/akien/Projects/godot/godot.git/platform/linuxbsd/os_linuxbsd.cpp:266)
[45] godot-git(main+0x135) [0x1f740a7] (/home/akien/Projects/godot/godot.git/platform/linuxbsd/godot_linuxbsd.cpp:60)
[46] /lib64/libc.so.6(__libc_start_main+0xea) [0x7f07f7a2de4a] (??:0)
[47] godot-git(_start+0x2a) [0x1f73eca] (??:?)
-- END OF BACKTRACE --
Aborted (core dumped)

@akien-mga
Copy link
Member Author

I'm not sure why but this must be a sign that there's some missing dependency in our bullet code and SCons doesn't force a rebuild of the relevant code that relies on bullet, so we end up linking incompatible Godot .o files with the bullet static library.

This might be due to our split between env_bullet and env_thirdparty (as done for all other modules with thirdparty code), which allows to decouple the thirdparty code from Godot code to avoid rebuilding the Bullet lib when Godot code changes. If so I'm not sure that I'd prefer the fix to the current situation, which only breaks on rare version upgrades, and only seems to really be a problem for bullet so far.

Maybe there's a way to tell SCons that env_bullet should be rebuilt if env_thirdparty is though.

@akien-mga
Copy link
Member Author

Maybe there's a way to tell SCons that env_bullet should be rebuilt if env_thirdparty is though.

I found a (somewhat hacky) way to do this with 6deef7a. Now it properly rebuilds the module code when the thirdparty code is changed, albeit only for bullet, I didn't port these changes to all other modules. Maybe I should though to be safe.

@akien-mga
Copy link
Member Author

I found a (somewhat hacky) way to do this with 6deef7a. Now it properly rebuilds the module code when the thirdparty code is changed, albeit only for bullet, I didn't port these changes to all other modules. Maybe I should though to be safe.

Well it took me 2 hours but I did it, #44457.

I'll remove the first commit in this PR if/when #44457 is merged, as it's now redundant.

Copy link
Contributor

@pouleyKetchoupp pouleyKetchoupp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on 4.0 port of physics tests and didn't spot any issue.
Demo Page: https://github.com/godotengine/godot-demo-projects/tree/master/3d/physics_tests
4.0 Port: physics_tests-4.0.zip

Copy link
Contributor

@AndreaCatania AndreaCatania left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@akien-mga akien-mga merged commit 8180b60 into godotengine:master Dec 18, 2020
@akien-mga akien-mga deleted the bullet-3.07 branch December 18, 2020 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants