GithubHelp home page GithubHelp logo

Memory Leak about i3lock-color HOT 7 CLOSED

raymo111 avatar raymo111 commented on June 11, 2024
Memory Leak

from i3lock-color.

Comments (7)

PandorasFox avatar PandorasFox commented on June 11, 2024 2

Thanks, and likewise!

I'm waiting to see if upstream will merge my fix in (or if I need to make style changes or something first), and then I'll merge my fix back into my fork (and update the font customization stuff to make better use of this stuff).

from i3lock-color.

PandorasFox avatar PandorasFox commented on June 11, 2024

Most of this has been fixed in the dev branch (I actually just fixed the last few myself and was about to push that back to master, once I update some docs). The libfontconfig.so memory leaks are actually just memory leaks in libfontconfig - not sure if there's much I can do about them.

They're actually present in upstream i3lock's stuff:

[arcana@deskfox x86_64-pc-linux-gnu]$ ./i3lock --version
i3lock: version 2.10-1-gef4f9e4 (2017-12-02, branch "remotes/upstream/master") © 2010 Michael Stapelberg
[arcana@deskfox x86_64-pc-linux-gnu]$ ./i3lock 
[arcana@deskfox x86_64-pc-linux-gnu]$ 
=================================================================
==22909==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 256 byte(s) in 1 object(s) allocated from:
    #0 0x7f74effe9ae9 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:62
    #1 0x7f74ec9787ee  (/usr/lib/libfontconfig.so.1+0x1d7ee)

Indirect leak of 96 byte(s) in 3 object(s) allocated from:
    #0 0x7f74effe9ce1 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:70
    #1 0x7f74ec978ed9  (/usr/lib/libfontconfig.so.1+0x1ded9)

Indirect leak of 11 byte(s) in 1 object(s) allocated from:
    #0 0x7f74eff803b1 in __interceptor_strdup /build/gcc/src/gcc/libsanitizer/asan/asan_interceptors.cc:560
    #1 0x7f74ec9781f5 in FcValueSave (/usr/lib/libfontconfig.so.1+0x1d1f5)

SUMMARY: AddressSanitizer: 363 byte(s) leaked in 5 allocation(s).

Here's what my dev branch currently outputs when run through ASAN:

[arcana@deskfox x86_64-pc-linux-gnu]$ ./i3lock --version
i3lock: version 2.10.1c-16-gdbea946 (2017-12-08, branch "dev") © 2010 Michael Stapelberg
[arcana@deskfox x86_64-pc-linux-gnu]$ ./i3lock
[arcana@deskfox x86_64-pc-linux-gnu]$
=================================================================
==26509==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 256 byte(s) in 1 object(s) allocated from:
    #0 0x7f532146eae9 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:62
    #1 0x7f531d9927ee  (/usr/lib/libfontconfig.so.1+0x1d7ee)

Indirect leak of 96 byte(s) in 3 object(s) allocated from:
    #0 0x7f532146ece1 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:70
    #1 0x7f531d992ed9  (/usr/lib/libfontconfig.so.1+0x1ded9)

Indirect leak of 11 byte(s) in 1 object(s) allocated from:
    #0 0x7f53214053b1 in __interceptor_strdup /build/gcc/src/gcc/libsanitizer/asan/asan_interceptors.cc:560
    #1 0x7f531d9921f5 in FcValueSave (/usr/lib/libfontconfig.so.1+0x1d1f5)

SUMMARY: AddressSanitizer: 363 byte(s) leaked in 5 allocation(s).

[arcana@deskfox x86_64-pc-linux-gnu]$ ./i3lock --bar-indicator -B 5 --keylayout 2

=================================================================
==26524==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 256 byte(s) in 1 object(s) allocated from:
    #0 0x7f2ce0026ae9 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:62
    #1 0x7f2cdc54a7ee  (/usr/lib/libfontconfig.so.1+0x1d7ee)

