XmlDiffLib
XmlDiffLib copied to clipboard
System.StackOverflowException
An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll
I'm getting this failure when I try to diff this file. You can reproduce with the sample file below. Just use it as the To and From, and you will see it fail.
See the sample XML here: https://gist.github.com/maldworth/ef6cd93be25d3617379b899977a5ed5b
Thanks for bringing this to my attention. The problem here is that the algorithm for differencing xml uses recursion and is reaching the limit of the allowable recursion depth for .Net. I will need to rewrite the algorithm to avoid recursion, which will take me some time. In fact, I'll likely rewrite the code using the Zhang Sahsha algorithm as it will be far more accurate than it is now.
Beginning work on this issue here: https://github.com/BrutalSimplicity/XmlDiffLib/tree/zhang-shasha
I am also getting stack overflow exception, waiting for the fix :(
Sorry about that, are you getting it on every Xml, or is this a particular set of samples that is returning it.
Also, if you could post the Xml that would be helpful. You can perhaps post it as a gist, and put the link here.
I'll see if I can provide a short-term hack for it, until I rewrite the algorithm.
Not for every Xml. Only for lengthy input xml. I will post the xml in a while. Thank you.
Cool, thanks for the info. Yea, it's a fault of the algorithm I hadn't considered that when the Xml structure is deep enough the recursion limit gets hit.
any update on the fix :(?
Sorry man, this is still on my horizon, but you know... Life. Will try to do a bit more work this weekend.
I investigation this issue, it is associated with the same name elements without attributes, if there are several of them in the same parent. example:
<Root>
<First>
<Head>Head1</Head>
<Item>Value1</Item>
<Item>Value2</Item>
<Item>Value3</Item>
</First>
<Second>
<Head>Head2</Head>
<Item>Value1</Item>
<Item>Value2</Item>
<Item>Value3</Item>
</Second>
</Root>
this XML throw exception (stackoverflow)
MatchElement () can not correctly compare elements, because it does not check their contents. It turns out that all elements are equal to each other.
Hi, I'm also getting this error when the XML File is especially large., like around 100 rows. Any update on the fix? Perhaps I can help?
I am also getting this issue, is there any fix for this?
Same here, large files cause this issue.
Yeah, I also have that issue with large files.. any idea if progress was made or if there are any alternatives?