TokisanGames/Terrain3D

Crash in 4.3-beta1 when dragging over non-terrain

Opened this issue · 10 comments

Terrain3D version

v0.9.1

System information

Windows 11, geForce 4080, Godot 4.3-beta1, Forward+

Is the issue reproducable in the demo?

Not applicable

Issue description

If I create a new 3D scene with no terrain at all, add a mesh and drag over it in the viewport with my mouse, Godot crashes.

  • This is replicateable in 4.3-beta1
  • This is NOT replicateable in in 4.3-dev6

Demo video:

2024-06-04.16-30-10_1.mp4

Here's the project I used:

nhgcrash.zip

Logs

CrashHandlerException: Program crashed with signal 11
Engine version: Godot Engine v4.3.beta1.official (a4f2ea91a1bd18f70a43ff4c1377db49b56bc3f0)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] error(-1): no debug info in PE/COFF executable
[2] error(-1): no debug info in PE/COFF executable
[3] error(-1): no debug info in PE/COFF executable
[4] error(-1): no debug info in PE/COFF executable
[5] error(-1): no debug info in PE/COFF executable
[6] error(-1): no debug info in PE/COFF executable
[7] error(-1): no debug info in PE/COFF executable
[8] error(-1): no debug info in PE/COFF executable
[9] error(-1): no debug info in PE/COFF executable                                                                      [10] error(-1): no debug info in PE/COFF executable                                                                     [11] error(-1): no debug info in PE/COFF executable                                                                     [12] error(-1): no debug info in PE/COFF executable                                                                     [13] error(-1): no debug info in PE/COFF executable                                                                     [14] error(-1): no debug info in PE/COFF executable                                                                     [15] error(-1): no debug info in PE/COFF executable                                                                     [16] error(-1): no debug info in PE/COFF executable                                                                     [17] error(-1): no debug info in PE/COFF executable                                                                     [18] error(-1): no debug info in PE/COFF executable                                                                     [19] error(-1): no debug info in PE/COFF executable                                                                     [20] error(-1): no debug info in PE/COFF executable                                                                     [21] error(-1): no debug info in PE/COFF executable
[22] error(-1): no debug info in PE/COFF executable
[23] error(-1): no debug info in PE/COFF executable
[24] error(-1): no debug info in PE/COFF executable
[25] error(-1): no debug info in PE/COFF executable
[26] error(-1): no debug info in PE/COFF executable
-- END OF BACKTRACE --
================================================================

Thanks for the report. Can you format your logs with 3 back ticks on blank lines before and after them? It's hard to read.

4.3 isn't supported yet.

Does this crash happen if the Terrain3D plugin is not enabled?

Nothing you did in the video should have triggered Terrain3D.

As soon as I disable the terrain3d plugin the crashes stop.

0.9.1 was built for Godot 4.1. Try a nightly build. I can't reproduce it in 4.3beta1.

I can also replicate in 4.2.2-stable.

  • Create a new project and open it. Do nothing - just leave the current viewport open.
  • Download the 0.9.1 release zip and drop it in your project folder. Extract the addons directory
  • Alt tab back to your opened project, hit 'Save & Restart' that pops up
  • Once restarted, enable the plugin in project settings, hit close then left click and drag anywhere on the 3D viewport. Godot will crash.

I tried with 0.9.1-beta and 0.9.0-beta.

Try a nightly build. I can't reproduce it in 4.3beta1.

Do you mean a nightly build of Terrain3D? Where do I get it from?

Confirmed/Replicated

System:
Godot v4.2.2.stable.mono - Linux Mint 21.3 (Virginia) - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4060 Ti () - AMD Ryzen 7 5700X 8-Core Processor (16 Threads)

Steps taken to reproduce:

Create a new project and open it. Do nothing - just leave the current viewport open.
Download the 0.9.1 release zip and drop it in your project folder. Extract the addons directory
Alt tab back to your opened project, hit 'Save & Restart' that pops up
Once restarted, enable the plugin in project settings, hit close then drag anywhere on the 3D viewport. Godot will crash.

Tested with 0.9.1-beta

For added information, I ran godot in terminal and redirected stderr to stdout, and it crashes without an exit code

Do you mean a nightly build of Terrain3D? Where do I get it from?

Thanks for the further instructions and testing. Please try a nightly build. Nightly builds are available in the Actions menu. See https://terrain3d.readthedocs.io/en/latest/docs/nightly_builds.html

I will use the steps to debug the current version and if I must 0.9.1. 0.9.1 is very old and we are about to release 0.9.2.

Do you mean a nightly build of Terrain3D? Where do I get it from?

Thanks for the further instructions and testing. Please try a nightly build. Nightly builds are available in the Actions menu. See https://terrain3d.readthedocs.io/en/latest/docs/nightly_builds.html

I will use the steps to debug the current version and if I must 0.9.1. 0.9.1 is very old and we are about to release 0.9.2.

The last time your workflows ran was 2 months ago

Please look again at the link I sent. The main branch last built June 10th, 9th, 1st. Even the 0.9 branch, which is not the right branch to test built June 10th.

Still crashes in the same manner with the nightly build.

You found an engine bug. I debugged the engine with Terrain3D 0.9.2 dev build and Godot 4.2.2-stable.

Node3DEditorViewport
node_3d_editor_plugin.cpp

	Node *edited_scene = get_tree()->get_edited_scene_root();

	for (int i = 0; i < instances.size(); i++) {
		Node3D *sp = Object::cast_to<Node3D>(ObjectDB::get_instance(instances[i]));
		if (!sp || _is_node_locked(sp)) {
			continue;
		}

		if (found_nodes.has(sp)) {
			continue;
		}

		found_nodes.insert(sp);

		Node *item = Object::cast_to<Node>(sp);
		if (item != edited_scene) {
			item = edited_scene->get_deepest_editable_node(item); // **** Crashes here, Line 1034 ****
		}

Line 1034, edited_scene is null, which makes sense because there is no scene open and this class never checks for it.

Upstream bug report godotengine/godot#93403
Pending PR godotengine/godot#93404