Public bug reported: Multiple memory leaks have been identified in libgdiplus library when the test code provided ibgdiplus/tests/testgdi.c is compiled with ASAN enabled. Memory leaks have been found in multiple components of the library as below :
0x7fce7e31a3d0 in GdipCreatePen1 /home/targets/libgdiplus/src/pen.c:258 0x7fce7e36d4da in GdipCreateSolidFill /home/targets/libgdiplus/src/solidbrush.c:138 Following is the output of the testgdi.c when it is compiled with ASAN. jpg drawn tif drawn gif drawn png drawn bmp drawn XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0" after 127 requests (127 known processed) with 0 events remaining. ================================================================= ==61628==ERROR: LeakSanitizer: detected memory leaks Direct leak of 504 byte(s) in 3 object(s) allocated from: #0 0x7fce7e6a2602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) #1 0x7fce7e31a3d0 in gdip_pen_new /home/targets/libgdiplus/src/pen.c:66 #2 0x7fce7e31a3d0 in GdipCreatePen1 /home/targets/libgdiplus/src/pen.c:258 Direct leak of 256 byte(s) in 1 object(s) allocated from: #0 0x7fce7e6a2602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) #1 0x7fce7bb720b9 (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d0b9) Direct leak of 168 byte(s) in 3 object(s) allocated from: #0 0x7fce7e6a2602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) #1 0x7fce7e36d4da in gdip_solidfill_new /home/targets/libgdiplus/src/solidbrush.c:55 #2 0x7fce7e36d4da in GdipCreateSolidFill /home/targets/libgdiplus/src/solidbrush.c:138 Direct leak of 16 byte(s) in 1 object(s) allocated from: #0 0x7fce7e6a2961 in realloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98961) #1 0x7fce7dbf325c (/usr/lib/x86_64-linux-gnu/libX11.so.6+0x5025c) Indirect leak of 168 byte(s) in 3 object(s) allocated from: #0 0x7fce7e6a2602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) #1 0x7fce7e36d4da in gdip_solidfill_new /home/targets/libgdiplus/src/solidbrush.c:55 #2 0x7fce7e36d4da in GdipCreateSolidFill /home/targets/libgdiplus/src/solidbrush.c:138 Indirect leak of 160 byte(s) in 2 object(s) allocated from: #0 0x7fce7e6a279a in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9879a) #1 0x7fce7dbf322e (/usr/lib/x86_64-linux-gnu/libX11.so.6+0x5022e) Indirect leak of 32 byte(s) in 1 object(s) allocated from: #0 0x7fce7e6a279a in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9879a) #1 0x7fce7bb727c8 (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d7c8) Indirect leak of 16 byte(s) in 2 object(s) allocated from: #0 0x7fce7e6a2602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) #1 0x7fce7dbf3cb5 (/usr/lib/x86_64-linux-gnu/libX11.so.6+0x50cb5) SUMMARY: AddressSanitizer: 1320 byte(s) leaked in 16 allocation(s) Information requested: # lsb_release -rd Description: Ubuntu 16.04.6 LTS Release: 16.04 #apt-cache policy libgdiplus libgdiplus: Installed: 4.2-1ubuntu1 Candidate: 4.2-1ubuntu1 Version table: *** 4.2-1ubuntu1 500 500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages 100 /var/lib/dpkg/status Expected : No memory leaks while running the test code What happened : Couple of memory leaks in libgdiplus component as indicated in the output. ** Affects: libgdiplus (Ubuntu) Importance: Undecided Status: New ** Attachment added: "This is the ASAN compiled version of testgdi.c" https://bugs.launchpad.net/bugs/1928038/+attachment/5496252/+files/compiled_testgdi -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1928038 Title: Multiple memory leaks in libgdiplus To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/libgdiplus/+bug/1928038/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs