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 615767 - Memory leak with empty in interleave
Memory leak with empty in interleave
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: general
2.7.6
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2010-04-14 17:13 UTC by Philip Taylor
Modified: 2021-07-05 13:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Philip Taylor 2010-04-14 17:13:25 UTC
Parsing and then freeing the following grammar:

  <element xmlns='http://relaxng.org/ns/structure/1.0' name='test'><interleave><empty/></interleave></element>

with libxml2-2.7.7 results in a Valgrind leak report of:

  12,344 (32 direct, 12,312 indirect) bytes in 1 blocks are definitely lost in loss record 4 of 4
     at 0x4C2404C: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
     by 0x4F64F8E: xmlRelaxNGComputeInterleaves (relaxng.c:4369)
     by 0x4E9D33A: stubHashScannerFull (hash.c:801)
     by 0x4E9D469: xmlHashScanFull (hash.c:848)
     by 0x4E9D374: xmlHashScan (hash.c:817)
     by 0x4F6C36B: xmlRelaxNGParse (relaxng.c:7543)

This is the line "partitions = (xmlRelaxNGPartitionPtr) xmlMalloc(sizeof(xmlRelaxNGPartition));". It looks like xmlRelaxNGFreePartition never gets called.

No leak is reported if the <empty/> is replaced with e.g. <text/>.
Comment 1 GNOME Infrastructure Team 2021-07-05 13:24:16 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/libxml2/-/issues/

Thank you for your understanding and your help.