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

FogMaterial leaks memory when used #84691

Closed
qarmin opened this issue Nov 10, 2023 · 0 comments · Fixed by #84702
Closed

FogMaterial leaks memory when used #84691

qarmin opened this issue Nov 10, 2023 · 0 comments · Fixed by #84702

Comments

@qarmin
Copy link
Contributor

qarmin commented Nov 10, 2023

Godot version

4.2.beta.custom_build. 9df6491

System information

Ubuntu 22.04 CI

Issue description

When executing (this code was automatically minimized, so it is possible, that an even more "minimal" project can be created)

extends Node
func _process(delta):
	var temp_variable38115 = AspectRatioContainer.new()
	add_child(temp_variable38115)
	temp_variable38115.set_material(FogMaterial.new())
	temp_variable38115.draw_rect(Rect2(Vector2(-36.063362121582, -48.1610221862793), Vector2(-41.373592376709, -87.2978134155273)), Color(-65.7108001708984, 93.0576095581055, 63.3741264343262, 1), false, -27.3692429065704)
	temp_variable38115.queue_free()

Godot leaks memory:

Godot Engine v4.2.beta.custom_build.9df649185 - https://godotengine.org
Vulkan API 1.2.0 - Forward Mobile - Using Vulkan Device #0: Unknown - SwiftShader Device (LLVM 10.0.0)
WARNING: The Multi-Threaded rendering thread model is experimental, and has known issues which can lead to project crashes. Use the Single-Safe option in the project settings instead.
     at: setup2 (main/main.cpp:2423)
ERROR: Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.
   at: draw_rect (scene/main/canvas_item.cpp:680)
ERROR: 1 RID allocations of type 'N10RendererRD15MaterialStorage6ShaderE' were leaked at exit.
=================================================================
==18275==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 168 byte(s) in 1 object(s) allocated from:
    #0 0x7f106c0b61e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99
    #1 0x7f105a6670d6  (<unknown module>)
SUMMARY: AddressSanitizer: 168 byte(s) leaked in 1 allocation(s).

This example was found by Godot fuzzer - Qarminer, so it is quite unlikelly that this code could be used in real project, but still this should be handled gracefully.

Memory leaks or asan backtraces are visible when using Godot build with sanitizers support - https://github.com/qarmin/GodotBuilds/actions (linux -> linux-editor-sanitizers)

Steps to reproduce

Above

Minimal reproduction project

Above

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.

2 participants