Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002438graphvizGraph Librariespublic2014-03-30 10:582015-11-03 04:09
ReporterReimar Döffinger 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Summary0002438: gvFreeContext fails to free plugin apis[] linked lists, causing leaks
DescriptionBelow program will consume more and more memory until the system runs out.
At the very least the GVC_t::apis linked lists need to be freed.
The leak is on my system about 10 kB per iteration, but I guess that depends on the number of plugins installed.
Steps To ReproduceCompile and run this code and you should see its memory usage grow unlimited, at least if you have any plugins.

#include <graphviz/gvc.h>

int main()
{
  while (1)
    gvFreeContext(gvContext());
  return 0;
}
Additional InformationValgrind reports for a 1000 loop variant:
==3282== 9,607,848 (200,000 direct, 9,407,848 indirect) bytes in 5,000 blocks are definitely lost in loss record 294 of 294
==3282== at 0x4C28EF0: malloc (vg_replace_malloc.c:291)
==3282== by 0x4E6BB4A: gmalloc (in /usr/lib64/libgvc.so.6.0.0)
==3282== by 0x4E5990C: gvplugin_install (in /usr/lib64/libgvc.so.6.0.0)
==3282== by 0x4E5C473: gvconfig (in /usr/lib64/libgvc.so.6.0.0)
==3282== by 0x4E5DB18: gvContext (in /usr/lib64/libgvc.so.6.0.0)
==3282== by 0x400742: main (in /home/reimar/kgraphviewer/test)
TagsNo tags attached.
AUXILLARY-FILES
DATE-FIXED
FIX-COMMENT
FORMER-ID
INPUT-FILE
OUTPUT-FILE
STATUS-COMMENT
VERSION2.3.6, issue also seems to still exist in git, the gvFreeContext function seems unchanged.
Attached Files

- Relationships

-  Notes
User avatar (0000998)
Lefteris (reporter)
2015-11-03 04:09

I can also reproduce this issue. Can something be done for it? The issue seems to be open for over 1.5 years and it would be nice to get a fix for this memory leak.

The version I reproduced it with is 2.38.0-5 in ArchLinux.

- Issue History
Date Modified Username Field Change
2014-03-30 10:58 Reimar Döffinger New Issue
2015-11-03 04:09 Lefteris Note Added: 0000998


MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker