#576965 darcs: crashes with irrefutable pattern failed

Package:
darcs
Source:
darcs
Description:
distributed, interactive, smart revision control system
Submitter:
Vincent Zweije
Date:
2010-04-14 12:57:05 UTC
Severity:
normal
#576965#5
Date:
2010-04-08 15:42:15 UTC
From:
To:
I presume this is seriously ungood:

    $ darcs pull --all --patch http://www.sqlite.org/src/info/ccb9393a7a10f0970419b860af293b0bdad7f894
    Merging us 19/60
    Merging us 23/60
    Merging us 43/60
    Pulling from "/home/vincent/Lemon/darcs/trunk/tool"...
    Will pull the following changes:
    Wed Dec 10 21:10:05 CET 2008  shane
      * http://www.sqlite.org/src/info/ccb9393a7a10f0970419b860af293b0bdad7f894
      Added option (-l) to lemon parser to have it skip printing line numbers (#line ... ). (CVS 6008)

        M ./lemon.c -19 +21
    darcs: src/Darcs/Patch/Real.hs:(506,21)-(507,35): Irrefutable pattern failed for pattern Data.Maybe.Just a2'
    $

Repositories available on request.

Ciao.
Vincent.

#576965#12
Date:
2010-04-08 23:34:39 UTC
From:
To:
Vincent Zweije wrote:

I believe this issue is known upstream:

http://bugs.darcs.net/issue1520
    Irrefutable pattern failed for pattern Data.Maybe.Just a2

and the older history:

http://bugs.darcs.net/issue1204
    "pull => src/Darcs/Patch/Real.lhs:(479, 21)-(497, 99): Irrefutable
    pattern failed for pattern Data.Maybe.Just a2 (2.1.0+236)"

http://bugs.darcs.net/issue857
    unrecord => Irrefutable pattern failed for pattern Data.Maybe.Just
    a2_minus_p1n1 (2.0.0+)

http://bugs.darcs.net/issue701
    Irrefutable pattern failed for pattern Data.Maybe.Just a2

Vincent, it would be great if you could step through
http://wiki.darcs.net/Forensics to get more information.

You can CC information directly to upstream's bug tracker by sending
it to bugs@darcs.net, but it *MUST* have the header field

    Subject: [issue1520] Irrefutable pattern failed for pattern Data.Maybe.Just a2

otherwise upstream's bug tracker will do the wrong thing.

#576965#19
Date:
2010-04-09 19:47:14 UTC
From:
To:
I've narrowed it down to one repository (unchanged from the
original problem, the pull destination), plus one patch bundle
(the one pulled in the original problem) containing a single
patch with several hunks. That was the easy part.

Then I coalesced all of the repository history into a single
patch, and tried to get the patch bundle to apply. After
fooling around with hunk line numbers I found that one of the
hunks is trying to delete two lines which in the target file
(lemon.c) have different contents. Replacing the lines with
the actual lines in the target file makes the patch bundle
apply cleanly (with the hunk line numbers adjusted).

I do not know (yet) if the different contents are because
of a spurious change in the target repository or in the
patch bundle.

More when I have time again.

If you have suggestions where to direct my attention from
here let me know.

Ciao.                                                  Vincent.

#576965#24
Date:
2010-04-14 09:23:36 UTC
From:
To:
I'm afraid I haven't done any more sleuthing since my previous
message, but...

I neglected to mention that with coalesced history and fixed
line numbers (but no fixed hunk), darcs does not crash,
but simply fails with:

    $./reproduce.sh
    + darcs apply --repo repo bundle.dpatch

    darcs failed:  Error applying hunk to file ./lemon.c
    $

There must be something in the history of the repository
causing the crash.

Actually, looks like there are two problems:

 1. The pull produces a patch that does not apply to the
    pull destination, and

 2. The non-applying patch causes a darcs crash.

Would you agree that the first is the more interesting?

Hm. Things are getting complicated...

#576965#29
Date:
2010-04-14 12:54:40 UTC
From:
To:
They were all plain hunk patches, some deleting lines, some
inserting lines, and some replacing lines.

The history contains several conflicts, though.

I've gone back to a non-coalesced history.

Most hunks can be made to apply by fixing their line
numbers. If the line numbers are wrong, darcs produces a
normal error: cannot apply patch, instead of a crash.

It turns out two hunks cannot be got to apply by modifying
their line numbers. Somewhere in the region where the line
numbers presumably should be (a region of 4 line numbers),
the darcs error turns into the dreaded darcs crash.

By the way, to speed up this line number editing, what
precisely is the line number of a hunk supposed to mean?