-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Rapidquilt attempted to rollback a patch and that failed. #31
Comments
Does it work with 0.6.5? |
No. Nor 0.6.4, or 0.6.3. Version 0.6.2 segfaults. |
Just to make one thing clear, the series does NOT apply. This is the output of
But it shouldn't trigger a bug. |
Another instance: Applying 66387 patches using 4 threads... branch users/msuchanek/tmp/rapidquild-BUG in kernel-source |
Good news: I can still reproduce the same failure with rapidquilt. Looking into it now. |
Status update: At least in one case, the bug is caused by overlapping hunks. Both hunks are applied, but since the second hunk changes the trailing context of the first hunk, the first one no longer matches in the reverse direction. The apparent root cause is that overlapping hunks should fail to apply. That's a bug which must be fixed in any case. It may also be a good idea to roll back applied hunks in reverse order, which would mask the root cause at first, but it may allow to implement an option to allow overlapping hunks… |
I have to correct myself. GNU patch accepts overlapping hunks, and rapidquilt can also parse them. As long as the overlap covers only the hunk context, all is fine. But if a hunk's context overlaps a previously patched line, the previous hunk is silently ignored! GNU patch will apply both (or all) hunks in that case. At this point, it's better to allow overlapping hunks in rapidquilt. |
Ugh, the behaviour of GNU patch is puzzling. Let's have a file that goes like this:
The following patch applies cleanly:
Then I change the third hunk header to:
That still applies:
Then I change the third hunk header to:
But then the hunk suddenly no longer applies:
I'm afraid it's futile to provide bug-for-bug compatibility with GNU patch in this case. Instead, rapidquilt will also accept the third variant of the patch and apply the hunk with offset -2 lines. |
This is related to #31, but not a complete solution yet, because I can still reproduce the original failure with some patch series. The last commit adds one of the reported cases to test data, and it passes cargo test, so there is some improvement.
The attached series triggers a bug.
Output with
RUST_BACKTRACE=1 rapidquilt push -a --dry-run --threads=1
(just to make sure it's not a race condition, but it also fails multi-threaded):The text was updated successfully, but these errors were encountered: