Repository: godot
Issue: Several physics related crashes when running test project
Labels: bug,topic:physics,crash

**Godot version:**
3.3.rc.custom_build. ed1f5c29b

**OS**
Ubuntu 20.04 - Ubuntu 3.36 X11

**Issue description:**
Running my new physics test project crashes Godot with very different backtraces.
Some of crashes was reported in e.g. #47438, but since I have seen a lot of different backtraces, I'm not sure if they are releated and it is very hard to create minimal project, so I'm posting here full project.

If needed, I will create 4.0 version of this project

Example asan report with backtrace:
```
ERROR: get: FATAL: Index p_index = 0 is out of bounds (size() = 0).
   At: ./core/cowdata.h:156.
handle_crash: Program crashed with signal 4
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] godots() [0x1736270] (/mnt/Miecz/godot3.2/platform/x11/crash_handler_x11.cpp:54)
[2] /lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7fa1844a9210] (??:0)
[3] CowData<ConcavePolygonShape2DSW::Segment>::get(int) const (/mnt/Miecz/godot3.2/./core/cowdata.h:156 (discriminator 7))
[4] Vector<ConcavePolygonShape2DSW::Segment>::operator[](int) const (/mnt/Miecz/godot3.2/./core/vector.h:85)
[5] ConcavePolygonShape2DSW::intersect_segment(Vector2 const&, Vector2 const&, Vector2&, Vector2&) const (/mnt/Miecz/godot3.2/servers/physics_2d/shape_2d_sw.cpp:770 (discriminator 2))
[6] CollisionSolver2DSW::solve_raycast(Shape2DSW const*, Vector2 const&, Transform2D const&, Shape2DSW const*, Transform2D const&, void (*)(Vector2 const&, Vector2 const&, void*), void*, bool, Vector2*) (/mnt/Miecz/godot3.2/servers/physics_2d/collision_solver_2d_sw.cpp:95)
[7] CollisionSolver2DSW::solve(Shape2DSW const*, Transform2D const&, Vector2 const&, Shape2DSW const*, Transform2D const&, Vector2 const&, void (*)(Vector2 const&, Vector2 const&, void*), void*, Vector2*, float, float) (/mnt/Miecz/godot3.2/servers/physics_2d/collision_solver_2d_sw.cpp:233)
[8] Space2DSW::test_body_motion(Body2DSW*, Transform2D const&, Vector2 const&, bool, float, Physics2DServer::MotionResult*, bool) (/mnt/Miecz/godot3.2/servers/physics_2d/space_2d_sw.cpp:830 (discriminator 1))
[9] Physics2DServerSW::body_test_motion(RID, Transform2D const&, Vector2 const&, bool, float, Physics2DServer::MotionResult*, bool) (/mnt/Miecz/godot3.2/servers/physics_2d/physics_2d_server_sw.cpp:1051)
[10] Physics2DServerWrapMT::body_test_motion(RID, Transform2D const&, Vector2 const&, bool, float, Physics2DServer::MotionResult*, bool) (/mnt/Miecz/godot3.2/servers/physics_2d/physics_2d_server_wrap_mt.h:262)
[11] KinematicBody2D::move_and_collide(Vector2 const&, bool, KinematicBody2D::Collision&, bool, bool) (/mnt/Miecz/godot3.2/scene/2d/physics_body_2d.cpp:1189 (discriminator 1))
[12] KinematicBody2D::move_and_slide(Vector2 const&, Vector2 const&, bool, int, float, bool) (/mnt/Miecz/godot3.2/scene/2d/physics_body_2d.cpp:1249)
[13] MethodBind6R<Vector2, Vector2 const&, Vector2 const&, bool, int, float, bool>::call(Object*, Variant const**, int, Variant::CallError&) (/mnt/Miecz/godot3.2/./core/method_bind_ext.gen.inc:309 (discriminator 28))
[14] Object::call(StringName const&, Variant const**, int, Variant::CallError&) (/mnt/Miecz/godot3.2/core/object.cpp:919 (discriminator 1))
[15] Object::callv(StringName const&, Array const&) (/mnt/Miecz/godot3.2/core/object.cpp:826 (discriminator 1))
[16] MethodBind2R<Variant, StringName const&, Array const&>::call(Object*, Variant const**, int, Variant::CallError&) (/mnt/Miecz/godot3.2/./core/method_bind.gen.inc:1717 (discriminator 12))
[17] Object::call(StringName const&, Variant const**, int, Variant::CallError&) (/mnt/Miecz/godot3.2/core/object.cpp:919 (discriminator 1))
[18] Variant::call_ptr(StringName const&, Variant const**, int, Variant*, Variant::CallError&) (/mnt/Miecz/godot3.2/core/variant_call.cpp:1149 (discriminator 1))
[19] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Variant::CallError&, GDScriptFunction::CallState*) (/mnt/Miecz/godot3.2/modules/gdscript/gdscript_function.cpp:1089)
[20] GDScriptInstance::call(StringName const&, Variant const**, int, Variant::CallError&) (/mnt/Miecz/godot3.2/modules/gdscript/gdscript.cpp:1208)
[21] Object::call(StringName const&, Variant const**, int, Variant::CallError&) (/mnt/Miecz/godot3.2/core/object.cpp:898 (discriminator 1))
[22] Variant::call_ptr(StringName const&, Variant const**, int, Variant*, Variant::CallError&) (/mnt/Miecz/godot3.2/core/variant_call.cpp:1149 (discriminator 1))
[23] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Variant::CallError&, GDScriptFunction::CallState*) (/mnt/Miecz/godot3.2/modules/gdscript/gdscript_function.cpp:1089)
[24] GDScriptInstance::call(StringName const&, Variant const**, int, Variant::CallError&) (/mnt/Miecz/godot3.2/modules/gdscript/gdscript.cpp:1208)
[25] Object::call(StringName const&, Variant const**, int, Variant::CallError&) (/mnt/Miecz/godot3.2/core/object.cpp:898 (discriminator 1))
[26] Variant::call_ptr(StringName const&, Variant const**, int, Variant*, Variant::CallError&) (/mnt/Miecz/godot3.2/core/variant_call.cpp:1149 (discriminator 1))
[27] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Variant::CallError&, GDScriptFunction::CallState*) (/mnt/Miecz/godot3.2/modules/gdscript/gdscript_function.cpp:1089)
[28] GDScriptInstance::call_multilevel(StringName const&, Variant const**, int) (/mnt/Miecz/godot3.2/modules/gdscript/gdscript.cpp:1224)
[29] Node::_notification(int) (/mnt/Miecz/godot3.2/scene/main/node.cpp:67)
[30] Node::_notificationv(int, bool) (/mnt/Miecz/godot3.2/./scene/main/node.h:46 (discriminator 14))
[31] Object::notification(int, bool) (/mnt/Miecz/godot3.2/core/object.cpp:931)
[32] SceneTree::_notify_group_pause(StringName const&, int) (/mnt/Miecz/godot3.2/scene/main/scene_tree.cpp:993)
[33] SceneTree::iteration(float) (/mnt/Miecz/godot3.2/scene/main/scene_tree.cpp:486 (discriminator 2))
[34] Main::iteration() (/mnt/Miecz/godot3.2/main/main.cpp:2100)
[35] OS_X11::run() (/mnt/Miecz/godot3.2/platform/x11/os_x11.cpp:3641)
[36] godots(main+0x326) [0x172cefc] (/mnt/Miecz/godot3.2/platform/x11/godot_x11.cpp:57)
[37] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7fa18448a0b3] (??:0)
[38] godots(_start+0x2e) [0x172cb1e] (??:?)

```

**Steps to reproduce:**
1. Run minimal project 

**Minimal reproduction project:**
[Physics.zip](https://github.com/godotengine/godot/files/6217547/Physics.zip)