ellson / MOTHBALLED-graphviz

Moved to https://gitlab.com/graphviz/graphviz
Eclipse Public License 1.0
1.29k stars 253 forks source link

[Dot] Crash ONLY under windows 8.1 64 bit #161

Open GadgetSteve opened 8 years ago

GadgetSteve commented 8 years ago

Ported Issue from Mantis Original ID: 2549 Reported By: scottaronbloom

SEVERITY: CRASH Submitted: 2015-06-02 19:45:16

OS: WIN 8.1

OS BUILD: 64BIT

PLATFORM: WINDOWS

DESCRIPTION

I use the cgraphlib system to build graphviz using cmake.

I have no issues for 64 bit linux, or 64 bit windows when running under Windows 7. However when running a 64 bit build under win 8.1 (and 8.0) it crashes 100% of the time.

Doesnt matter if the dot file was loaded or created via C calls tot he system

STEPS TO REPRODUCE

64 bit windows 8.1, building graphviz under Visual Studio 2013

    GVC_t * gvc = gvContextPlugins( lt_preloaded_symbols, 0 );
    Agdesc_t graphDesc = Agdirected;
    graphDesc.directed = 1;
    graphDesc.strict = 0;
    graphDesc.no_loop = 0;
    graphDesc.maingraph = 1;
    graphDesc.flatlock = 0;
    graphDesc.no_write = 1;
    graphDesc.has_attrs = 1;
    graphDesc.has_cmpnd = 1;
    Agraph_t * graph = agopen( "test", graphDesc, 0 );
    agattr( graph, AGNODE, "shape", "ellipse" );
    agattr( graph, AGNODE, "fillcolor", "#ffffff" );
    agattr( graph, AGRAPH, "compound", "true" );
    agattr( graph, AGRAPH, "bgcolor", "#ffffff" );
    agsubg( graph, "cluster_clk1_group", 1 );
    agsafeset( graph, "label", "clk1_group", "" );
    Agnode_t * node1 = agnode( graph, "clk1", 1 );
    agsubnode( graph, node1, 1 );
    agsubg( graph, "cluster_clk2_group", 1 );
    agsafeset( graph, "label", "clk2_group", "" );
    Agnode_t * node2 = agnode( graph, "clk2",1 );
    agsubnode( graph, node2, 1 );
    Agedge_t * edge = agedge( graph, node1, node2, "clk1_group.clk1;clk2_group.clk2",1 );
    agsafeset( edge, "label", "2S,0U", "" );
    agsafeset( edge, "edgetooltip", "2 Synchronized\nUnsynchronized\n", "" );
    agsafeset( edge, "color", "#20b2aa", "" );
    agsafeset( edge, "ltail", "cluster_clk1_group", "" );
    agsafeset( edge, "lhead", "cluster_clk2_group", "" );
    agattr( graph, AGRAPH, "newrank", "true" );
    gvLayout( gvc, graph, "dot" );

Will crash 100% of the time in gvLayout.

atif1996 commented 7 years ago

Got the same issue myself.

If you were to look at this: https://software.intel.com/en-us/articles/size-of-long-integer-type-on-different-architecture-and-os

It becomes clear why this fails on 64 bit windows, but works on 64 bit linux and MacOSX. Basically it comes down to the use of long int. The sizeof(long int) on 64bit windows is 4, where its 8 on 64bit linux/mac. Workaround that worked for us here is to find and replace the following:

unsigned long int -> unsigned long long int unsigned long -> unsigned long long

The result is that these types now have the same size on Windows as they do on Linux/MacOSX. Possibly a better alternative would be to use the uint64_t. Its more explicit about what is going on.

Give it a try and see if it works for you.

emden commented 7 years ago

Is there any way to get a traceback as to where the actual problem occurs in the code?

ellson commented 7 years ago

not from me - I wasn't the original reporter and I don't build on windows ...

.. hopefully it doesn't crash now, but it does need testing on windows

----- Original Message -----

From: "emden" notifications@github.com To: "ellson/graphviz" graphviz@noreply.github.com Sent: Tuesday, August 23, 2016 9:07:18 AM Subject: Re: [ellson/graphviz] [Dot] Crash ONLY under windows 8.1 64 bit (#161)

Is there any way to get a traceback as to where the actual problem occurs in the code?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or mute the thread .