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

Executing SoftBody::remove_collision_exception_with, crashes Godot #46651

Closed
qarmin opened this issue Mar 4, 2021 · 0 comments · Fixed by #46704
Closed

Executing SoftBody::remove_collision_exception_with, crashes Godot #46651

qarmin opened this issue Mar 4, 2021 · 0 comments · Fixed by #46704

Comments

@qarmin
Copy link
Contributor

qarmin commented Mar 4, 2021

Godot version:
3.2.4.rc.custom_build. bc2d960

Issue description:
Executing this code

var q_SoftBody : SoftBody = SoftBody.new()

func _ready() -> void:
	add_child(q_SoftBody)

func _process(_delta : float) -> void:
	if randi() % 10 == 0:
		q_SoftBody.queue_free()
		q_SoftBody = SoftBody.new()
		add_child(q_SoftBody)

	modify_object(q_SoftBody)

static func modify_object(q_SoftBody : SoftBody) -> void:
	if randi() % 2 == 0:
		print("Executing SoftBody.remove_collision_exception_with")
		var p_object_0 = RigidBody.new()
		q_SoftBody.remove_collision_exception_with(p_object_0)
		p_object_0.queue_free()

crashes Godot with this thisbacktrace

scene/gui/tree.cpp:1011:31: runtime error: member access within null pointer of type 'struct TreeItem'
handle_crash: Program crashed with signal 11
modules/bullet/collision_object_bullet.cpp:159:46: runtime error: member call on null pointer of type 'struct btCollisionObject'
modules/bullet/collision_object_bullet.cpp:159:46: runtime error: member access within null pointer of type 'struct btCollisionObject'
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] godots() [0x171868e] (/home/rafal/Pulpit/godot3.2/platform/x11/crash_handler_x11.cpp:54)
[2] /lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7f1ddfc59210] (??:0)
[3] CollisionObjectBullet::remove_collision_exception(CollisionObjectBullet const*) (/home/rafal/Pulpit/godot3.2/modules/bullet/collision_object_bullet.cpp:159 (discriminator 2))
[4] BulletPhysicsServer::soft_body_remove_collision_exception(RID, RID) (/home/rafal/Pulpit/godot3.2/modules/bullet/bullet_physics_server.cpp:974)
[5] SoftBody::remove_collision_exception_with(Node*) (/home/rafal/Pulpit/godot3.2/scene/3d/soft_body.cpp:595)
[6] MethodBind1<Node*>::call(Object*, Variant const**, int, Variant::CallError&) (/home/rafal/Pulpit/godot3.2/./core/method_bind.gen.inc:775 (discriminator 12))
[7] Object::call(StringName const&, Variant const**, int, Variant::CallError&) (/home/rafal/Pulpit/godot3.2/core/object.cpp:919 (discriminator 1))
[8] Variant::call_ptr(StringName const&, Variant const**, int, Variant*, Variant::CallError&) (/home/rafal/Pulpit/godot3.2/core/variant_call.cpp:1130 (discriminator 1))
[9] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Variant::CallError&, GDScriptFunction::CallState*) (/home/rafal/Pulpit/godot3.2/modules/gdscript/gdscript_function.cpp:1089)
[10] GDScriptInstance::call(StringName const&, Variant const**, int, Variant::CallError&) (/home/rafal/Pulpit/godot3.2/modules/gdscript/gdscript.cpp:1208)
[11] Object::call(StringName const&, Variant const**, int, Variant::CallError&) (/home/rafal/Pulpit/godot3.2/core/object.cpp:898 (discriminator 1))
[12] Variant::call_ptr(StringName const&, Variant const**, int, Variant*, Variant::CallError&) (/home/rafal/Pulpit/godot3.2/core/variant_call.cpp:1130 (discriminator 1))
[13] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Variant::CallError&, GDScriptFunction::CallState*) (/home/rafal/Pulpit/godot3.2/modules/gdscript/gdscript_function.cpp:1089)
[14] GDScriptInstance::call_multilevel(StringName const&, Variant const**, int) (/home/rafal/Pulpit/godot3.2/modules/gdscript/gdscript.cpp:1224)
[15] Node::_notification(int) (/home/rafal/Pulpit/godot3.2/scene/main/node.cpp:58)
[16] Node::_notificationv(int, bool) (/home/rafal/Pulpit/godot3.2/./scene/main/node.h:46 (discriminator 14))
[17] CanvasItem::_notificationv(int, bool) (/home/rafal/Pulpit/godot3.2/./scene/2d/canvas_item.h:166 (discriminator 3))
[18] Node2D::_notificationv(int, bool) (/home/rafal/Pulpit/godot3.2/./scene/2d/node_2d.h:38 (discriminator 3))
[19] Object::notification(int, bool) (/home/rafal/Pulpit/godot3.2/core/object.cpp:931)
[20] SceneTree::_notify_group_pause(StringName const&, int) (/home/rafal/Pulpit/godot3.2/scene/main/scene_tree.cpp:988)
[21] SceneTree::idle(float) (/home/rafal/Pulpit/godot3.2/scene/main/scene_tree.cpp:528 (discriminator 3))
[22] Main::iteration() (/home/rafal/Pulpit/godot3.2/main/main.cpp:2115)
[23] OS_X11::run() (/home/rafal/Pulpit/godot3.2/platform/x11/os_x11.cpp:3628)
[24] godots(main+0x334) [0x170f07a] (/home/rafal/Pulpit/godot3.2/platform/x11/godot_x11.cpp:57)
[25] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f1ddfc3a0b3] (??:0)
[26] godots(_start+0x2e) [0x170ec8e] (??:?)
@akien-mga akien-mga added this to the 4.0 milestone Mar 5, 2021
Duddino pushed a commit to Duddino/godot that referenced this issue Mar 6, 2021
Previously godot would try to access
`CollisionObjectBullet::bt_collision_object` even if it was null.
Fixes godotengine#46651
akien-mga pushed a commit that referenced this issue Mar 7, 2021
Previously godot would try to access
`CollisionObjectBullet::bt_collision_object` even if it was null.
Fixes #46651

(cherry picked from commit c47070e)
lekoder pushed a commit to KoderaSoftwareUnlimited/godot that referenced this issue Apr 24, 2021
Previously godot would try to access
`CollisionObjectBullet::bt_collision_object` even if it was null.
Fixes godotengine#46651

(cherry picked from commit c47070e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants