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

AudioEffectRecord leaks memory when opening and closing editor with project (11 MB) #34495

Closed
Tracked by #76797
qarmin opened this issue Dec 20, 2019 · 3 comments · Fixed by #74985
Closed
Tracked by #76797

AudioEffectRecord leaks memory when opening and closing editor with project (11 MB) #34495

qarmin opened this issue Dec 20, 2019 · 3 comments · Fixed by #74985

Comments

@qarmin
Copy link
Contributor

qarmin commented Dec 20, 2019

Godot version:
Godot 3.2 beta 4
OS/device including version:
Ubuntu 19.10
Issue description:
Sanitizer Log(lsan)

WARNING: cleanup: ObjectDB Instances still exist!
   At: core/object.cpp:2074.
ERROR: clear: Resources Still in use at Exit!
   At: core/resource.cpp:473.

=================================================================
==7977==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 6280 byte(s) in 3 object(s) allocated from:
    #0 0x7f28a81d4ce6 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dce6)
    #1 0x7f289c2c1995  (/lib/x86_64-linux-gnu/libnvidia-glcore.so.435.21+0xe39995)

Direct leak of 512 byte(s) in 1 object(s) allocated from:
    #0 0x7f28a81d4f1e in __interceptor_realloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10df1e)
    #1 0x7f289c2c128f  (/lib/x86_64-linux-gnu/libnvidia-glcore.so.435.21+0xe3928f)

Direct leak of 112 byte(s) in 1 object(s) allocated from:
    #0 0x7f28a81d4ae8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dae8)
    #1 0xea532ff in Memory::alloc_static(unsigned long, bool) core/os/memory.cpp:82
    #2 0xea531fe in operator new(unsigned long, char const*) core/os/memory.cpp:42
    #3 0x4f821e5 in ThreadPosix::create_func_posix(void (*)(void*), void*, Thread::Settings const&) drivers/unix/thread_posix.cpp:83
    #4 0xea676b1 in Thread::create(void (*)(void*), void*, Thread::Settings const&) core/os/thread.cpp:51
    #5 0x894c56f in AudioStreamPreviewGenerator::generate_preview(Ref<AudioStream> const&) editor/audio_stream_preview.cpp:203
    #6 0x7226462 in AudioStreamEditor::_draw_preview() editor/plugins/audio_stream_editor_plugin.cpp:69
    #7 0x178d360 in MethodBind0::call(Object*, Variant const**, int, Variant::CallError&) core/method_bind.gen.inc:59
    #8 0xe52a5cc in Object::call(StringName const&, Variant const**, int, Variant::CallError&) core/object.cpp:921
    #9 0xe533fc4 in Object::emit_signal(StringName const&, Variant const**, int) core/object.cpp:1219
    #10 0xe535f8b in Object::emit_signal(StringName const&, Variant const&, Variant const&, Variant const&, Variant const&, Variant const&) core/object.cpp:1276
    #11 0xae02b5c in CanvasItem::_update_callback() scene/2d/canvas_item.cpp:459
    #12 0x178d360 in MethodBind0::call(Object*, Variant const**, int, Variant::CallError&) core/method_bind.gen.inc:59
    #13 0xe52a5cc in Object::call(StringName const&, Variant const**, int, Variant::CallError&) core/object.cpp:921
    #14 0xe4fa90e in MessageQueue::_call_function(Object*, StringName const&, Variant const*, int, bool) core/message_queue.cpp:250
    #15 0xe4fb667 in MessageQueue::flush() core/message_queue.cpp:297
    #16 0x93f8481 in SceneTree::iteration(float) scene/main/scene_tree.cpp:485
    #17 0x15888b1 in Main::iteration() main/main.cpp:1987
    #18 0x1483056 in OS_X11::run() platform/x11/os_x11.cpp:3255
    #19 0x13fe299 in main platform/x11/godot_x11.cpp:56
    #20 0x7f28a6cb01e2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x271e2)

Direct leak of 4 byte(s) in 1 object(s) allocated from:
    #0 0x7f28a81d4ce6 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dce6)
    #1 0x7f28a7c33842 in pa_xmalloc0 (/lib/x86_64-linux-gnu/libpulse.so.0+0x3b842)

