Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001985graphvizDotpublic2010-11-04 22:002011-05-26 12:33
Reporterstefan Kost2 
Assigned Togviz 
PrioritynormalSeverityminorReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOS*-*-OS Version
Summary0001985: memory leaks in dot
Description



The attached C program has a memory leak.



<CD>
==23010== Invalid read of size 1
==23010== at 0x4140D43: strcasecmp (strcasecmp.c:65)
==23010== by 0x406A6CF: textsize (fontmetrics.c:182)
==23010== by 0x407BA5B: storeline (labels.c:33)
==23010== by 0x407BB27: make_simple_label (labels.c:101)
==23010== by 0x407BCE2: make_label (labels.c:182)
==23010== by 0x4071891: do_graph_label (input.c:901)
==23010== by 0x40723AC: graph_init (input.c:772)
==23010== by 0x405B40B: gvLayoutJobs (gvlayout.c:88)
==23010== by 0x4061E59: gvLayout (gvc.c:94)
==23010== by 0x8049079: main (in
/home/ensonic/projects/tests/graphviz/gvc)
==23010== Address 0x42b504c is 12 bytes inside a block of size 20 free'd
==23010== at 0x4024B3A: free (vg_replace_malloc.c:366)
==23010== by 0x40C154B: agstrfree (refstr.c:136)
==23010== by 0x40BABBF: agFREEdict (attribs.c:234)
==23010== by 0x40BCDFE: agclose (graph.c:159)
==23010== by 0x804913E: main (in
/home/ensonic/projects/tests/graphviz/gvc)
==23010==
==23010== Invalid read of size 1
==23010== at 0x402663B: strcmp (mc_replace_strmem.c:426)
==23010== by 0x402CC88: pango_textlayout (gvtextlayout_pango.c:99)
==23010== by 0x40609D7: gvtextlayout (gvtextlayout.c:49)
==23010== by 0x406A742: textsize (fontmetrics.c:206)
==23010== by 0x407BA5B: storeline (labels.c:33)
==23010== by 0x407BB27: make_simple_label (labels.c:101)
==23010== by 0x407BCE2: make_label (labels.c:182)
==23010== by 0x4071891: do_graph_label (input.c:901)
==23010== by 0x40723AC: graph_init (input.c:772)
==23010== by 0x405B40B: gvLayoutJobs (gvlayout.c:88)
==23010== by 0x4061E59: gvLayout (gvc.c:94)
==23010== by 0x8049079: main (in
/home/ensonic/projects/tests/graphviz/gvc)
==23010== Address 0x42b504c is 12 bytes inside a block of size 20 free'd
==23010== at 0x4024B3A: free (vg_replace_malloc.c:366)
==23010== by 0x40C154B: agstrfree (refstr.c:136)
==23010== by 0x40BABBF: agFREEdict (attribs.c:234)
==23010== by 0x40BCDFE: agclose (graph.c:159)
==23010== by 0x804913E: main (in
/home/ensonic/projects/tests/graphviz/gvc)
==23010==
==23010== Invalid read of size 1
==23010== at 0x4026657: strcmp (mc_replace_strmem.c:426)
==23010== by 0x402CC88: pango_textlayout (gvtextlayout_pango.c:99)
==23010== by 0x40609D7: gvtextlayout (gvtextlayout.c:49)
==23010== by 0x406A742: textsize (fontmetrics.c:206)
==23010== by 0x407BA5B: storeline (labels.c:33)
==23010== by 0x407BB27: make_simple_label (labels.c:101)
==23010== by 0x407BCE2: make_label (labels.c:182)
==23010== by 0x4071891: do_graph_label (input.c:901)
==23010== by 0x40723AC: graph_init (input.c:772)
==23010== by 0x405B40B: gvLayoutJobs (gvlayout.c:88)
==23010== by 0x4061E59: gvLayout (gvc.c:94)
==23010== by 0x8049079: main (in
/home/ensonic/projects/tests/graphviz/gvc)
==23010== Address 0x42b504d is 13 bytes inside a block of size 20 free'd
==23010== at 0x4024B3A: free (vg_replace_malloc.c:366)
==23010== by 0x40C154B: agstrfree (refstr.c:136)
==23010== by 0x40BABBF: agFREEdict (attribs.c:234)
==23010== by 0x40BCDFE: agclose (graph.c:159)
==23010== by 0x804913E: main (in
/home/ensonic/projects/tests/graphviz/gvc)
</CD>
Additional Information

[erg]
Related to bug 2048. As with that bug, it is only necessary to
run dot on the generated \<A HREF="b2069.gv"\>graph\</A\>.

Also note that creating a subgraph in the root graph and then
inserting it into another subgraph causes the output graph to
contain two copies of a subgraph. I'm not sure this is a good idea.
The parser actually warns about this, because it can cause strange
behavior, especially if the subgraphs are clusters.
TagsNo tags attached.
AUXILLARY-FILEShttp://www.graphviz.org/bugs/b2069.gv [^]
DATE-FIXED
FIX-COMMENT
FORMER-ID2069
INPUT-FILEhttp://www.graphviz.org/bugs/b2069.c [^]
OUTPUT-FILE
STATUS-COMMENT*
VERSION     2.27
Attached Filestxt file icon graphviz-patch.txt [^] (1,036 bytes) 2011-05-26 12:32 [Show Content]

- Relationships

-  Notes
User avatar (0000010)
gson (reporter)
2011-05-26 12:33

This is not a memory leak but a pair of accesses to freed memory. The patch I just uploaded will fix them.

- Issue History
Date Modified Username Field Change
2011-04-28 04:03 user1 New Issue
2011-04-28 04:03 user1 Assigned To => user1
2011-05-26 12:32 gson File Added: graphviz-patch.txt
2011-05-26 12:33 gson Note Added: 0000010


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