darcs

Issue 1520 Irrefutable pattern failed for pattern Data.Maybe.Just a2

Title Irrefutable pattern failed for pattern Data.Maybe.Just a2
Priority urgent Status duplicate
Milestone Resolved in
Superseder Irrefutable pattern failed for pattern Data.Maybe.Just a2
View: 701
Nosy List Serware, ckeen, darcs-devel, de0u, dmitry.kurochkin, ganesh, kowey, nwf, thorkilnaur, twb, zweije
Assigned To
Topics Conflicts, Darcs2

Created on 2009-08-14.11:41:21 by kowey, last changed 2020-08-01.10:26:14 by bfrk.

Messages
msg8134 (view) Author: kowey Date: 2009-08-14.11:41:16
I'm just opening a new bug for Christian's issue msg7340

Where we last left off, we had started attempting the Forensics procedure
outlined on http://wiki.darcs.net/Forensics on Christian's private repo, but
made little headway after hitting the first milestone.

We need some way of reproducing this bug! :-(
msg10701 (view) Author: twb Date: 2010-04-08.23:35:23
Vincent Zweije wrote:
> 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'

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.
msg10702 (view) Author: zweije Date: 2010-04-09.20:10:36
On Fri, Apr 09, 2010 at 09:34:39AM +1000, trentbuck@gmail.com
wrote:

> Vincent Zweije wrote:
> > 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'

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

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.
-- 
WCC - Smart Search & Match
NL  +31 30 7503222
vzweije@wcc-group.com
www.wcc-group.com
msg10726 (view) Author: zweije Date: 2010-04-14.09:24:16
On Fri, Apr 09, 2010 at 09:47:14PM +0200, Vincent Zweije wrote:

> On Fri, Apr 09, 2010 at 09:34:39AM +1000, trentbuck@gmail.com
> wrote:
>
> > Vincent Zweije wrote:
> > > 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'
>
> > Vincent, it would be great if you could step through
> > http://wiki.darcs.net/Forensics to get more information.
>
> 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'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...
-- 
WCC - Smart Search & Match
NL  +31 30 7503222
vzweije@wcc-group.com
www.wcc-group.com
msg10727 (view) Author: kowey Date: 2010-04-14.09:43:36
On Wed, Apr 14, 2010 at 09:24:17 +0000, Vincent Zweije wrote:
> 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?

This depends... where there any conflictors involved in the
edit-the-line number stage?  Editing conflictors is rather tricky
business so there may be a risk of accidentally introducing a red
herring for #1.  If no herrings are involved then it might make
sense to open a new bug for #1.  Otherwise, the best is to ensure
that your edits manage to preserve the 'Irrefutable pattern'
message.

Thanks!

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
msg10730 (view) Author: zweije Date: 2010-04-14.12:55:20
On Wed, Apr 14, 2010 at 09:43:37AM +0000, Eric Kow wrote:

> On Wed, Apr 14, 2010 at 09:24:17 +0000, Vincent Zweije wrote:
> > 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?
>
> This depends... where there any conflictors involved in the
> edit-the-line number stage?  Editing conflictors is rather tricky
> business so there may be a risk of accidentally introducing a red
> herring for #1.

They were all plain hunk patches, some deleting lines, some
inserting lines, and some replacing lines.

The history contains several conflicts, though.

>                  If no herrings are involved then it might make
> sense to open a new bug for #1.  Otherwise, the best is to ensure
> that your edits manage to preserve the 'Irrefutable pattern'
> message.

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?
-- 
WCC - Smart Search & Match
NL  +31 30 7503222
vzweije@wcc-group.com
www.wcc-group.com
msg11989 (view) Author: kowey Date: 2010-08-06.09:00:11
We've lost Christian's history, but hopefully Ganesh's autoshrinker could 
work with Vincent's repo?

That would be the next thing to try I'd say...
msg13823 (view) Author: de0u Date: 2011-03-16.05:21:32
I have this problem too (2.4.3).  I can provide two repos for examination, 
but only by somebody who can keep them confidential and delete them 
afterward.
msg13824 (view) Author: de0u Date: 2011-03-16.05:24:42
Actually, full disclosure, what I have is

  Irrefutable pattern failed for pattern Data.Maybe.Just a2'o

(ends in "a2'o", not "a2").
msg13826 (view) Author: kowey Date: 2011-03-18.11:26:09
Dave, I'd be interested in the repo, but I can't promise we'll get to it 
very quickly.  How could we arrange to download it?  One option may 
involve encryption, say with my public key.  I can then put the repo into 
a private darcs-team location.
msg13828 (view) Author: de0u Date: 2011-03-20.04:54:17
Unfortunately, having these bits available to an indefinite audience for 
an indefinite period of time is basically the opposite of what I am 
comfortable with.

If one person is available to stare at these repositories, have an 
epiphany, and then delete them, that would be great.
msg22350 (view) Author: bfrk Date: 2020-08-01.10:26:12
See issue2370
History
Date User Action Args
2009-08-14 11:41:22koweycreate
2009-08-25 18:15:01adminsetnosy: + darcs-devel, - simon
2009-08-27 14:23:59adminsetnosy: kowey, darcs-devel, thorkilnaur, dmitry.kurochkin, ckeen
2010-03-03 14:55:57koweysetpriority: critical -> urgent
2010-03-30 14:52:53koweysettopic: + Darcs2
nosy: + Serware
2010-04-08 23:35:24twbsetnosy: + twb, 576965, zweije
messages: + msg10701
2010-04-09 20:10:38zweijesetmessages: + msg10702
2010-04-14 09:24:17zweijesetmessages: + msg10726
2010-04-14 09:43:37koweysetmessages: + msg10727
2010-04-14 12:55:21zweijesetmessages: + msg10730
2010-08-06 09:00:12koweysetstatus: waiting-for -> needs-reproduction
nosy: + ganesh, - 576965
messages: + msg11989
2011-03-16 05:21:33de0usetnosy: + de0u
messages: + msg13823
2011-03-16 05:24:43de0usetnosy: + nwf
messages: + msg13824
2011-03-18 11:26:10koweysetmessages: + msg13826
2011-03-20 04:54:19de0usetmessages: + msg13828
2020-08-01 10:26:14bfrksetstatus: needs-reproduction -> duplicate
messages: + msg22350