Indirect leak of 1048592 byte(s) in 1 object(s) allocated from:
    #0 0x7f28a81d4ae8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dae8)
    #1 0xea532ff in Memory::alloc_static(unsigned long, bool) core/os/memory.cpp:82
    #2 0x7610c44 in CowData<AudioFrame>::resize(int) core/cowdata.h:275
    #3 0x760e874 in Vector<AudioFrame>::resize(int) core/vector.h:84
    #4 0xda3b1f7 in AudioEffectRecord::instance() servers/audio/effects/audio_effect_record.cpp:166
    #5 0xca1421a in AudioServer::_update_bus_effects(int) servers/audio_server.cpp:821
    #6 0xca28460 in AudioServer::set_bus_layout(Ref<AudioBusLayout> const&) servers/audio_server.cpp:1261
    #7 0xca206ca in AudioServer::load_default_bus_layout() servers/audio_server.cpp:1073
    #8 0x1571fc5 in Main::setup2(unsigned long) main/main.cpp:1368
    #9 0x15668ae in Main::setup(char const*, int, char**, bool) main/main.cpp:1136
    #10 0x13fe19b in main platform/x11/godot_x11.cpp:49
    #11 0x7f28a6cb01e2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x271e2)

Indirect leak of 72672 byte(s) in 224 object(s) allocated from:
    #0 0x7f28a81d4ce6 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dce6)
    #1 0x7f289c2c1995  (/lib/x86_64-linux-gnu/libnvidia-glcore.so.435.21+0xe39995)

Indirect leak of 2478 byte(s) in 179 object(s) allocated from:
    #0 0x7f28a81d4ae8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dae8)
    #1 0x7f289c2c1b5b  (/lib/x86_64-linux-gnu/libnvidia-glcore.so.435.21+0xe39b5b)

Indirect leak of 752 byte(s) in 6 object(s) allocated from:
    #0 0x7f28a81d4f1e in __interceptor_realloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10df1e)
    #1 0x7f289c2c128f  (/lib/x86_64-linux-gnu/libnvidia-glcore.so.435.21+0xe3928f)

Indirect leak of 432 byte(s) in 1 object(s) allocated from:
    #0 0x7f28a81d4ae8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dae8)
    #1 0xea532ff in Memory::alloc_static(unsigned long, bool) core/os/memory.cpp:82
    #2 0xea531fe in operator new(unsigned long, char const*) core/os/memory.cpp:42
    #3 0xcd8905b in Object* ClassDB::creator<AudioEffectRecord>() core/class_db.h:142
    #4 0xe2c5fd6 in ClassDB::instance(StringName const&) core/class_db.cpp:541
    #5 0xc15366d in ResourceInteractiveLoaderText::poll() scene/resources/resource_format_text.cpp:495
    #6 0xeee4c3e in ResourceFormatLoader::load(String const&, String const&, Error*) core/io/resource_loader.cpp:197
    #7 0xeeea918 in ResourceLoader::_load(String const&, String const&, String const&, bool, Error*) core/io/resource_loader.cpp:270
    #8 0xeeed0fc in ResourceLoader::load(String const&, String const&, bool, Error*) core/io/resource_loader.cpp:396
    #9 0xca20510 in AudioServer::load_default_bus_layout() servers/audio_server.cpp:1071
    #10 0x1571fc5 in Main::setup2(unsigned long) main/main.cpp:1368
    #11 0x15668ae in Main::setup(char const*, int, char**, bool) main/main.cpp:1136
    #12 0x13fe19b in main platform/x11/godot_x11.cpp:49
    #13 0x7f28a6cb01e2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x271e2)

Indirect leak of 360 byte(s) in 1 object(s) allocated from:
    #0 0x7f28a81d4ae8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dae8)
    #1 0xea532ff in Memory::alloc_static(unsigned long, bool) core/os/memory.cpp:82
    #2 0xea531fe in operator new(unsigned long, char const*) core/os/memory.cpp:42
    #3 0xda47bb9 in Ref<AudioEffectRecordInstance>::instance() core/reference.h:285
    #4 0xda3a973 in AudioEffectRecord::instance() servers/audio/effects/audio_effect_record.cpp:144
    #5 0xca1421a in AudioServer::_update_bus_effects(int) servers/audio_server.cpp:821
    #6 0xca28460 in AudioServer::set_bus_layout(Ref<AudioBusLayout> const&) servers/audio_server.cpp:1261
    #7 0xca206ca in AudioServer::load_default_bus_layout() servers/audio_server.cpp:1073
    #8 0x1571fc5 in Main::setup2(unsigned long) main/main.cpp:1368
    #9 0x15668ae in Main::setup(char const*, int, char**, bool) main/main.cpp:1136
    #10 0x13fe19b in main platform/x11/godot_x11.cpp:49
    #11 0x7f28a6cb01e2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x271e2)

