Closed GoogleCodeExporter closed 8 years ago
Confirmed. This is a classic example of a binary bomb, two algorithms which
individually are completely benign but which when combined produce unexpected
behaviour. In this case it is the linear space refinement interacting with the
line-mode speedup.
As a temporary fix, call diff_main with a third argument of 'false' which
deactivates the line-mode speedup:
diff_main(text1, text2, false)
Affects all language versions. I'll push out an emergency patch shortly. But
in the longer term I need to take a closer look at whether the line-mode
speedup is worthwhile (Issue 38).
Original comment by neil.fra...@gmail.com
on 21 Jan 2011 at 7:46
A new package has been uploaded to Google Code and to Subversion. This fixes
the issue, refactors the code to be cleaner and adds a unit test to check for
this.
I've also been able to characterize the bug in greater detail. The Java,
Python and C# versions would throw an out of bounds exception. The C++ and
(unreleased) Objective C versions would quietly encounter a buffer overflow,
but would usually appear to succeed. The JavaScript version handled this bug
without issues. And there was no bug in Lua since it doesn't have the linemode
speedup.
The bug was triggered when two lines were diffed that were both greater than
100 characters and neither contained a line break. There were certainly other
inputs that would trigger the bug, but that one is the simplest.
Thanks for reporting this!
Original comment by neil.fra...@gmail.com
on 22 Jan 2011 at 1:36
Very fast fix, thanks.
Francis.
Original comment by fran6las...@hotmail.fr
on 24 Jan 2011 at 8:09
Original issue reported on code.google.com by
fran6las...@hotmail.fr
on 21 Jan 2011 at 9:25Attachments: