After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 344235 - SVG including text causes memory leaks
SVG including text causes memory leaks
Status: RESOLVED FIXED
Product: librsvg
Classification: Core
Component: general
2.15.x
Other All
: Normal critical
: ---
Assigned To: librsvg maintainers
librsvg maintainers
Depends on:
Blocks:
 
 
Reported: 2006-06-08 03:19 UTC by Kouhei Sutou
Modified: 2006-08-21 05:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sample SVG including text. (190 bytes, text/plain)
2006-06-08 03:20 UTC, Kouhei Sutou
  Details
workaround (941 bytes, patch)
2006-06-08 03:23 UTC, Kouhei Sutou
none Details | Review

Description Kouhei Sutou 2006-06-08 03:19:44 UTC
Please describe the problem:
The following program causes memory leaks when input.svg has text:
#include <librsvg/rsvg.h>

int
main(int argc, char **argv)
{
    int i;

    if (argc < 2) {
        printf("usage: %s input.svg\n", argv[0]);
        return 1;
    }

    rsvg_init();

    for (i = 0; i < 100; i++) {
        GdkPixbuf *pixbuf;
        pixbuf = rsvg_pixbuf_from_file(argv[1], NULL);
        if (pixbuf)
            g_object_unref (pixbuf);
        else
            printf("%d: NULL\n", i);
        g_usleep(100000);
    }

    rsvg_term();

    return 0;
}


Steps to reproduce:
1. cc `pkg-config librsvg-2.0 --cflags --libs` -o memory-leak memory-leak.c
2. ./memory-leak SVG_including_text.svg



Actual results:
I can find the program causes memory leaks by viewing top result in another
terminal.

Expected results:
No memory leaks.

Does this happen every time?
Yes if input.svg has text.

Other information:
Comment 1 Kouhei Sutou 2006-06-08 03:20:34 UTC
Created attachment 66953 [details]
sample SVG including text.
Comment 2 Kouhei Sutou 2006-06-08 03:23:25 UTC
Created attachment 66955 [details] [review]
workaround

This is caused by a Pango bug.
See http://bugzilla.gnome.org/show_bug.cgi?id=143542 for more details.
Comment 3 Dominic Lachowicz 2006-06-21 14:18:10 UTC
This just substitutes many leaks with 1 leak. While it's an improvement, I'd rather see no leaks. To that end, I'd rather see a solution along the lines of:

http://bugzilla.gnome.org/attachment.cgi?id=31799&action=view

or

http://bugzilla.gnome.org/attachment.cgi?id=30154&action=view
Comment 4 Dominic Lachowicz 2006-07-22 18:47:03 UTC
Similar approach taken to how http://bugzilla.gnome.org/attachment.cgi?id=31799&action=view did it.

Thanks.
Comment 5 Behdad Esfahbod 2006-08-21 05:19:27 UTC
*** Bug 351763 has been marked as a duplicate of this bug. ***