Indirect leak of 272 byte(s) in 1 object(s) allocated from:
    #0 0x7f28a81d4f1e in __interceptor_realloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10df1e)
    #1 0xea53d97 in Memory::realloc_static(void*, unsigned long, bool) core/os/memory.cpp:137
    #2 0x337f77e in CowData<wchar_t>::resize(int) core/cowdata.h:283
    #3 0x55d062b in String::resize(int) core/ustring.h:154
    #4 0xe6f0151 in String::operator+=(String const&) core/ustring.cpp:281
    #5 0xe6efe04 in String::operator+(String const&) const core/ustring.cpp:257
    #6 0xc153569 in ResourceInteractiveLoaderText::poll() scene/resources/resource_format_text.cpp:487
    #7 0xeee4c3e in ResourceFormatLoader::load(String const&, String const&, Error*) core/io/resource_loader.cpp:197
    #8 0xeeea918 in ResourceLoader::_load(String const&, String const&, String const&, bool, Error*) core/io/resource_loader.cpp:270
    #9 0xeeed0fc in ResourceLoader::load(String const&, String const&, bool, Error*) core/io/resource_loader.cpp:396
    #10 0xca20510 in AudioServer::load_default_bus_layout() servers/audio_server.cpp:1071
    #11 0x1571fc5 in Main::setup2(unsigned long) main/main.cpp:1368
    #12 0x15668ae in Main::setup(char const*, int, char**, bool) main/main.cpp:1136
    #13 0x13fe19b in main platform/x11/godot_x11.cpp:49
    #14 0x7f28a6cb01e2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x271e2)

Indirect leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7f28a81d4ae8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dae8)
    #1 0xea532ff in Memory::alloc_static(unsigned long, bool) core/os/memory.cpp:82
    #2 0xea531fe in operator new(unsigned long, char const*) core/os/memory.cpp:42
    #3 0xe3423de in Dictionary::Dictionary() core/dictionary.cpp:279
    #4 0xe54da35 in Object::Object() core/object.cpp:1918
    #5 0xe5efef1 in Reference::Reference() core/reference.cpp:105
    #6 0xd95580b in AudioEffectInstance::AudioEffectInstance() servers/audio/audio_effect.h:37
    #7 0xda44397 in AudioEffectRecordInstance::AudioEffectRecordInstance() servers/audio/effects/audio_effect_record.h:75
    #8 0xda47be6 in Ref<AudioEffectRecordInstance>::instance() core/reference.h:285
    #9 0xda3a973 in AudioEffectRecord::instance() servers/audio/effects/audio_effect_record.cpp:144
    #10 0xca1421a in AudioServer::_update_bus_effects(int) servers/audio_server.cpp:821
    #11 0xca28460 in AudioServer::set_bus_layout(Ref<AudioBusLayout> const&) servers/audio_server.cpp:1261
    #12 0xca206ca in AudioServer::load_default_bus_layout() servers/audio_server.cpp:1073
    #13 0x1571fc5 in Main::setup2(unsigned long) main/main.cpp:1368
    #14 0x15668ae in Main::setup(char const*, int, char**, bool) main/main.cpp:1136
    #15 0x13fe19b in main platform/x11/godot_x11.cpp:49
    #16 0x7f28a6cb01e2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x271e2)

