Memory Leak in Cairo?! #16

Open
opened 2019-05-30 03:44:21 +02:00 by mhu · 2 comments
Owner

Rendering multiple times using the cairo output renderer results in a limitless increasing memory consumption.

The leak seems to be burried inside Cairo's cairo_paint_with_alpha() function. Example Valgrind output:

==5437== 92,738,440 (3,456 direct, 92,734,984 indirect) bytes in 9 blocks are definitely lost in loss record 6,396 of 6,399 ==5437== at 0x483877F: malloc (vg_replace_malloc.c:299) ==5437== by 0x52E5AAA: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x52C16EB: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x52D19FE: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x52EA576: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x52EA576: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x529EFFB: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x529938F: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x52F7204: cairo_paint_with_alpha (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x116EA2: cairo_render_cell_to_vector_file (cairo-output.c:281) ==5437== by 0x110280: command_line_convert_gds (command-line.c:170) ==5437== by 0x10FCF7: main (main.c:314)

...

LEAK SUMMARY: ==5437== definitely lost: 108,553 bytes in 29 blocks ==5437== indirectly lost: 253,092,816 bytes in 255,198 blocks ==5437== possibly lost: 48,792 bytes in 52 blocks ==5437== still reachable: 65,695 bytes in 105 blocks ==5437== of which reachable via heuristic: ==5437== length64 : 4,832 bytes in 80 blocks ==5437== newarray : 2,080 bytes in 50 blocks ==5437== suppressed: 1,357,951 bytes in 15,968 blocks

Rendering multiple times using the cairo output renderer results in a limitless increasing memory consumption. The leak seems to be burried inside Cairo's cairo_paint_with_alpha() function. Example Valgrind output: `==5437== 92,738,440 (3,456 direct, 92,734,984 indirect) bytes in 9 blocks are definitely lost in loss record 6,396 of 6,399 ==5437== at 0x483877F: malloc (vg_replace_malloc.c:299) ==5437== by 0x52E5AAA: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x52C16EB: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x52D19FE: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x52EA576: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x52EA576: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x529EFFB: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x529938F: ??? (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x52F7204: cairo_paint_with_alpha (in /usr/lib/libcairo.so.2.11600.0) ==5437== by 0x116EA2: cairo_render_cell_to_vector_file (cairo-output.c:281) ==5437== by 0x110280: command_line_convert_gds (command-line.c:170) ==5437== by 0x10FCF7: main (main.c:314)` ... `LEAK SUMMARY: ==5437== definitely lost: 108,553 bytes in 29 blocks ==5437== indirectly lost: 253,092,816 bytes in 255,198 blocks ==5437== possibly lost: 48,792 bytes in 52 blocks ==5437== still reachable: 65,695 bytes in 105 blocks ==5437== of which reachable via heuristic: ==5437== length64 : 4,832 bytes in 80 blocks ==5437== newarray : 2,080 bytes in 50 blocks ==5437== suppressed: 1,357,951 bytes in 15,968 blocks`
Author
Owner

Rerun valgrind's memchecker with debug build of cairo:

Rerun valgrind's memchecker with debug build of cairo:
Author
Owner

Remove wontfix tag. But still no real solution is in sight. However, a workaround has been implemented.

Remove wontfix tag. But still no real solution is in sight. However, a workaround has been implemented.
mhu added the
wontfix
label 2021-12-25 22:57:35 +01:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mhu/gds-render#16
No description provided.