Repository: godot
Issue: Executing `ConvexPolygonShape.get_debug_mesh` crashes Godot
Labels: bug,topic:core,crash

### Godot version

3.5.beta.custom_build. 20b08185f

### System information

Ubuntu 21.10 - Nvidia GTX 970, Gnome shell 40.4 X11

### Issue description

When executing
```
	var temp_variable6967 = ConvexPolygonShape.new()
	temp_variable6967.set_points(PoolVector3Array([Vector3(-18.729752, 84.953079, 14.925432), Vector3(-0.586507, -0.6285, -0.510879), Vector3(35.647903, -26.982862, -84.487854), Vector3(-56.030392, 0, -84.46846), Vector3(-56.208378, -95.238121, 48.196136), Vector3(-NAN, -NAN, -NAN), Vector3(-0.245793, 0.608417, 0.754595), Vector3(-41.381424, 44.030178, -58.858757), Vector3(0.326704, 0.764978, 0.555043), Vector3(10.016322, -INF, -NAN), Vector3(-37.902283, -29.96735, 0), Vector3(16.843378, 65.301178, -14.029413), Vector3(0.136223, -0.810371, 0.569862), Vector3(0.681965, -0.195669, 0.704725), Vector3(0.646759, 0.731495, -0.21591), Vector3(-0.646453, 0.43992, 0.623352), Vector3(-4.811674, -33.51791, 88.739166), Vector3(0.010342, -0.775189, -0.631645), Vector3(0.811248, 0.506741, 0.291703), Vector3(-0.728726, -0.673158, 0.125764), Vector3(-15.352333, 36.378311, 42.26049), Vector3(96.786545, 71.262993, 66.866852), Vector3(-0.495466, -0.635208, 0.592474), Vector3(0.080582, 0.98375, -0.160446), Vector3(-0.46335, 0, -0.886175)]))
	temp_variable6967.get_debug_mesh()
```

Godot crashes with this backtrace
```
ERROR: Assertion "p_ccw ? (t.dot(p_s) < 0) : (t.dot(p_s) > 0)" failed.
   at: find_max_angle (core/math/convex_hull.cpp:1168)

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v3.5.beta.custom_build (20b08185f36dbc27b844a2ee7fbbd56a70b4e694)
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7f2b80cf9520] (??:0)
[2] PagedAllocator<ConvexHullInternal::Edge, false>::free(ConvexHullInternal::Edge*) (/home/runner/work/GodotBuilds/GodotBuilds/godot/./core/paged_allocator.h:87)
[3] ConvexHullInternal::remove_edge_pair(ConvexHullInternal::Edge*) (/home/runner/work/GodotBuilds/GodotBuilds/godot/core/math/convex_hull.cpp:645)
[4] ConvexHullInternal::merge(ConvexHullInternal::IntermediateHull&, ConvexHullInternal::IntermediateHull&) (/home/runner/work/GodotBuilds/GodotBuilds/godot/core/math/convex_hull.cpp:1538)
[5] ConvexHullInternal::compute_internal(int, int, ConvexHullInternal::IntermediateHull&) (/home/runner/work/GodotBuilds/GodotBuilds/godot/core/math/convex_hull.cpp:1078)
[6] ConvexHullInternal::compute_internal(int, int, ConvexHullInternal::IntermediateHull&) (/home/runner/work/GodotBuilds/GodotBuilds/godot/core/math/convex_hull.cpp:1066)
[7] ConvexHullInternal::compute_internal(int, int, ConvexHullInternal::IntermediateHull&) (/home/runner/work/GodotBuilds/GodotBuilds/godot/core/math/convex_hull.cpp:1066)
[8] ConvexHullInternal::compute(Vector3 const*, int) (/home/runner/work/GodotBuilds/GodotBuilds/godot/core/math/convex_hull.cpp:1646)
[9] ConvexHullComputer::compute(Vector3 const*, int, float, float) (/home/runner/work/GodotBuilds/GodotBuilds/godot/core/math/convex_hull.cpp:2161)
[10] ConvexHullComputer::convex_hull(Vector3 const*, int, Geometry::MeshData&) (/home/runner/work/GodotBuilds/GodotBuilds/godot/core/math/convex_hull.cpp:2260)
[11] ConvexHullComputer::convex_hull(Vector<Vector3> const&, Geometry::MeshData&) (/home/runner/work/GodotBuilds/GodotBuilds/godot/core/math/convex_hull.cpp:2244)
[12] ConvexPolygonShape::get_debug_mesh_lines() (/home/runner/work/GodotBuilds/GodotBuilds/godot/scene/resources/convex_polygon_shape.cpp:41)
[13] Shape::get_debug_mesh() (/home/runner/work/GodotBuilds/GodotBuilds/godot/scene/resources/shape.cpp:67)
[14] MethodBind0R<Ref<ArrayMesh> >::call(Object*, Variant const**, int, Variant::CallError&) (/home/runner/work/GodotBuilds/GodotBuilds/godot/./core/method_bind.gen.inc:233 (discriminator 4))
[15] Object::call(StringName const&, Variant const**, int, Variant::CallError&) (/home/runner/work/GodotBuilds/GodotBuilds/godot/core/object.cpp:918 (discriminator 1))
[16] Object::callv(StringName const&, Array const&) (/home/runner/work/GodotBuilds/GodotBuilds/godot/core/object.cpp:828)
[17] MethodBind2R<Variant, StringName const&, Array const&>::call(Object*, Variant const**, int, Variant::CallError&) (/home/runner/work/GodotBuilds/GodotBuilds/godot/./core/method_bind.gen.inc:1681 (discriminator 12))
[18] Object::call(StringName const&, Variant const**, int, Variant::CallError&) (/home/runner/work/GodotBuilds/GodotBuilds/godot/core/object.cpp:918 (discriminator 1))
[19] Variant::call_ptr(StringName const&, Variant const**, int, Variant*, Variant::CallError&) (/home/runner/work/GodotBuilds/GodotBuilds/godot/core/variant_call.cpp:1185 (discriminator 1))
[20] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Variant::CallError&, GDScriptFunction::CallState*) (/home/runner/work/GodotBuilds/GodotBuilds/godot/modules/gdscript/gdscript_function.cpp:1048)
[21] GDScriptInstance::call(StringName const&, Variant const**, int, Variant::CallError&) (/home/runner/work/GodotBuilds/GodotBuilds/godot/modules/gdscript/gdscript.cpp:1196)
[22] Object::call(StringName const&, Variant const**, int, Variant::CallError&) (/home/runner/work/GodotBuilds/GodotBuilds/godot/core/object.cpp:899 (discriminator 1))
[23] Variant::call_ptr(StringName const&, Variant const**, int, Variant*, Variant::CallError&) (/home/runner/work/GodotBuilds/GodotBuilds/godot/core/variant_call.cpp:1185 (discriminator 1))
[24] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Variant::CallError&, GDScriptFunction::CallState*) (/home/runner/work/GodotBuilds/GodotBuilds/godot/modules/gdscript/gdscript_function.cpp:1053)
[25] GDScriptInstance::call_multilevel(StringName const&, Variant const**, int) (/home/runner/work/GodotBuilds/GodotBuilds/godot/modules/gdscript/gdscript.cpp:1211)
[26] Node::_notification(int) (/home/runner/work/GodotBuilds/GodotBuilds/godot/scene/main/node.cpp:54)
[27] Node::_notificationv(int, bool) (/home/runner/work/GodotBuilds/GodotBuilds/godot/./scene/main/node.h:45 (discriminator 14))
[28] Object::notification(int, bool) (/home/runner/work/GodotBuilds/GodotBuilds/godot/core/object.cpp:929)
[29] SceneTree::_notify_group_pause(StringName const&, int) (/home/runner/work/GodotBuilds/GodotBuilds/godot/scene/main/scene_tree.cpp:1069)
[30] SceneTree::idle(float) (/home/runner/work/GodotBuilds/GodotBuilds/godot/scene/main/scene_tree.cpp:605 (discriminator 3))
[31] Main::iteration() (/home/runner/work/GodotBuilds/GodotBuilds/godot/main/main.cpp:2271)
[32] OS_X11::run() (/home/runner/work/GodotBuilds/GodotBuilds/godot/platform/x11/os_x11.cpp:3842)
[33] godot(main+0x125) [0x1839b0b] (/home/runner/work/GodotBuilds/GodotBuilds/godot/platform/x11/godot_x11.cpp:57)
[34] /lib/x86_64-linux-gnu/libc.so.6(+0x29fd0) [0x7f2b80ce0fd0] (??:0)
[35] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x7d) [0x7f2b80ce107d] (??:0)
[36] godot(_start+0x2e) [0x183992e] (??:?)
-- END OF BACKTRACE --
================================================================
```


This example was found by Godot fuzzer - [Qarminer](https://github.com/qarmin/Qarminer), so it is quite unlikelly that this code could be used in real project, but still this should be handled gracefully.


### Steps to reproduce

Above

### Minimal reproduction project

_No response_