Indirect leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7f28a81d4f1e in __interceptor_realloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10df1e)
    #1 0xea53d97 in Memory::realloc_static(void*, unsigned long, bool) core/os/memory.cpp:137
    #2 0x337f77e in CowData<wchar_t>::resize(int) core/cowdata.h:283
    #3 0x55d062b in String::resize(int) core/ustring.h:154
    #4 0xe6f08eb in String::operator+=(wchar_t) core/ustring.cpp:302
    #5 0xe93ddd1 in VariantParser::get_token(VariantParser::Stream*, VariantParser::Token&, int&, String&) core/variant_parser.cpp:281
    #6 0xe9536bf in VariantParser::parse_tag_assign_eof(VariantParser::Stream*, int&, String&, VariantParser::Tag&, String&, Variant&, VariantParser::ResourceParser*, bool) core/variant_parser.cpp:1535
    #7 0xc15554b in ResourceInteractiveLoaderText::poll() scene/resources/resource_format_text.cpp:525
    #8 0xeee4c3e in ResourceFormatLoader::load(String const&, String const&, Error*) core/io/resource_loader.cpp:197
    #9 0xeeea918 in ResourceLoader::_load(String const&, String const&, String const&, bool, Error*) core/io/resource_loader.cpp:270
    #10 0xeeed0fc in ResourceLoader::load(String const&, String const&, bool, Error*) core/io/resource_loader.cpp:396
    #11 0xca20510 in AudioServer::load_default_bus_layout() servers/audio_server.cpp:1071
    #12 0x1571fc5 in Main::setup2(unsigned long) main/main.cpp:1368
    #13 0x15668ae in Main::setup(char const*, int, char**, bool) main/main.cpp:1136
    #14 0x13fe19b in main platform/x11/godot_x11.cpp:49
    #15 0x7f28a6cb01e2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x271e2)

Indirect leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7f28a81d4ae8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dae8)
    #1 0xea532ff in Memory::alloc_static(unsigned long, bool) core/os/memory.cpp:82
    #2 0xea531fe in operator new(unsigned long, char const*) core/os/memory.cpp:42
    #3 0xe3423de in Dictionary::Dictionary() core/dictionary.cpp:279
    #4 0xe54da35 in Object::Object() core/object.cpp:1918
    #5 0xe5efef1 in Reference::Reference() core/reference.cpp:105
    #6 0xe63ba61 in Resource::Resource() core/resource.cpp:429
    #7 0xdd2924b in AudioEffect::AudioEffect() servers/audio/audio_effect.cpp:33
    #8 0xda410e5 in AudioEffectRecord::AudioEffectRecord() servers/audio/effects/audio_effect_record.cpp:299
    #9 0xcd89088 in Object* ClassDB::creator<AudioEffectRecord>() core/class_db.h:142
    #10 0xe2c5fd6 in ClassDB::instance(StringName const&) core/class_db.cpp:541
    #11 0xc15366d in ResourceInteractiveLoaderText::poll() scene/resources/resource_format_text.cpp:495
    #12 0xeee4c3e in ResourceFormatLoader::load(String const&, String const&, Error*) core/io/resource_loader.cpp:197
    #13 0xeeea918 in ResourceLoader::_load(String const&, String const&, String const&, bool, Error*) core/io/resource_loader.cpp:270
    #14 0xeeed0fc in ResourceLoader::load(String const&, String const&, bool, Error*) core/io/resource_loader.cpp:396
    #15 0xca20510 in AudioServer::load_default_bus_layout() servers/audio_server.cpp:1071
    #16 0x1571fc5 in Main::setup2(unsigned long) main/main.cpp:1368
    #17 0x15668ae in Main::setup(char const*, int, char**, bool) main/main.cpp:1136
    #18 0x13fe19b in main platform/x11/godot_x11.cpp:49
    #19 0x7f28a6cb01e2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x271e2)

Steps to reproduce:

  1. Open editor with project
  2. Close editor
    Minimal reproduction project:
    https://github.com/godotengine/godot-demo-projects/tree/master/audio/mic_record
@qarmin
Copy link
Contributor Author

qarmin commented Jun 29, 2020

New minimal project(really small - 2 files 801 bytes) - Mini.zip

@akien-mga akien-mga added this to the 4.0 milestone Jun 29, 2020
@akien-mga akien-mga changed the title Memory leak when opening and closing editor with project (11 MB) AudioEffectRecord leaks memory when opening and closing editor with project (11 MB) Jun 29, 2020
@akien-mga
Copy link
Member

akien-mga commented Jun 29, 2020

Update lsan output with the minimal project (from 3.2 branch):

WARNING: cleanup: ObjectDB instances leaked at exit (run with --verbose for details).
   At: core/object.cpp:2135.
Leaked instance: AudioEffectRecordInstance:1180
Leaked instance: AudioEffectRecord:1176 - Resource path: res://default_bus_layout.tres::1
Hint: Leaked instances typically happen when nodes are removed from the scene tree (with `remove_child()`) but not freed (with `free()` or `queue_free()`).
ERROR: clear: Resources still in use at exit (run with --verbose for details).
   At: core/resource.cpp:477.
Resource still in use: res://default_bus_layout.tres::1 (AudioEffectRecord)
Orphan StringName: AudioEffectRecordInstance
Orphan StringName: AudioEffectRecord
StringName: 2 unclaimed string names at exit.

=================================================================
==417246==ERROR: LeakSanitizer: detected memory leaks

Indirect leak of 1048592 byte(s) in 1 object(s) allocated from:
    #0 0x7f636c15de70 in malloc (/lib64/liblsan.so.0+0xee70)
    #1 0x3a06f2f in Memory::alloc_static(unsigned long, bool) core/os/memory.cpp:82
    #2 0x25e107b in CowData<AudioFrame>::resize(int) core/cowdata.h:279
    #3 0x25e07c1 in Vector<AudioFrame>::resize(int) core/vector.h:84
    #4 0x371ba5d in AudioEffectRecord::instance() servers/audio/effects/audio_effect_record.cpp:166
    #5 0x34a7a0b in AudioServer::_update_bus_effects(int) servers/audio_server.cpp:820
    #6 0x34aab22 in AudioServer::set_bus_layout(Ref<AudioBusLayout> const&) servers/audio_server.cpp:1257
    #7 0x34a9ec8 in AudioServer::load_default_bus_layout() servers/audio_server.cpp:1070
    #8 0x1459747 in Main::setup2(unsigned long) main/main.cpp:1435
    #9 0x14562eb in Main::setup(char const*, int, char**, bool) main/main.cpp:1199
    #10 0x141f677 in main platform/x11/godot_x11.cpp:49
    #11 0x7f636b92bcd9 in __libc_start_main (/lib64/libc.so.6+0x26cd9)

Indirect leak of 440 byte(s) in 1 object(s) allocated from:
    #0 0x7f636c15de70 in malloc (/lib64/liblsan.so.0+0xee70)
    #1 0x3a06f2f in Memory::alloc_static(unsigned long, bool) core/os/memory.cpp:82
    #2 0x3a06ed8 in operator new(unsigned long, char const*) core/os/memory.cpp:42
    #3 0x354fb39 in Object* ClassDB::creator<AudioEffectRecord>() core/class_db.h:143
    #4 0x384b6ee in ClassDB::instance(StringName const&) core/class_db.cpp:548
    #5 0x32ffc26 in ResourceInteractiveLoaderText::poll() scene/resources/resource_format_text.cpp:495
    #6 0x3add41d in ResourceFormatLoader::load(String const&, String const&, Error*) core/io/resource_loader.cpp:197
    #7 0x3aded1f in ResourceLoader::_load(String const&, String const&, String const&, bool, Error*) core/io/resource_loader.cpp:270
    #8 0x3adf822 in ResourceLoader::load(String const&, String const&, bool, Error*) core/io/resource_loader.cpp:401
    #9 0x34a9e7a in AudioServer::load_default_bus_layout() servers/audio_server.cpp:1068
    #10 0x1459747 in Main::setup2(unsigned long) main/main.cpp:1435
    #11 0x14562eb in Main::setup(char const*, int, char**, bool) main/main.cpp:1199
    #12 0x141f677 in main platform/x11/godot_x11.cpp:49
    #13 0x7f636b92bcd9 in __libc_start_main (/lib64/libc.so.6+0x26cd9)

Indirect leak of 368 byte(s) in 1 object(s) allocated from:
    #0 0x7f636c15de70 in malloc (/lib64/liblsan.so.0+0xee70)
    #1 0x3a06f2f in Memory::alloc_static(unsigned long, bool) core/os/memory.cpp:82
    #2 0x3a06ed8 in operator new(unsigned long, char const*) core/os/memory.cpp:42
    #3 0x371dadb in Ref<AudioEffectRecordInstance>::instance() core/reference.h:285
    #4 0x371b932 in AudioEffectRecord::instance() servers/audio/effects/audio_effect_record.cpp:144
    #5 0x34a7a0b in AudioServer::_update_bus_effects(int) servers/audio_server.cpp:820
    #6 0x34aab22 in AudioServer::set_bus_layout(Ref<AudioBusLayout> const&) servers/audio_server.cpp:1257
    #7 0x34a9ec8 in AudioServer::load_default_bus_layout() servers/audio_server.cpp:1070
    #8 0x1459747 in Main::setup2(unsigned long) main/main.cpp:1435
    #9 0x14562eb in Main::setup(char const*, int, char**, bool) main/main.cpp:1199
    #10 0x141f677 in main platform/x11/godot_x11.cpp:49
    #11 0x7f636b92bcd9 in __libc_start_main (/lib64/libc.so.6+0x26cd9)

