kalysti / terrain-tool-godot4

GODOT 4 3D Terrain Editor (C# Plugin)
MIT License
159 stars 12 forks source link

application crash, when trying to load MapBox or map with more than 1 patch #11

Open Sythelux opened 2 years ago

Sythelux commented 2 years ago

Describe the bug When I add my Terrain3D and try to load a map and set the patch size x or y to be above 1 the whole editor crashes after a while. The same thing happens, when I try to load a terrain from mapbox

I tried to troubleshoot it with removing and readding code and can't seem to get it to stop. I suppose it has something to do with multiple Patches using the same Material and accessing the same material ID?

It could also be currently buggy, that we hand down the image by ref. I really have no idea. This stuff is pretty much to high for my knowledge level.

To Reproduce Steps to reproduce the behavior:

  1. see above
  2. after a while (usually after a few hundred milliseconds) the editor crashes

Expected behavior The Editor continues to run and renders the chunks

Desktop (please complete the following information):

Additional context I have the a stack trace here, but it isn't really helpful.

ERROR: FATAL: Condition "!Object::cast_to<RefCounted>(p_ptr)" is true.
   at: godotsharp_internal_refcounted_disposed (modules/mono/glue/runtime_interop.cpp:155)

================================================================
handle_crash: Program crashed with signal 4
Engine version: Godot Engine v4.0.beta.mono.custom_build (e93251e6f96cff29cfc9faed525a496e1d436363)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/dotnet/dotnet6-6.0.109/shared/Microsoft.NETCore.App/6.0.9/libcoreclr.so(+0x4b536e) [0x7f1467cb536e] (??:0)
[2] /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7f14a3642520] (??:0)
[3] /opt/Godot/Godot_v4-master_x11_64/godot.linuxbsd.editor.x86_64.llvm.mono(+0xc9880f) [0x5610f282c80f] (??:0)
[4] [0x7f13f0544d5d] (??:0)
-- END OF BACKTRACE --
Sythelux commented 1 year ago

I have progress on this topic. I make it together with this pull request here: https://github.com/sboron/terrain-tool-godot4/pull/16

Bildschirmfoto vom 2022-11-20 19-16-37

It isn't supposed to load the same one 3 times and they are also not supposed to have different height offsets, but I'll get that working as well.

Sythelux commented 1 year ago

Should be fixed with Godot-4.1, but needs verification