[Rd] memory leak in png()

Martin Maechler m@ech|er @end|ng |rom @t@t@m@th@ethz@ch
Tue Jan 17 11:37:13 CET 2023


Note that  cairo_pdf()  also suffers from the same leak
.. as to be expected once you notice that much of the cairo
device handling uses common code.
... 
.. and then, when you are aware that on Linux, the default
interactive device is x11() and its default type is *also*
"cairo" { possibly not on the Mac, according to ?x11 }
then, when I try, I even get almost the same valgrind report for
"the standard" graphics device:

(excerpt + final summary)

=1429846== 8,943 (512 direct, 8,431 indirect) bytes in 1 blocks are definitely lost in loss record 2,316 of 3,250
==1429846==    at 0x484A6AF: realloc (vg_replace_malloc.c:1437)
==1429846==    by 0x16036BD8: FcPatternObjectInsertElt (fcpat.c:516)
==1429846==    by 0x1603AD40: FcPatternObjectAddWithBinding (fcpat.c:711)
==1429846==    by 0x16031E1F: UnknownInlinedFun (fcpat.c:738)
==1429846==    by 0x16031E1F: UnknownInlinedFun (fcpat.c:884)
==1429846==    by 0x16031E1F: FcDefaultSubstitute (fcdefault.c:302)
==1429846==    by 0x1600A49D: UnknownInlinedFun (pangofc-fontmap.c:2066)
==1429846==    by 0x1600A49D: UnknownInlinedFun (pangofc-fontmap.c:2143)
==1429846==    by 0x1600A49D: pango_fc_font_map_load_fontset (pangofc-fontmap.c:2245)
==1429846==    by 0x158E7474: UnknownInlinedFun (itemize.c:892)
==1429846==    by 0x158E7474: UnknownInlinedFun (itemize.c:952)
==1429846==    by 0x158E7474: pango_itemize_with_font (itemize.c:1564)
==1429846==    by 0x158FA89E: pango_layout_check_lines.part.0.lto_priv.0 (pango-layout.c:4894)
==1429846==    by 0x158EF4DB: UnknownInlinedFun (pango-layout.c:4786)
==1429846==    by 0x158EF4DB: pango_layout_get_line (pango-layout.c:1715)
==1429846==    by 0x15715ACF: PG_text_extents (cairoFns.c:1487)
==1429846==    by 0x15715ACF: PangoCairo_StrWidth (cairoFns.c:1565)
==1429846==    by 0x4CEBE6: GEStrWidth (engine.c:2615)
==1429846==    by 0x4CEBE6: GEStrWidth (engine.c:2578)
==1429846==    by 0x1C228D11: textRect (util.c:198)
==1429846==    by 0x1C210F19: gridText (grid.c:3740)
==1429846== 

    [....................]
    [....................]

LEAK SUMMARY:
==1429846==    definitely lost: 6,656 bytes in 10 blocks
==1429846==    indirectly lost: 43,645 bytes in 1,871 blocks
==1429846==      possibly lost: 4,676 bytes in 17 blocks
==1429846==    still reachable: 87,821,522 bytes in 31,863 blocks
==1429846==                       of which reachable via heuristic:
==1429846==                         newarray           : 4,264 bytes in 1 blocks
==1429846==         suppressed: 0 bytes in 0 blocks
==1429846== Reachable blocks (those to which a pointer was found) are not shown.
==1429846== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==1429846== 
==1429846== For lists of detected and suppressed errors, rerun with: -s
==1429846== ERROR SUMMARY: 13 errors from 13 contexts (suppressed: 0 from 0)



More information about the R-devel mailing list