Indirect leak of 272 byte(s) in 1 object(s) allocated from:
    #0 0x7f636c15e185 in realloc (/lib64/liblsan.so.0+0xf185)
    #1 0x3a07182 in Memory::realloc_static(void*, unsigned long, bool) core/os/memory.cpp:137
    #2 0x19c8a60 in CowData<wchar_t>::resize(int) core/cowdata.h:287
    #3 0x2033d1f in String::resize(int) core/ustring.h:154
    #4 0x3934957 in String::operator+=(String const&) core/ustring.cpp:281
    #5 0x3934890 in String::operator+(String const&) const core/ustring.cpp:257
    #6 0x32ffba8 in ResourceInteractiveLoaderText::poll() scene/resources/resource_format_text.cpp:487
    #7 0x3add41d in ResourceFormatLoader::load(String const&, String const&, Error*) core/io/resource_loader.cpp:197
    #8 0x3aded1f in ResourceLoader::_load(String const&, String const&, String const&, bool, Error*) core/io/resource_loader.cpp:270
    #9 0x3adf822 in ResourceLoader::load(String const&, String const&, bool, Error*) core/io/resource_loader.cpp:401
    #10 0x34a9e7a in AudioServer::load_default_bus_layout() servers/audio_server.cpp:1068
    #11 0x1459747 in Main::setup2(unsigned long) main/main.cpp:1435
    #12 0x14562eb in Main::setup(char const*, int, char**, bool) main/main.cpp:1199
    #13 0x141f677 in main platform/x11/godot_x11.cpp:49
    #14 0x7f636b92bcd9 in __libc_start_main (/lib64/libc.so.6+0x26cd9)

Indirect leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7f636c15e185 in realloc (/lib64/liblsan.so.0+0xf185)
    #1 0x3a07182 in Memory::realloc_static(void*, unsigned long, bool) core/os/memory.cpp:137
    #2 0x19c8a60 in CowData<wchar_t>::resize(int) core/cowdata.h:287
    #3 0x2033d1f in String::resize(int) core/ustring.h:154
    #4 0x3934aae in String::operator+=(wchar_t) core/ustring.cpp:302
    #5 0x39cac79 in VariantParser::get_token(VariantParser::Stream*, VariantParser::Token&, int&, String&) core/variant_parser.cpp:287
    #6 0x39d10e8 in VariantParser::parse_tag_assign_eof(VariantParser::Stream*, int&, String&, VariantParser::Tag&, String&, Variant&, VariantParser::ResourceParser*, bool) core/variant_parser.cpp:1505
    #7 0x33001a5 in ResourceInteractiveLoaderText::poll() scene/resources/resource_format_text.cpp:525
    #8 0x3add41d in ResourceFormatLoader::load(String const&, String const&, Error*) core/io/resource_loader.cpp:197
    #9 0x3aded1f in ResourceLoader::_load(String const&, String const&, String const&, bool, Error*) core/io/resource_loader.cpp:270
    #10 0x3adf822 in ResourceLoader::load(String const&, String const&, bool, Error*) core/io/resource_loader.cpp:401
    #11 0x34a9e7a in AudioServer::load_default_bus_layout() servers/audio_server.cpp:1068
    #12 0x1459747 in Main::setup2(unsigned long) main/main.cpp:1435
    #13 0x14562eb in Main::setup(char const*, int, char**, bool) main/main.cpp:1199
    #14 0x141f677 in main platform/x11/godot_x11.cpp:49
    #15 0x7f636b92bcd9 in __libc_start_main (/lib64/libc.so.6+0x26cd9)

