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

memory leakage #322

Closed
charlesay opened this issue Jan 5, 2016 · 3 comments
Closed

memory leakage #322

charlesay opened this issue Jan 5, 2016 · 3 comments

Comments

@charlesay
Copy link

hi,

on my system (arch linux, kernel 4.3.3-2), ricochet produces significant memory leaks every time it runs.
for illustration, just launching it and closing immediately produces this:

ricochet
qrc:/ui/MainWindow.qml:89:17: QML Loader: Binding loop detected for property "active"

==6313==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 4352 byte(s) in 7 object(s) allocated from:
> #0 0x7f1e6cd6acba in __interceptor_realloc /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_malloc_linux.cc:59
> #1 0x7f1e5ccd74aa (/usr/lib/libfontconfig.so.1+0x1d4aa)

Direct leak of 96 byte(s) in 1 object(s) allocated from:
> #0 0x7f1e6cd6b842 in operator new(unsigned long) /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_new_delete.cc:60
> #1 0x7f1e6b71b5de in QFont::detach() (/usr/lib/libQt5Gui.so.5+0x1915de)
> #2 0x7ffd0001fffe ()

Direct leak of 84 byte(s) in 2 object(s) allocated from:
> #0 0x7f1e6cd6a93a in __interceptor_malloc /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_malloc_linux.cc:38
> #1 0x7f1e6ad2d1f7 in QArrayData::allocate(unsigned long, unsigned long, unsigned long, QFlagsQArrayData::AllocationOption) (/usr/lib/libQt5Core.so.5+0xa71f7)

Direct leak of 64 byte(s) in 1 object(s) allocated from:
> #0 0x7f1e6cd6a93a in __interceptor_malloc /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_malloc_linux.cc:38
> #1 0x7f1e5ccc7506 (/usr/lib/libfontconfig.so.1+0xd506)

Direct leak of 32 byte(s) in 1 object(s) allocated from:
> #0 0x7f1e6cd6aad9 in __interceptor_calloc /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_malloc_linux.cc:54
> #1 0x7f1e5ccc7a2e (/usr/lib/libfontconfig.so.1+0xda2e)

Direct leak of 16 byte(s) in 1 object(s) allocated from:
> #0 0x7f1e6cd6a93a in __interceptor_malloc /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_malloc_linux.cc:38
> #1 0x7f1e5ccc7515 (/usr/lib/libfontconfig.so.1+0xd515)

Direct leak of 9 byte(s) in 1 object(s) allocated from:
> #0 0x7f1e6cd6a93a in __interceptor_malloc /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_malloc_linux.cc:38
> #1 0x7f1e684bb815 (/usr/lib/libX11.so.6+0x58815)
> #2 0x62a000000217 ()

Indirect leak of 8320 byte(s) in 260 object(s) allocated from:
> #0 0x7f1e6cd6a93a in __interceptor_malloc /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_malloc_linux.cc:38
> #1 0x7f1e5ccc5aff (/usr/lib/libfontconfig.so.1+0xbaff)

Indirect leak of 4154 byte(s) in 326 object(s) allocated from:
> #0 0x7f1e6cd6a93a in __interceptor_malloc /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_malloc_linux.cc:38
> #1 0x7f1e696bae09 in __GI___strdup (/usr/lib/libc.so.6+0x80e09)

Indirect leak of 3936 byte(s) in 123 object(s) allocated from:
> #0 0x7f1e6cd6aad9 in __interceptor_calloc /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_malloc_linux.cc:54
> #1 0x7f1e5ccd7c48 (/usr/lib/libfontconfig.so.1+0x1dc48)

Indirect leak of 2240 byte(s) in 70 object(s) allocated from:
> #0 0x7f1e6cd6aad9 in __interceptor_calloc /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_malloc_linux.cc:54
> #1 0x7f1e5ccd715c (/usr/lib/libfontconfig.so.1+0x1d15c)

Indirect leak of 1016 byte(s) in 1 object(s) allocated from:
> #0 0x7f1e6cd6b842 in operator new(unsigned long) /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_new_delete.cc:60
> #1 0x7f1e6b747528 in QFontDatabase::load(QFontPrivate const*, int) (/usr/lib/libQt5Gui.so.5+0x1bd528)

Indirect leak of 784 byte(s) in 7 object(s) allocated from:
> #0 0x7f1e6cd6b842 in operator new(unsigned long) /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_new_delete.cc:60
> #1 0x7f1e6af43891 in QObject::QObject(QObject*) (/usr/lib/libQt5Core.so.5+0x2bd891)

Indirect leak of 192 byte(s) in 4 object(s) allocated from:
> #0 0x7f1e6cd6a93a in __interceptor_malloc /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_malloc_linux.cc:38
> #1 0x7f1e5ccd1bed in FcLangSetCreate (/usr/lib/libfontconfig.so.1+0x17bed)

