Giter VIP home page Giter VIP logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 13, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 13, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 13, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.