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

mnd-daemon: fix memory leak #202

Merged
merged 1 commit into from
Dec 13, 2022
Merged

mnd-daemon: fix memory leak #202

merged 1 commit into from
Dec 13, 2022

Conversation

rbuj
Copy link
Contributor

@rbuj rbuj commented Oct 21, 2021

CC=gcc CFLAGS="-ggdb3 -O0 -fsanitize=address" LDFLAGS="-fsanitize=address"  ./autogen.sh --prefix=/usr --enable-debug  --enable-compile-warnings=maximum && make &> make.log && sudo make install
LeakSanitizer: detected memory leaks
Direct leak of 88 byte(s) in 1 object(s) allocated from:
    #0 0x7fd1deb6baf7 in calloc (/lib64/libasan.so.6+0xaeaf7)
    #1 0x7fd1dda92c04 in g_malloc0 ../glib/gmem.c:136
    #2 0x7fd1dda92f52 in g_malloc0_n ../glib/gmem.c:368
    #3 0x7fd1dda99c4a in g_option_context_new ../glib/goption.c:365
    #4 0x417ce2 in parse_arguments /home/robert/builddir.gcc/mate-notification-daemon/src/daemon/mnd-daemon.c:59
    #5 0x417f17 in main /home/robert/builddir.gcc/mate-notification-daemon/src/daemon/mnd-daemon.c:92
    #6 0x7fd1dd70ab74 in __libc_start_main (/lib64/libc.so.6+0x27b74)
Indirect leak of 112 byte(s) in 1 object(s) allocated from:
    #0 0x7fd1deb6baf7 in calloc (/lib64/libasan.so.6+0xaeaf7)
    #1 0x7fd1dda92c04 in g_malloc0 ../glib/gmem.c:136
    #2 0x7fd1dda92f52 in g_malloc0_n ../glib/gmem.c:368
    #3 0x7fd1dda9a7aa in g_option_group_new ../glib/goption.c:2323
    #4 0x7fd1dda9a745 in g_option_context_add_main_entries ../glib/goption.c:667
    #5 0x417cfc in parse_arguments /home/robert/builddir.gcc/mate-notification-daemon/src/daemon/mnd-daemon.c:61
    #6 0x417f17 in main /home/robert/builddir.gcc/mate-notification-daemon/src/daemon/mnd-daemon.c:92
    #7 0x7fd1dd70ab74 in __libc_start_main (/lib64/libc.so.6+0x27b74)
Indirect leak of 96 byte(s) in 1 object(s) allocated from:
    #0 0x7fd1deb6bcb8 in __interceptor_realloc (/lib64/libasan.so.6+0xaecb8)
    #1 0x7fd1dda92c97 in g_realloc ../glib/gmem.c:171
    #2 0x7fd1dda92fea in g_realloc_n ../glib/gmem.c:394
    #3 0x7fd1dda9a938 in g_option_group_add_entries ../glib/goption.c:2427
    #4 0x7fd1dda9a761 in g_option_context_add_main_entries ../glib/goption.c:669
    #5 0x417cfc in parse_arguments /home/robert/builddir.gcc/mate-notification-daemon/src/daemon/mnd-daemon.c:61
    #6 0x417f17 in main /home/robert/builddir.gcc/mate-notification-daemon/src/daemon/mnd-daemon.c:92
    #7 0x7fd1dd70ab74 in __libc_start_main (/lib64/libc.so.6+0x27b74)
SUMMARY: AddressSanitizer: 296 byte(s) leaked in 3 allocation(s).

Copy link
Member

@mbkma mbkma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@lukefromdc lukefromdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File builds clean, no warnings. Testing mate-notification-daemon from the control center or with notify-send works fine. Would expect a crash on a double-free if this did not work

@lukefromdc lukefromdc merged commit ea23cc8 into master Dec 13, 2022
@lukefromdc lukefromdc deleted the mnd-daemon-memory-leak branch December 13, 2022 02:40
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

Successfully merging this pull request may close these issues.

None yet

3 participants