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 789323 - memory leak, can't locate sub element
memory leak, can't locate sub element
Status: RESOLVED OBSOLETE
Product: librsvg
Classification: Core
Component: general
2.40.x
Other Windows
: Normal normal
: ---
Assigned To: librsvg maintainers
librsvg maintainers
Depends on:
Blocks:
 
 
Reported: 2017-10-22 16:54 UTC by Oren Ben-Kiki
Modified: 2017-12-13 18:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sample program (2.72 KB, application/x-zip-compressed)
2017-10-22 16:54 UTC, Oren Ben-Kiki
Details

Description Oren Ben-Kiki 2017-10-22 16:54:01 UTC
Created attachment 362058 [details]
Sample program

My main issue is that librsvg seems to not find sub elements by id. Specifically, rsvg_handle_has_sub returns false, and therefore querying for the element's size and position fails. I'm probably doing something wrong here... or is this a bug? I really want the ability to access sub-elements size and position (by id or name or something along these lines), so any advice/workaround to make this work would be appreciated.

The secondary issue is that librsvg causes memory leaks, or at least causes valgrind to think there are leaks, even for a minimal program (creating, writing into, closing, and destroying an RSVG handle). I can easily work around this with a suppression file, but... Is there some additional cleanup function I should call to release all allocated memory?

I am using version 2.40.13 on the Windows Linux subsystem, if that matters.

The attached cheese.zip file contains the C++ file demonstrating both issues, a shell script that compiles and runs it, and the output I got.
Comment 1 Christian Persch 2017-10-22 18:59:21 UTC
You need to use "#" in front of the sub element name, i.e. "#cheese".
Comment 2 Oren Ben-Kiki 2017-10-22 19:18:54 UTC
Ah!

It would be nice if this was mentioned in the documentation.

Looking around it seems as though valgrind gets some things wrong - what's the recommended way to run valgrind on an application using librsvg?

Thanks,

Oren.
Comment 3 GNOME Infrastructure Team 2017-12-13 18:30:02 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/librsvg/issues/175.