Comments (3)
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 [email protected]
on 21 Jan 2011 at 7:46
- Changed state: Started
- Added labels: OpSys-All, Priority-Critical
- Removed labels: Priority-Medium
from google-diff-match-patch.
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 [email protected]
on 22 Jan 2011 at 1:36
- Changed state: Fixed
from google-diff-match-patch.
Very fast fix, thanks.
Francis.
Original comment by [email protected]
on 24 Jan 2011 at 8:09
from google-diff-match-patch.
Related Issues (20)
- Consider SQLCLR compatibility / eliminate dependency on System.Web for UrlEncode and UrlDecode HOT 3
- xIndex for instertion after location
- Demo pages not working HOT 4
- Levenshtein distance problem
- objc version generates wrong diffs
- When is this project transferred to github? HOT 1
- Javascript version doesn't handle astral code points correctly
- Diffs of text containing tab characters? to br
- moving to GitHub?
- Issue with match
- JS library gives wrong result.
- C# uses \n instead of \n\r or Environment.NewLine
- c# patch_toText + patch_fromText doesn't work
- Ruby port
- performance slow?
- NewLines appear broken in patches (Python 3, Django 1.6.1) HOT 2
- Patch for /trunk/python3/diff_match_patch.py
- Patch for /trunk/python3/diff_match_patch.py
- Uninitialized string offset: 0 (function diff_cleanupSemanticLossless)
- Text containing HTML HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-diff-match-patch.