darcs

Issue 615 Impossible case at PatchRead.lhs:58 compiled 20:45:07 Jan 24 2008

Title Impossible case at PatchRead.lhs:58 compiled 20:45:07 Jan 24 2008
Priority bug Status resolved
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, jarekadam, kowey, markstos, thorkilnaur, tommy
Assigned To markstos
Topics

Created on 2008-01-24.23:56:50 by jarekadam, last changed 2009-08-27.14:08:27 by admin.

Messages
msg2724 (view) Author: jarekadam Date: 2008-01-24.23:56:49
Hi,

I have a problem which seams to be similar to issue 364. I have compiled
darcs 1.0.9 using ghc version 6.6.1 (I'm using Ubuntu 7.10 package
ghc6_6.6.1-2ubuntu2_i386.deb).
I'm getting flowing error when I try to get remote repository (darcs
1.0.9 was installed in
/home/jam/usr/bin and darcs 1.1.0pre1 was installed in /home/jam/usr2/bin)

----
jam@trusia:~/Kuweta
$ ~/usr/bin/darcs get odie.iitis.gliwice.pl:Kuweta/phd-miszczak-en
Applying patch 29 of 54... darcs: bug in darcs!
Impossible case at PatchRead.lhs:58 compiled 20:45:07 Jan 24 2008
Please report this to bugs@darcs.net,
If possible include the output of 'darcs --exact-version'.
jam@trusia:~/Kuweta
$ darcs --exact-version
darcs compiled on Jan 24 2008, at 20:47:32
# configured Sat Jun 16 09:59:48 PDT 2007
./configure /usr/local/share/config.site /usr/local/etc/config.site

Context:

[TAG 1.0.9
Tommy Pettersson <ptp@lysator.liu.se>**20070603213706]
----

I get the same error using darcs 1.0.9rc1 from Ubuntu 7.10 package

----
jam@trusia:~
$ /usr/bin/darcs --exact-version
darcs compiled on Nov 20 2006, at 13:48:04
# configured Mon Oct  9 15:12:44 EDT 2006
./configure --no-create --no-recursion

Context:

[TAG 1.0.9rc1
Tommy Pettersson <ptp@lysator.liu.se>**20061008175207]
----

and using compiled darcs 1.1.0pre1.

----
jam@trusia:~/Kuweta/test/tmp
$ ~/usr2/bin/darcs get odie.iitis.gliwice.pl:Kuweta/phd-miszczak-en
Applying patch 29 of 54... darcs: bug in darcs!
Impossible case at src/Darcs/Patch/Read.lhs:58 compiled 21:31:22 Jan 24 2008
Please report this to bugs@darcs.net,
If possible include the output of 'darcs --exact-version'.
jam@trusia:~/Kuweta/test/tmp
$ ~/usr2/bin/darcs --exact-version
darcs compiled on Jan 24 2008, at 21:33:46
unknown
----

I do not get this error when I copy repository to local machine and
then use 'darcs get'.

I also get this error using 'darcs repair'.

----
jam@trusia:~/Kuweta/test/phd-miszczak-en
$ ~/usr/bin/darcs repair
Applying patch 29 of 54... darcs: bug in darcs!
Impossible case at PatchRead.lhs:58 compiled 20:45:07 Jan 24 2008
Please report this to bugs@darcs.net,
If possible include the output of 'darcs --exact-version'.
jam@trusia:~/Kuweta/test/phd-miszczak-en
$ ~/usr/bin/darcs --exact-version
darcs compiled on Jan 24 2008, at 20:47:32
# configured Sat Jun 16 09:59:48 PDT 2007
./configure /usr/local/share/config.site /usr/local/etc/config.site

Context:

[TAG 1.0.9
Tommy Pettersson <ptp@lysator.liu.se>**20070603213706]
----

Cheers,

Jarek
msg2731 (view) Author: markstos Date: 2008-01-25.01:48:05
Thanks for the report, jarekadam. 

Is the repo involved one that could be made available for testing? 

I'm marking this as a duplicate of issue364, because it seems like the same
issue,  but have a good example to trigger it seems to be difficult. 

   Mark
msg2890 (view) Author: jarekadam Date: 2008-01-30.14:28:02
Hi,

I have prepared a copy of the repository which triggers this bug at
http://www.freeshells.ch/~jam/test_repo/
http://www.freeshells.ch/~jam/test_repo.tgz

It contains only one patch - the one which causes the errror.

I have tested this repo with latest darcs from unstable branch and
with 1.0.9rc1 (from Debian testing).

----
jam@odie:~/tmp
$ darcs --exact-version
darcs compiled on Jun 21 2007, at 12:48:00
# configured Mon Oct  9 15:12:44 EDT 2006
./configure --no-create --no-recursion

Context:

[TAG 1.0.9rc1
Tommy Pettersson <ptp@lysator.liu.se>**20061008175207]
jam@odie:~/tmp
$ darcs get http://freeshells.ch/~jam/test_repo --repodir=test_http
Copying patch 1 of 1... done!
Applying patch 1 of 1... done.
darcs: bug in darcs!
Impossible case at PatchRead.lhs:56 compiled 12:44:55 Jun 21 2007
Please report this to bugs@darcs.net,
If possible include the output of 'darcs --exact-version'.
jam@odie:~/tmp
$ darcs get /home/jam/Kuweta/temp/test_repo --repodir=test_local
Copying patch 1 of 1... done!
Finished getting.
----

