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

Godot 4.1 crash at exit with corrupted size vs. prev_size while consolidating #79286

Closed
MikeSchulze opened this issue Jul 10, 2023 · 5 comments
Closed

Comments

@MikeSchulze
Copy link

Godot version

v4.1.stable.official [9704596]

System information

ubuntu-22.04

Issue description

i run my tests via github actions ci workflow and it crashs now on Godot 4.1

xvfb-run --auto-servernum ./addons/gdUnit4/runtest.sh --add ${{ inputs.test-includes }} --audio-driver Dummy --display-driver x11 --rendering-driver opengl3 --screen 0 --continue --verbose

It works on Godot 4.0.1, 4.0.2 and 4.0.3 but fails now on v4.1.stable.official [https://github.com/godotengine/godot/commit/970459615f6b2b4151742ec6d7ef8559f87fd5c5]

running on ubuntu-latest

Total test suites: 90
Total test cases:  1142
Total time:        3min 40s 913ms
Open Report at: file:///home/runner/work/gdUnit4/gdUnit4/reports/report_1/index.html
Exit code: 0
corrupted size vs. prev_size while consolidating
Aborted (core dumped)
Error: Process completed with exit code 134.

MikeSchulze/gdUnit4#223

I build a minimized project the test on my Mac and see these errors.

at runtime, a lot of

ERROR: Condition "!texture_allocs_cache.has(p_id)" is true.
   at: texture_free_data (drivers/gles3/storage/utilities.h:111)
ERROR: Condition "!texture_allocs_cache.has(p_id)" is true.
   at: texture_free_data (drivers/gles3/storage/utilities.h:111)
ERROR: Condition "!texture_allocs_cache.has(p_id)" is true.
   at: texture_free_data (drivers/gles3/storage/utilities.h:111)
ERROR: Condition "!texture_allocs_cache.has(p_id)" is true.
   at: texture_free_data (drivers/gles3/storage/utilities.h:111)
...   
ERROR: Cubemap Arrays are not supported in the GL Compatibility backend.
   at: texture_2d_layered_initialize (drivers/gles3/storage/texture_storage.cpp:763)
ERROR: Cubemap Arrays are not supported in the GL Compatibility backend.
   at: texture_2d_layered_initialize (drivers/gles3/storage/texture_storage.cpp:763)
ERROR: Attempting to use an uninitialized RID
   at: get_or_null (./core/templates/rid_owner.h:199)
ERROR: Condition "!t" is true.
   at: texture_free (drivers/gles3/storage/texture_storage.cpp:705)

at cleanup

ERROR: Attempting to use an uninitialized RID
   at: get_or_null (./core/templates/rid_owner.h:199)
ERROR: Condition "!t" is true.
   at: texture_free (drivers/gles3/storage/texture_storage.cpp:705)

could be related to #74562

Steps to reproduce

use the attached project to reproduce the errors

Run it with $GODOT_BIN --path . -s -d res://test.gd --audio-driver Dummy --rendering-driver opengl3 --continue
shows

 malloc_texture $GODOT_BIN --path . -s -d res://test.gd --audio-driver Dummy --rendering-driver opengl3 --continue
Godot Engine v4.1.stable.official.970459615 - https://godotengine.org
OpenGL API 4.1 ATI-4.4.17 - Compatibility - Using Device: ATI Technologies Inc. - AMD Radeon Pro 5300M OpenGL Engine
 
run test
ERROR: Condition "!texture_allocs_cache.has(p_id)" is true.
   at: texture_free_data (drivers/gles3/storage/utilities.h:111)
Finallize ..
-Orphan nodes report-----------------------
-SceneTree report-----------------------
 ┖╴root
Finallize .. done

Minimal reproduction project

malloc_texture.zip

@akien-mga
Copy link
Member

Possibly related to #78749.

@MikeSchulze
Copy link
Author

MikeSchulze commented Jul 18, 2023

The same error exists on V4.1.1 , it let fail my CI workflow.
If there any workaround exists?

@YuriSizov
Copy link
Contributor

YuriSizov commented Nov 15, 2023

I don't get a crash. The window is locked, but the process is ongoing. It just does nothing. In 4.2 beta 6 I get this error:

run test
Finallize ..

Debugger Break, Reason: 'Attempt to call function 'free' in base 'previously freed' on a null instance.'
*Frame 0 - res://test.gd:50 in function '_finalize'
Enter "help" for assistance.

You are attempting to free the instance of a node that was previously added to the scene tree, but I guess this is unnecessary, as the node has been freed already? In fact, every line in the finalize method raises an error that prevents the application from closing:

func _finalize():
	prints("Finallize ..")
	_cli_runner.free() // Attempting to free a freed object.
	prints("-Orphan nodes report-----------------------")
	Window.print_orphan_nodes() // Window is a null instance, this code doesn't even make logical sense as Window is a class name.
	prints("-SceneTree report-----------------------")
	root.print_tree_pretty() // root is a null instance, it's been freed already, same as the CLI Runner instance.
	prints("Finallize .. done")

Removing all these erroneous lines resolves the hanging on exit. So there is no crash and the only issues I could find are in user code. And the texture issue has been addressed already by the linked PR.

I'm going to close this as resolved. If you can still reproduce an issue, please provide a valid MRP for testing.

@MikeSchulze
Copy link
Author

MikeSchulze commented Nov 15, 2023

Thanks for your response.
I fixed it already by

func _finalize():
	prints("Finallize ..")
	if is_instance_valid(_cli_runner):
		_cli_runner.free()
	prints("-Orphan nodes report-----------------------")
	Window.print_orphan_nodes()
	prints("Finallize .. done")

Sounds like the _finalize is called when the tree is already freed?
So it is safe to remove the _cli_runner.free() right?

@YuriSizov
Copy link
Contributor

Seems like it, yeah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants