-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Runtime crash when calling KinematicBody3D.move_and_slide with Bullet physics #40840
Comments
Probably not useful for anyone, but this is temporarily fixed by adding small delay before
|
This fix the issue: #41067, can you please test it? |
@briansemrau thanks, don't forget to tag me please, so I don't lost it. |
Finally reproduced the issue I mentioned. I'm putting it here instead of in a new issue because I believe it's closely related. When removing/readding shapes while calling Here's the script that causes it: # Snippet from main scene
func _physics_process(delta):
if _flag:
# _collshp is the CollisionShape3D of a static body
_collshp.shape = null
_flag = false
else:
_collshp.shape = BoxShape3D.new()
_flag = true MRP: And here's the call stack: > godot.windows.tools.64.exe!_purecall() Line 29 C++
godot.windows.tools.64.exe!btCollisionShape::getBoundingSphere(btVector3 & center, float & radius) Line 38 C++
godot.windows.tools.64.exe!btCollisionShape::getAngularMotionDisc() Line 53 C++
godot.windows.tools.64.exe!btContinuousConvexCollision::calcTimeOfImpact(const btTransform & fromA, const btTransform & toA, const btTransform & fromB, const btTransform & toB, btConvexCast::CastResult & result) Line 103 C++
godot.windows.tools.64.exe!btCollisionWorld::objectQuerySingleInternal(const btConvexShape * castShape, const btTransform & convexFromTrans, const btTransform & convexToTrans, const btCollisionObjectWrapper * colObjWrap, btCollisionWorld::ConvexResultCallback & resultCallback, float allowedPenetration) Line 636 C++
godot.windows.tools.64.exe!btCollisionWorld::objectQuerySingle(const btConvexShape * castShape, const btTransform & convexFromTrans, const btTransform & convexToTrans, btCollisionObject * collisionObject, const btCollisionShape * collisionShape, const btTransform & colObjWorldTransform, btCollisionWorld::ConvexResultCallback & resultCallback, float allowedPenetration) Line 610 C++
godot.windows.tools.64.exe!btSingleSweepCallback::process(const btBroadphaseProxy * proxy) Line 1072 C++
godot.windows.tools.64.exe!BroadphaseRayTester::Process(const btDbvtNode * leaf) Line 237 C++
godot.windows.tools.64.exe!btDbvt::rayTestInternal<BroadphaseRayTester>(const btDbvtNode * root, const btVector3 & rayFrom, const btVector3 & rayTo, const btVector3 & rayDirectionInverse, unsigned int * signs, float lambda_max, const btVector3 & aabbMin, const btVector3 & aabbMax, btAlignedObjectArray<btDbvtNode const *> & stack, BroadphaseRayTester & policy) Line 1270 C++
godot.windows.tools.64.exe!btDbvtBroadphase::rayTest(const btVector3 & rayFrom, const btVector3 & rayTo, btBroadphaseRayCallback & rayCallback, const btVector3 & aabbMin, const btVector3 & aabbMax) Line 274 C++
godot.windows.tools.64.exe!btCollisionWorld::convexSweepTest(const btConvexShape * castShape, const btTransform & convexFromWorld, const btTransform & convexToWorld, btCollisionWorld::ConvexResultCallback & resultCallback, float allowedCcdPenetration) Line 1103 C++
godot.windows.tools.64.exe!SpaceBullet::test_body_motion(RigidBodyBullet * p_body, const Transform & p_from, const Vector3 & p_motion, bool p_infinite_inertia, PhysicsServer3D::MotionResult * r_result, bool p_exclude_raycast_shapes) Line 1052 C++
... |
Fixes both crashes: #41096 |
Godot version:
Godot v4.0.dev.custom_build. 7b17cd2
(Issue introduced in v4.0.dev.custom_build. 3e87022)
OS/device including version:
Windows 10 (v1903)
Issue description:
Calling function
move_and_slide
within KinematicBody3D physics process causes a runtime crash.This issue was introduced in #40252.
This crash is caused by a nullptr in
SpaceBullet::test_body_motion
becauseCollisionObjectBullet::ShapeWrapper.bt_shape
has not yet been initialized byShapeWrapper::claim_bt_shape
Steps to reproduce:
See above.
Minimal reproduction project:
BulletShapeNullptrCrash.zip
The text was updated successfully, but these errors were encountered: