Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001874graphvizDotpublic2010-05-06 16:242011-04-28 04:03
ReporterMathias Spoerr 
Assigned ToArif Bilgin 
PrioritynormalSeverityminorReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSx86-Windows-OS Version
Summary0001874: Run-time errors using graphviz library
Description



When compiling and running the code



<CD>
#include <graphviz/gvc.h>



int main(int argc, char **argv)
{
     Agraph_t *g;
     Agnode_t *n, *m;
     Agedge_t *e;
     Agsym_t *a;
     GVC_t *gvc;



     /* set up a graphviz context */
     gvc = gvContext();
     char* args[] = {
        "dot",
        "-Tgif", /* gif output */
        "-oabc.gif" /* output to file abc.gif */
    };



     gvParseArgs (gvc, sizeof (args)/sizeof (char*), args);



     /* Create a simple digraph */
     g = agopen("g", AGDIGRAPH);
     n = agnode(g, "n");
     m = agnode(g, "m");
     e = agedge(g, n, m);



     /* Set an attribute - in this case one that affects the visible rendering */
     agsafeset(n, "color", "red", "");



     /* Compute a layout using layout engine from command line args */
     gvLayoutJobs(gvc, g);



     /* Write the graph according to -T and -o options */
     gvRenderJobs(gvc, g);



     /* Free layout data */
     gvFreeLayout(gvc, g);



     /* Free graph structures */
          agclose(g);



     /* close output file, free context, and return number of errors */
     return (gvFreeContext(gvc));
}
</CD>



I get a seg fault.



When the lines defining args[] are changes to
<CD>
    char* args[3];
    args[0] = strdup ("dot" );
    args[1] = strdup ("-Tgif" );
    args[2] = strdup ("-oabc.gif" );
</CD>



the code finishes okay, but then reports a Runtime Check Failure.
(See output file).
TagsNo tags attached.
AUXILLARY-FILES
DATE-FIXED
FIX-COMMENT
FORMER-ID1944
INPUT-FILE
OUTPUT-FILEhttp://www.graphviz.org/bugs/b1944.jpg [^]
STATUS-COMMENT*
VERSION     2.27
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2011-04-28 04:03 user1 New Issue
2011-04-28 04:03 user1 Assigned To => Arif Bilgin


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