Indirect leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7f636c15de70 in malloc (/lib64/liblsan.so.0+0xee70)
    #1 0x3a06f2f in Memory::alloc_static(unsigned long, bool) core/os/memory.cpp:82
    #2 0x3a06ed8 in operator new(unsigned long, char const*) core/os/memory.cpp:42
    #3 0x3868a97 in Dictionary::Dictionary() core/dictionary.cpp:279
    #4 0x38ddc32 in Object::Object() core/object.cpp:1966
    #5 0x38fe31c in Reference::Reference() core/reference.cpp:105
    #6 0x36eff0c in AudioEffectInstance::AudioEffectInstance() servers/audio/audio_effect.h:37
    #7 0x371d1d0 in AudioEffectRecordInstance::AudioEffectRecordInstance() servers/audio/effects/audio_effect_record.h:75
    #8 0x371dae6 in Ref<AudioEffectRecordInstance>::instance() core/reference.h:285
    #9 0x371b932 in AudioEffectRecord::instance() servers/audio/effects/audio_effect_record.cpp:144
    #10 0x34a7a0b in AudioServer::_update_bus_effects(int) servers/audio_server.cpp:820
    #11 0x34aab22 in AudioServer::set_bus_layout(Ref<AudioBusLayout> const&) servers/audio_server.cpp:1257
    #12 0x34a9ec8 in AudioServer::load_default_bus_layout() servers/audio_server.cpp:1070
    #13 0x1459747 in Main::setup2(unsigned long) main/main.cpp:1435
    #14 0x14562eb in Main::setup(char const*, int, char**, bool) main/main.cpp:1199
    #15 0x141f677 in main platform/x11/godot_x11.cpp:49
    #16 0x7f636b92bcd9 in __libc_start_main (/lib64/libc.so.6+0x26cd9)

Indirect leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7f636c15de70 in malloc (/lib64/liblsan.so.0+0xee70)
    #1 0x3a06f2f in Memory::alloc_static(unsigned long, bool) core/os/memory.cpp:82
    #2 0x3a06ed8 in operator new(unsigned long, char const*) core/os/memory.cpp:42
    #3 0x3868a97 in Dictionary::Dictionary() core/dictionary.cpp:279
    #4 0x38ddc32 in Object::Object() core/object.cpp:1966
    #5 0x38fe31c in Reference::Reference() core/reference.cpp:105
    #6 0x3911638 in Resource::Resource() core/resource.cpp:433
    #7 0x377c768 in AudioEffect::AudioEffect() servers/audio/audio_effect.cpp:33
    #8 0x371c9ce in AudioEffectRecord::AudioEffectRecord() servers/audio/effects/audio_effect_record.cpp:299
    #9 0x354fb44 in Object* ClassDB::creator<AudioEffectRecord>() core/class_db.h:143
    #10 0x384b6ee in ClassDB::instance(StringName const&) core/class_db.cpp:548
    #11 0x32ffc26 in ResourceInteractiveLoaderText::poll() scene/resources/resource_format_text.cpp:495
    #12 0x3add41d in ResourceFormatLoader::load(String const&, String const&, Error*) core/io/resource_loader.cpp:197
    #13 0x3aded1f in ResourceLoader::_load(String const&, String const&, String const&, bool, Error*) core/io/resource_loader.cpp:270
    #14 0x3adf822 in ResourceLoader::load(String const&, String const&, bool, Error*) core/io/resource_loader.cpp:401
    #15 0x34a9e7a in AudioServer::load_default_bus_layout() servers/audio_server.cpp:1068
    #16 0x1459747 in Main::setup2(unsigned long) main/main.cpp:1435
    #17 0x14562eb in Main::setup(char const*, int, char**, bool) main/main.cpp:1199
    #18 0x141f677 in main platform/x11/godot_x11.cpp:49
    #19 0x7f636b92bcd9 in __libc_start_main (/lib64/libc.so.6+0x26cd9)

SUMMARY: LeakSanitizer: 1049816 byte(s) leaked in 7 allocation(s).

@jcommander
Copy link

AudioEffectRecord also still leaks if I play my Project.
Is there a way to free those instances manually as a workaround?

Godot Version:
v3.5.stable.mono.official [991bb6a]
OS
Windows 10

Debug Output

WARNING: ObjectDB instances leaked at exit (run with --verbose for details).
     at: cleanup (core/object.cpp:2070)
Leaked instance: AudioEffectRecord:1277 - Resource path: res://audio/default_bus_layout.tres::1
Leaked instance: AudioEffectRecordInstance:1279
Hint: Leaked instances typically happen when nodes are removed from the scene tree (with `remove_child()`) but not freed (with `free()` or `queue_free()`).
ERROR: Resources still in use at exit (run with --verbose for details).
   at: clear (core/resource.cpp:417)
Resource still in use: res://audio/default_bus_layout.tres::1 (AudioEffectRecord)
Orphan StringName: AudioEffectRecordInstance
Orphan StringName: AudioEffectRecord
StringName: 2 unclaimed string names at exit.

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.

5 participants