curran / curran/google-diff-match-patch
BAD_ACCESS error in Objective-C when Diff_Timeout == 0 or > 6
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 17
- Forks
- 2
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
What steps will reproduce the problem?
1. Iterate thru a list of text files to compare and prepare diff ranges
2. For each file diff are obtained as below:
DiffMatchPatch* dmp = [DiffMatchPatch new];
dmp.Diff_TimeOut = 0;
NSMutableArray* diffs = [dmp diff_mainOfOldString:oldContent
andNewString:newContent];
// [dmp diff_cleanupEfficiency:diffs];
3. Sufficiently (around 214,000 chars, 34,00 words in 706 lines) large text
file with changes to last more than 6 seconds
What is the expected output? What do you see instead?
Expected: around 126 diffs
Actual:
BAD_ACCESS error @ DiffMatchPatch.m
diff_bisectOfOldString:andNewString:deadline:
line:677
676: for (CFIndex x = 0; x < v_length; x++) {
677: v1[x] = -1;
678: v2[x] = -1;
679: }
What version of the product are you using? On what operating system?
Product Version:diff_match_patch_20120106 (and also in the previous one)
OS: Mac OS X 10.7.2, 64 bit, XCode 4.2, iMac 23"
Please provide any additional information below.
- This happens only when iterating over a list of files (around 300)
- When the problem file in run individually, NO error
- Also works fine in Java
- Diff_TimeOut < 6, works with multi file iteration, but produces coarse diff
ranges. We need finer ranges and hence Diff_Timeout is set to zero.
- My $0.02 ==> Seems an issue if the
DiffMatchPatch.diff_bisectOfOldString:andNewString:deadline: is recursed more
than 5 times
Original issue reported on code.google.com by ampras...@gmail.com on 4 Feb 2012 at 9:16
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere den Absturz in DiffMatchPatch.m bei diff_bisectOfOldString:andNewString:deadline: mit einer großen, sich ändernden Textdatei, Diff_TimeOut auf 0 gesetzt und wiederholter Datei-Iteration. Untersuche den Zustand um Zeile 677 und vergleiche Läufe mit einer einzelnen Datei und mit mehreren Dateien. Als erledigt gilt, dass die Iteration ohne BAD_ACCESS abgeschlossen wird und die erwarteten feingranularen Diffs erzeugt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- objective-c
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 30/100