Indirect leak of 192 byte(s) in 6 object(s) allocated from:
> #0 0x7f1e6cd6aad9 in __interceptor_calloc /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_malloc_linux.cc:54
> #1 0x7f1e5ccd6fe6 (/usr/lib/libfontconfig.so.1+0x1cfe6)

Indirect leak of 160 byte(s) in 5 object(s) allocated from:
> #0 0x7f1e6cd6b842 in operator new(unsigned long) /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_new_delete.cc:60
> #1 0x7f1e6b40e1b1 (/usr/lib/libQt5Qml.so.5+0x2b31b1)

Indirect leak of 120 byte(s) in 1 object(s) allocated from:
> #0 0x7f1e6cd6b842 in operator new(unsigned long) /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_new_delete.cc:60
> #1 0x7f1e6ae90843 in QFileSelector::QFileSelector(QObject*) (/usr/lib/libQt5Core.so.5+0x20a843)

Indirect leak of 72 byte(s) in 1 object(s) allocated from:
> #0 0x7f1e6cd6b842 in operator new(unsigned long) /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_new_delete.cc:60
> #1 0x7f1e6c29f761 (/usr/lib/libQt5Quick.so.5+0x13d761)

Indirect leak of 44 byte(s) in 1 object(s) allocated from:
> #0 0x7f1e6cd6a93a in __interceptor_malloc /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_malloc_linux.cc:38
> #1 0x7f1e6ad2d1f7 in QArrayData::allocate(unsigned long, unsigned long, unsigned long, QFlagsQArrayData::AllocationOption) (/usr/lib/libQt5Core.so.5+0xa71f7)

Indirect leak of 40 byte(s) in 1 object(s) allocated from:
> #0 0x7f1e6cd6b842 in operator new(unsigned long) /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_new_delete.cc:60
> #1 0x7f1e6c29e803 in QSGAreaAllocator::allocateInNode(QSize const&, QPoint&, QRect const&, QSGAreaAllocatorNode*) (/usr/lib/libQt5Quick.so.5+0x13c803)

Indirect leak of 40 byte(s) in 1 object(s) allocated from:
> #0 0x7f1e6cd6b842 in operator new(unsigned long) /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_new_delete.cc:60
> #1 0x7f1e6c2add11 in QSGRenderContext::initialize(QOpenGLContext_) (/usr/lib/libQt5Quick.so.5+0x14bd11)
> #2 0x7f1e6b6b3819 in QOpenGLContext::makeCurrent(QSurface_) (/usr/lib/libQt5Gui.so.5+0x129819)

Indirect leak of 24 byte(s) in 1 object(s) allocated from:
> #0 0x7f1e6cd6a93a in __interceptor_malloc /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_malloc_linux.cc:38
> #1 0x7f1e5ccc790d in FcCharSetNew (/usr/lib/libfontconfig.so.1+0xd90d)

Indirect leak of 16 byte(s) in 1 object(s) allocated from:
> #0 0x7f1e6cd6b842 in operator new(unsigned long) /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_new_delete.cc:60
> #1 0x7f1e6b42ae31 in QQmlFileSelectorPrivate::QQmlFileSelectorPrivate() (/usr/lib/libQt5Qml.so.5+0x2cfe31)

Indirect leak of 15 byte(s) in 1 object(s) allocated from:
> #0 0x7f1e6cd6a93a in __interceptor_malloc /build/gcc-multilib/src/gcc-5.3.0/libsanitizer/asan/asan_malloc_linux.cc:38
> #1 0x7f1e696bae09 in __GI___strdup (/usr/lib/libc.so.6+0x80e09)
> #2 0x736e6f63695e ()

SUMMARY: AddressSanitizer: 26018 byte(s) leaked in 824 allocation(s).

@special
Copy link
Member

special commented Jan 6, 2016

These messages are shown because Ricochet builds with AddressSanitizer when available, because it has very useful hardening features. Another thing it does on x86_64 Linux is detect leaked memory and print these messages at exit. Ideally, that feature should be disabled for non-developer builds, because the leak information isn't useful most of the time.

These are probably real "leaks", but they appear to all be in other libraries, and many are probably singleton-style allocations that don't get cleaned up - so they're not leaking in any meaningful sense.

Unfortunately I can't find a way to disable the leak check automatically. The only method I've found is to have ASAN_OPTIONS=detect_leaks=0 in the environment, but setting this in main() is too late.

@stengun
Copy link

stengun commented Jan 22, 2016

I can say that there's indeed a leak, but is not related to the program closing. If I write something inside the message textbox, the memory will increase every time I write something (including "writing" backspace).
The easyest way to reproduce it is opening a chat and spamming backspace even if the textbox is empty.

@special
Copy link
Member

special commented Jan 15, 2017

We no longer have ASAN on release builds (#341), so these messages won't appear. Real leaks should get specific real bugs if they seem to exist.

@special special closed this as completed Jan 15, 2017
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

3 participants