Multiple memory leaks in libgdiplus

Bug #1928038 reported by Chintan Shah
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libgdiplus (Ubuntu)
New
Undecided
Unassigned

Bug Description

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.

Revision history for this message
Chintan Shah (cshah90) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.