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

"Parameter "m" is null." when creating then destroying a scene with a MeshInstance3D while headless. #86806

Closed
Braxtogoo opened this issue Jan 4, 2024 · 8 comments · Fixed by #102261

Comments

@Braxtogoo
Copy link

Braxtogoo commented Jan 4, 2024

Tested versions

  • Reproducible in: v4.2.1.stable.official [b09f793]

System information

Godot v4.2.1.stable - Windows 10.0.19045 - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 3060 (NVIDIA; 31.0.15.3742) - AMD Ryzen 9 5900X 12-Core Processor (24 Threads)

Issue description

I get an error somewhat inconsistently when running a headless server. The most common way I've found to trigger it is to have no mesh instances, create one, then delete it. This will result in the following error.

ERROR: Parameter "m" is null. at: mesh_get_surface_count (servers/rendering/dummy/storage/mesh_storage.h:110)

It rarely triggers when there are more meshes in the scene as well but less consistently. The problem is not related to multiplayer but rather the fact that the game is running headless.

image

The mesh also has to come from an instanced scene containing a MeshInstance3D, simply creating a new MeshInstance3D and destroying it will not cause the error. This doesn't not seem game breaking so far, however it does make server logs pretty messy at times.

Steps to reproduce

-Create an empty scene.
-Create a scene containing a MeshInstance3D.
-Attach a script to your empty scene that instantiates the scene containing the the MeshInstance3D, then destroys it.
-Make the empty scene your main scene.
-Build your project
-Run the project with the "--headless" command line argument.

Minimal reproduction project (MRP)

(How to see the error.)
-Open project.
-Build project with "Export With Debug" checked.
-Run the project from the console with: "Headless Mesh Error.console.exe" --headless

(Make sure not to run "Headless Mesh Error.exe" directly or you'll encounter another bug I found while making this MRP, #86813)

-Enter the command 'create'
-Enter the command 'delete'
-The error should appear.
(Enter the command 'force-error' at any time to let the game automatically force the error to show.)

Headless_Mesh_Error.zip

@DatBear
Copy link

DatBear commented Jun 2, 2024

I see this happening to me a lot more when using Free() instead of QueueFree() on objects that have MeshInstance3Ds.

@czlowiekimadlo
Copy link

Still reproducible in 4.3 stable.

Godot v4.3.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3080 (NVIDIA; 32.0.15.5599) - Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (16 Threads)

@sotornien
Copy link

I have this also with the latest Version. Only difference is mesh_storage.h:120 instead of 110.
I face this on 1 out of 3 players when they disconnecting from the headless server using multiplayer spawner and synchronizer. Seems not to occur when playing the project over the Editor

Image

calling deffered does not change this. But besides of this error, I don't see any problems.

@pewcworrell
Copy link

pewcworrell commented Jan 22, 2025

I'm also hitting this and it's messing with our automated build output, which is exporting builds while headless. Nothing to with multiplayer, as the author mentioned.

@TTMead
Copy link

TTMead commented Jan 24, 2025

I am also getting the same error on Ubuntu headless builds when exiting with get_tree().quit().

Godot Engine v4.3.stable.official.77dcf97d8 - Ubuntu 22.04.5 LTS - dedicated NVIDIA GeForce RTX 4070 - Intel® Core™ i5-10400F CPU @ 2.90GHz × 12

Image

@CoPokBl
Copy link

CoPokBl commented Jan 25, 2025

I get the same error while building a project in a headless server on Ubuntu Server 22.04 while targeting Linux on my CI server.
./Godot_v4.3-stable_linux.x86_64 --debug --headless --export-release windows Game.exe

ERROR: Parameter "m" is null.
   at: mesh_get_surface_count (servers/rendering/dummy/storage/mesh_storage.h:120)

It spams in the console at the end of the build process, and this might not be related but some of the meshes seem to be missing textures (but I assume this is a consequence).

I don't get the error while targeting Windows and I don't know whether the models work because I haven't tested.

@maxhochlenertarnoldnextg

also getting this on ubuntu 24.04 aarch64 headless web export:

Godot --headless output --export-release Web headless_export/

savepack: end
ERROR: Parameter "m" is null.
   at: mesh_get_surface_count (servers/rendering/dummy/storage/mesh_storage.h:114)
ERROR: Parameter "m" is null.
   at: mesh_get_surface_count (servers/rendering/dummy/storage/mesh_storage.h:114)
ERROR: Parameter "m" is null.
   at: mesh_get_surface_count (servers/rendering/dummy/storage/mesh_storage.h:114)
ERROR: Parameter "m" is null.
   at: mesh_get_surface_count (servers/rendering/dummy/storage/mesh_storage.h:114)
ERROR: Parameter "m" is null.
   at: mesh_get_surface_count (servers/rendering/dummy/storage/mesh_storage.h:114)
ERROR: Parameter "m" is null.
   at: mesh_get_surface_count (servers/rendering/dummy/storage/mesh_storage.h:114)
ERROR: Parameter "m" is null.
   at: mesh_get_surface_count (servers/rendering/dummy/storage/mesh_storage.h:114)
ERROR: Parameter "m" is null.
   at: mesh_get_surface_count (servers/rendering/dummy/storage/mesh_storage.h:114)
ERROR: 1 RID allocations of type 'P12GodotShape3D' were leaked at exit.
ERROR: Parameter "PhysicsServer3D::get_singleton()" is null.
   at: ~Shape3D (scene/resources/shape_3d.cpp:131)

@clayjohn
Copy link
Member

clayjohn commented Jan 31, 2025

Thanks everyone for poking on this. I've submitted a fix for this and I hope to include it in 4.4.

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.

10 participants