Indirect leak of 96 byte(s) in 3 object(s) allocated from:
    #0 0x7f2ce0026ce1 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:70
    #1 0x7f2cdc54aed9  (/usr/lib/libfontconfig.so.1+0x1ded9)

Indirect leak of 11 byte(s) in 1 object(s) allocated from:
    #0 0x7f2cdffbd3b1 in __interceptor_strdup /build/gcc/src/gcc/libsanitizer/asan/asan_interceptors.cc:560
    #1 0x7f2cdc54a1f5 in FcValueSave (/usr/lib/libfontconfig.so.1+0x1d1f5)

SUMMARY: AddressSanitizer: 363 byte(s) leaked in 5 allocation(s).
[arcana@deskfox x86_64-pc-linux-gnu]$
=================================================================
==26526==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 256 byte(s) in 1 object(s) allocated from:
    #0 0x7f2ce0026ae9 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:62
    #1 0x7f2cdc54a7ee  (/usr/lib/libfontconfig.so.1+0x1d7ee)

Indirect leak of 96 byte(s) in 3 object(s) allocated from:
    #0 0x7f2ce0026ce1 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:70
    #1 0x7f2cdc54aed9  (/usr/lib/libfontconfig.so.1+0x1ded9)

Indirect leak of 11 byte(s) in 1 object(s) allocated from:
    #0 0x7f2cdffbd3b1 in __interceptor_strdup /build/gcc/src/gcc/libsanitizer/asan/asan_interceptors.cc:560
    #1 0x7f2cdc54a1f5 in FcValueSave (/usr/lib/libfontconfig.so.1+0x1d1f5)

SUMMARY: AddressSanitizer: 363 byte(s) leaked in 5 allocation(s).

=================================================================
==26525==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 256 byte(s) in 1 object(s) allocated from:
    #0 0x7f2ce0026ae9 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:62
    #1 0x7f2cdc54a7ee  (/usr/lib/libfontconfig.so.1+0x1d7ee)

Indirect leak of 96 byte(s) in 3 object(s) allocated from:
    #0 0x7f2ce0026ce1 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:70
    #1 0x7f2cdc54aed9  (/usr/lib/libfontconfig.so.1+0x1ded9)

Indirect leak of 11 byte(s) in 1 object(s) allocated from:
    #0 0x7f2cdffbd3b1 in __interceptor_strdup /build/gcc/src/gcc/libsanitizer/asan/asan_interceptors.cc:560
    #1 0x7f2cdc54a1f5 in FcValueSave (/usr/lib/libfontconfig.so.1+0x1d1f5)

SUMMARY: AddressSanitizer: 363 byte(s) leaked in 5 allocation(s).

It's not appreciably different now (those memory leaks are just the same in each of the various fork()s that call redraw_screen and stuff, as well. I'm looking into fixing this up a lot, though, and should have this all merged back in by the end of the day, hopefully.

I might end up building some debug cairo/libfontconfig versions so that I can get them to be a bit more verbose in ASAN.

from i3lock-color.

gautamr95 avatar gautamr95 commented on June 11, 2024

Makes sense. Thanks for the response!

from i3lock-color.

PandorasFox avatar PandorasFox commented on June 11, 2024

No prob. The fix for the fontconfig stuff might get a bit delayed due to cairo glyphs being a bit weird, but I should be able to get it sorted out in the next week or so.

from i3lock-color.

PandorasFox avatar PandorasFox commented on June 11, 2024

man

I compiled a debug version of fontconfig to try and narrow this down

image

this will be interesting

from i3lock-color.

PandorasFox avatar PandorasFox commented on June 11, 2024

Alright, cool, I already fixed all the memory leaks in my small test program, so I should be able to throw this into dev and eliminate all the memleaks

from i3lock-color.

gautamr95 avatar gautamr95 commented on June 11, 2024

Thanks man! Also good luck with finals lol

from i3lock-color.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.