For the latest unstable version I got following output
----
jam@odie:~/tmp
$ ~/usr-test/bin/darcs --exact-version
darcs compiled on Jan 30 2008, at 07:51:47
unknown
jam@odie:~/tmp
$ ~/usr-test/bin/darcs get http://freeshells.ch/~jam/test_repo
--repodir=test_http_unstable
--07:56:39--  http://freeshells.ch/~jam/test_repo/_darcs/patches/20071218200518-d7f4f-699f3d7899e3b194b12983511dce48f631dcc46f.gz
           => `20071218200518-d7f4f-699f3d7899e3b194b12983511dce48f631dcc46f.gz'
Resolving freeshells.ch... 193.73.230.111, 2001:620:2000:2::111
Connecting to freeshells.ch|193.73.230.111|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1,381 (1.3K) [application/x-gzip]

100%[=================================================================================================================>]
1,381         --.--K/s

07:56:40 (157.83 KB/s) -
`20071218200518-d7f4f-699f3d7899e3b194b12983511dce48f631dcc46f.gz'
saved [1381/1381]

FINISHED --07:56:40--
Downloaded: 1,381 bytes in 1 files
darcs: failed to read patch:
Tue Dec 18 21:05:18 CET 2007  Jarek Miszczak <miszczak@iitis.gliwice.pl>
  * Hyperref and subfigure packages
Couldn't parse file
/home/jam/tmp/test_http_unstable/_darcs/patches/20071218200518-d7f4f-699f3d7899e3b194b12983511dce48f631dcc46f.gz
jam@odie:~/tmp
$ ~/usr-test/bin/darcs get /home/jam/Kuweta/temp/test_repo
--repodir=test_local_unstable
darcs: failed to read patch:
Tue Dec 18 21:05:18 CET 2007  Jarek Miszczak <miszczak@iitis.gliwice.pl>
  * Hyperref and subfigure packages
Couldn't parse file
/home/jam/Kuweta/temp/test_repo/_darcs/patches/20071218200518-d7f4f-699f3d7899e3b194b12983511dce48f631dcc46f.gz
----

I guess that patch described in http://bugs.darcs.net/msg2752
solves the problem. Any way it seams to be strange that darcs
behaviour depends on the type of repository.

I don't know why there was an error in darcs patch. I have tried to fix
my original repo by deleting this patch from _darcs/ptaches directory
and from _darcs/inventory file. But this caued "Unapplicable patch" error.

Can someone suggest what should I do to repair repository with
broken patch?

Cheers,

Jarek

On Jan 25, 2008 2:48 AM, Mark Stosberg <bugs@darcs.net> wrote:
>
>
> Thanks for the report, jarekadam.
>
> Is the repo involved one that could be made available for testing?
>
> I'm marking this as a duplicate of issue364, because it seems like the same
> issue,  but have a good example to trigger it seems to be difficult.
>
>    Mark
>
> ----------
> nosy: +markstos
> priority:  -> bug
> status: unread -> chatting
>
> __________________________________
> Darcs bug tracker <bugs@darcs.net>
> <http://bugs.darcs.net/issue615>
> __________________________________
>
msg2894 (view) Author: markstos Date: 2008-01-30.14:32:55
Jarekadam,

Thanks for the test case. We'll take a look. 

I'm assigning the bug to myself for further triage. 

   Mark
msg2895 (view) Author: droundy Date: 2008-01-30.14:40:19
Do you have any other copies of the repository (or of related branches of the
same repository)? Actually, it'd need to be another repository that contains
this patch (although possibly in a different context).

It's definitely a corrupt patch, and I've no idea what could trigger this.  Some
sort of IO error, presumably.  It's a very small file mostly full of zeros.

Since darcs 2 does give proper error messages in this case, I'm marking this bug
as resolved-in-unstable.  But do let us know if we can help you reconstruct your
 repository.

Actually, if this is the only patch that's corrupt, we might be able 
reconstruct the correct state simply by working forward and backwards and seeing
what is missing (assuming your pristine cache is all right).  Let me know if
this is a repository I can help you with (i.e. it's not secret).  You can check
if there's more than one corrupt patch by running "darcs changes -s" with
darcs2, and seeing whether any other patches say [this patch is unavailable].

David
History
Date User Action Args
2008-01-24 23:56:50jarekadamcreate
2008-01-25 01:48:06markstossetpriority: bug
status: unread -> unknown
messages: + msg2731
nosy: + markstos
2008-01-30 14:28:11jarekadamsetnosy: droundy, tommy, beschmi, kowey, markstos, jarekadam
messages: + msg2890
2008-01-30 14:32:56markstossetnosy: droundy, tommy, beschmi, kowey, markstos, jarekadam
messages: + msg2894
assignedto: markstos
2008-01-30 14:40:20droundysetnosy: droundy, tommy, beschmi, kowey, markstos, jarekadam
messages: + msg2895
2008-01-30 14:40:37droundysetstatus: unknown -> resolved-in-unstable
nosy: droundy, tommy, beschmi, kowey, markstos, jarekadam
2008-02-13 22:39:33markstoslinkissue684 superseder
2008-09-04 21:32:11adminsetstatus: resolved-in-unstable -> resolved
nosy: + dagit
2009-08-06 17:52:22adminsetnosy: + jast, Serware, dmitry.kurochkin, darcs-devel, zooko, mornfall, simon, thorkilnaur, - droundy, jarekadam
2009-08-06 20:55:21adminsetnosy: - beschmi
2009-08-10 22:11:57adminsetnosy: + jarekadam, - darcs-devel, zooko, jast, Serware, mornfall
2009-08-11 00:05:14adminsetnosy: - dagit
2009-08-25 18:03:52adminsetnosy: + darcs-devel, - simon
2009-08-27 14:08:27adminsetnosy: tommy, kowey, markstos, darcs-devel, thorkilnaur, jarekadam, dmitry.kurochkin