Number: 1870
Title: Possible memory corruption when agmemread fails
Submitter: David Brown
Date: Sat Jan 30 12:16:36 2010
Subsys: Lib(c)graph
Version: 2.26
System: x86-Windows-7
Severity: major
I've only encountered this a couple of times. Sometimes I can reproduce it and sometimes I can't, which I realize makes it difficult for you to fix. Regardless, I'm filing this bug anyway, in case it comes up again or by some miracle, you're able to reproduce it, as well.

I'm also not a C programmer, which probably limits the amount of relevant information I can provide, but I understand enough to read the Graphviz source code and call C functions from other programming languages (in my case, C#).

Essentially, it appears that if agmemread is called with invalid input data, it corrupts memory. After an unknown number of calls, it begins causing access violation errors (in C#, this results in an AccessViolationException) even when the input data is valid.

I restarted my machine to get a clean slate and now it works fine. But, I'm uncertain how many invalid calls I need to make until it starts exhibiting these symptoms. In addition, once one application using agmemread begins failing in this manner, every application on my machine that uses agmemread also begins to fail. Although, I can't tell if this is a coincidence or not.
[north] i believe the parser may be attempting to recover and in this situation it may try to fetch an unknown number of input tokens.

Doesn't the agmemread() discipline know the input buffer size?
Owner: *
Status: *