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

Address Sanitizer not showing full stack trace #1824

Open
rvanlaar opened this issue Nov 29, 2024 · 0 comments
Open

Address Sanitizer not showing full stack trace #1824

rvanlaar opened this issue Nov 29, 2024 · 0 comments

Comments

@rvanlaar
Copy link

rvanlaar commented Nov 29, 2024

In Scummvm this commit [1] solved a memory leak that occurred because the return variable of GetPreferredLocales [1]
should be freed.

The relevant output from our code with ASAN enabled:

WARNING: Score::startLoop(): exiting due to debug few frames only!

=================================================================
==3621583==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 76 byte(s) in 2 object(s) allocated from:
    #0 0x7f8272a6fa57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
    #1 0x7f827287d4a5 in SDL_calloc_REAL /home/rvanlaar/sdl-memoryleak/SDL/src/stdlib/SDL_malloc.c:5404

SUMMARY: AddressSanitizer: 76 byte(s) leaked in 2 allocation(s).

The relevant output from Valgrind:

==60735== 38 bytes in 1 blocks are definitely lost in loss record 112 of 282
==60735==    at 0x484DA83: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==60735==    by 0x491D2A5: SDL_calloc_REAL (SDL_malloc.c:5311)
==60735==    by 0x4991C53: build_locales_from_csv_string (SDL_locale.c:50)
==60735==    by 0x4991C53: SDL_GetPreferredLocales_REAL (SDL_locale.c:100)
==60735==    by 0x58C530: OSystem_SDL::getSystemLanguage() const (sdl.cpp:661)
==60735==    by 0xC4246B: Common::TranslationManager::setLanguage(Common::String const&) (translation.cpp:89)
==60735==    by 0x7BFC2D: GUI::GuiManager::GuiManager() (gui-manager.cpp:82)
==60735==    by 0x79D1F5: Common::Singleton<GUI::GuiManager>::makeInstance() (singleton.h:60)
==60735==    by 0x79CC7E: Common::Singleton<GUI::GuiManager>::instance() (singleton.h:83)
==60735==    by 0x7BD44F: GUI::Dialog::Dialog(int, int, int, int, bool) (dialog.cpp:49)
==60735==    by 0x7B97F1: GUI::ConsoleDialog::ConsoleDialog(float, float) (console.cpp:57)
==60735==    by 0x7B3A31: GUI::Debugger::Debugger() (debugger.cpp:57)
==60735==    by 0x5BB60F: Director::Debugger::Debugger() (debugger.cpp:46)
==60735== 

My request if for ASAN to show more information in the case of this memory leak.

[1] scummvm/scummvm@ca23e7f
[2] https://wiki.libsdl.org/SDL2/SDL_GetPreferredLocales

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

No branches or pull requests

1 participant