[Dot] STDOUT doesn't get closed on large graphs?
Ported Issue from Mantis Original ID: 2428 Reported By: MindMusic
SEVERITY: NORMAL Submitted: 2014-03-03 18:40:21
OS: WINDOWS 7
PLATFORM: WINDOWS
DESCRIPTION
I'm generating a programmatically calling Dot from a .NET app. The app uses a very small third-party wrapper to generate a graph without explicitly opening a command shell, writing the resultant image files to disk, etc. ... I've also reported the error to the developers of the wrapper here...
https://github.com/JamieDixon/GraphViz-C-Sharp-Wrapper/issues/1
... but I don't think that they're the problem. The wrapper simply attaches two streams to StdIn and StdOut... sends the dot-formatting string to StdIn, then tries to copy the resultant PNG data back out of the StdOut. It does this copy with a simple C# call to the Stream.CopyTo(Stream) method. So far so good...
The problem only seems to occur when we pass in a larger digraph string (in my case, larger than a couple of dozen nodes?). The call to CopyTo seems to hang forever. According to MicroSoft, CopyTo will continue to attempt to copy until the stream is closed. I suspect that for larger graphs, Dot is not closing the stream after it renders the graph to StdOut under Windows.
I read a decade-old forum discussion...
http://permalink.gmane.org/gmane.comp.video.graphviz/1006
... about this being intended functionality since Dot has the ability to render multiple graphs from one dot file, but it seemed to cause problems for the Windows guys at the time... I'm not sure that this is still the intended functionality. Also, I'm not sure why this would only be a problem with larger dot-formatting strings. Any ideas? Thanks in advance!