Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

memory leak in kitty graphics blitter #2012

Closed
dankamongmen opened this issue Aug 2, 2021 · 4 comments
Closed

memory leak in kitty graphics blitter #2012

dankamongmen opened this issue Aug 2, 2021 · 4 comments
Assignees
Labels
bitmaps bitmapped graphics (sixel, kitty, mmap) bug Something isn't working
Milestone

Comments

@dankamongmen
Copy link
Owner

Running valgrind --leak-check=full on notcurses-demo within Kitty on tip of master shows the following output:

==215636== 19,040 bytes in 4,760 blocks are definitely lost in loss record 283 of 285
==215636==    at 0x483877F: malloc (vg_replace_malloc.c:307)
==215636==    by 0x4A014AE: write_kitty_data (kitty.c:742)
==215636==    by 0x4A014AE: kitty_blit_core (kitty.c:945)
==215636==    by 0x4A0383A: kitty_blit_selfref (kitty.c:987)
==215636==    by 0x4849656: rgba_blit_dispatch (internal.h:1630)
==215636==    by 0x4849656: ffmpeg_blit (ffmpeg.c:629)
==215636==    by 0x4A2679B: ncvisual_blit (visual.c:82)
==215636==    by 0x4A289E4: ncvisual_render_pixels (visual.c:1028)
==215636==    by 0x4A290B4: ncvisual_render (visual.c:1096)
==215636==    by 0x1244E8: yield_demo (yield.c:42)
==215636==    by 0x110483: ext_demos (demo.c:225)
==215636==    by 0x110483: main (demo.c:575)
==215636== 
==215636== 647,128 bytes in 161,782 blocks are definitely lost in loss record 284 of 285
==215636==    at 0x483877F: malloc (vg_replace_malloc.c:307)
==215636==    by 0x4A014AE: write_kitty_data (kitty.c:742)
==215636==    by 0x4A014AE: kitty_blit_core (kitty.c:945)
==215636==    by 0x4A0383A: kitty_blit_selfref (kitty.c:987)
==215636==    by 0x4849656: rgba_blit_dispatch (internal.h:1630)
==215636==    by 0x4849656: ffmpeg_blit (ffmpeg.c:629)
==215636==    by 0x4A2679B: ncvisual_blit (visual.c:82)
==215636==    by 0x4A289E4: ncvisual_render_pixels (visual.c:1028)
==215636==    by 0x4A290B4: ncvisual_render (visual.c:1096)
==215636==    by 0x122318: streamer (view.c:29)
==215636==    by 0x484A177: ffmpeg_stream (ffmpeg.c:509)
==215636==    by 0x122834: view_video_demo (view.c:56)
==215636==    by 0x122834: view_demo (view.c:187)
==215636==    by 0x110483: ext_demos (demo.c:225)
==215636==    by 0x110483: main (demo.c:575)
==215636== 
==215636== 1,675,520 bytes in 418,880 blocks are definitely lost in loss record 285 of 285
==215636==    at 0x483877F: malloc (vg_replace_malloc.c:307)
==215636==    by 0x4A014AE: write_kitty_data (kitty.c:742)
==215636==    by 0x4A014AE: kitty_blit_core (kitty.c:945)
==215636==    by 0x4A0383A: kitty_blit_selfref (kitty.c:987)
==215636==    by 0x4849656: rgba_blit_dispatch (internal.h:1630)
==215636==    by 0x4849656: ffmpeg_blit (ffmpeg.c:629)
==215636==    by 0x4A2679B: ncvisual_blit (visual.c:82)
==215636==    by 0x4A289E4: ncvisual_render_pixels (visual.c:1028)
==215636==    by 0x4A290B4: ncvisual_render (visual.c:1096)
==215636==    by 0x1247BA: yield_demo (yield.c:114)
==215636==    by 0x110483: ext_demos (demo.c:225)
==215636==    by 0x110483: main (demo.c:575)

i'm unsure as of yet whether this is present in the 2.3.12 release.

@dankamongmen dankamongmen added bug Something isn't working bitmaps bitmapped graphics (sixel, kitty, mmap) labels Aug 2, 2021
@dankamongmen dankamongmen added this to the 3.0.0 milestone Aug 2, 2021
@dankamongmen dankamongmen self-assigned this Aug 2, 2021
@dankamongmen
Copy link
Owner Author

so it looks like these are all coming from auxvector allocations?

@dankamongmen
Copy link
Owner Author

it looks like this is restricted to the selfref animator code, so it's not going to hit 2.3.12.

@dankamongmen
Copy link
Owner Author

resolved. checking non-self-referential code now to make sure there's no issue there.

@dankamongmen
Copy link
Owner Author

confirmed no such leak in pre-selfref kitty blitter.

@dankamongmen dankamongmen modified the milestones: 3.0.0, 2.4.0 Aug 24, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bitmaps bitmapped graphics (sixel, kitty, mmap) bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant