darcs

Issue 67 Getting a tag giving inconsistent repository.

Title Getting a tag giving inconsistent repository.
Priority bug Status resolved
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, edwint, eivuokko, granth, kowey, thorkilnaur, tommy, wglozer, zooko
Assigned To
Topics

Created on 2005-12-20.16:51:57 by edwint, last changed 2009-08-27.13:46:35 by admin.

Messages
msg248 (view) Author: edwint Date: 2005-12-20.16:51:56
Hello

We have a repository which 'darcs check says' is consistent, but when we do a
get specifying a certain tag, the resulting repository has problems: 'darcs
check' shows an inconsistency, and 'darcs whatsnew' crashes in Windows for darcs
1.0.4 and above (but not v1.0.3, and not in Linux). The crash is the "darcs.exe
has encountered a problem and needs to close" dialog box kind.

A copy of the tree is here:
http://download.businesswebsoftware.com/files/darcs-bug-demo.tgz (1.5MB). To
save space, the pristine and working copies are not present, and the patches
have been edited to change every line of our code to ' 1'.

To reproduce:
Decompress the archive
Run 'darcs repair' to regenerate the pristine tree.
Run 'darcs check' to verify that the repo is consistent.
In another directory, run 'darcs get --tag bugfixes broken' to get a copy up to
the tag.
Run 'darcs check'. This gives the output:
> Applying patch 1168 of 1188... 
> darcs failed:  Error applying hunk to file ./firmstep2/sql_cli.cpp
> Unapplicable patch:
> Wed Nov 30 17:41:48 GMT 2005  benh@bwsint.com
>  * verbose-odbc-type-selection

Run 'darcs whatsnew' in Windows. darcs will crash.

I modified the darcs makefile to make the compiler include debugging symbols and
tried a 'darcs whatsnew' with gdb.  The first three times, it didn't crash, but
the next time I got:
> Program received signal SIGSEGV, Segmentation fault.
> 0x00689d7b in computematchjumps ()

A backtrace gave:
> #0  0x00689d7b in computematchjumps ()
> #1  0x00686f66 in regcomp ()
> #2  0x0063de48 in s38j_info ()
> #3  0x012037f0 in ?? ()
> #4  0x01203808 in ?? ()
> #5  0x00000001 in ?? ()
> #6  0x012c2eac in ?? ()
> #7  0x00000001 in ?? ()
> #8  0x012037c0 in ?? ()
> #9  0x012037c8 in ?? ()
> #10 0x00000000 in ?? () from

Edwin
msg264 (view) Author: zooko Date: 2005-12-22.15:57:52
See also

http://bugs.darcs.net/issue8
msg295 (view) Author: droundy Date: 2006-01-02.14:36:21
I've just looked into the check/tag bug here, and it is reproducible on linux
with the latest darcs.  There are a couple of possibilities.  One is that there
was a bug in an older version of darcs that created the bad tag (and/or a bad
commute when pulling a change).  The other is that we've still got a bug in a
commute.  To distinguish between these, it would be nice if you could provide a
summary of which versions of darcs have been used on this repository?

I presume this repository has had the actual content removed so it could be made
public? That's okay, but makes it a bit hard to read the repository, since all
the lines are ones.  Could you perhaps rerun the conversion replacing each line
with some sort of checksum of its contents? That might make it easier to figure
out which lines are wrong.
msg296 (view) Author: droundy Date: 2006-01-02.14:49:12
Some history of how this tag came to be would also be helpful.  What sort of
development was going on here? (e.g. two developers working in parallel followed
by a big merge, updates from a stable branch being pulled into a development
branch, etc).
msg306 (view) Author: granth Date: 2006-01-05.11:36:22
We've had some success in tracing this issue. It looks like darcs get --tag
doesn't store the commuted patches. We don't know how to fix it. Here's a simple
way to reproduce the bug:

$ mkdir repo1
$ cd repo1
[repo1]$ darcs init
[repo1]$ cat >file
1
2
3
4
[repo1]$ darcs add file
[repo1]$ darcs record -a -m 'Added file'
Darcs needs to know what name (conventionally an email address) to use as the
(...)

What is your email address? edwint
Finished recording patch 'Added file'
[repo1]$ cat >file
2
3
4
[repo1]$ darcs record -a -m 'Removed line 1'
Finished recording patch 'Removed line 1'
[repo1]$ cat >file
2
4
[repo1]$ darcs record -a -m 'Removed line 3'
Finished recording patch 'Removed line 3'
[repo1]$ cd ..
$ mkdir repo2
$ cd repo2
[repo2]$ darcs init
[repo2]$ darcs pull C:/darcsbug/repo1

Thu Jan  5 11:11:58 GMT 2006  edwint
  * Added file
Shall I pull this patch? (1/3) [ynWvpxqadjk], or ? for help: y


Thu Jan  5 11:12:33 GMT 2006  edwint
  * Removed line 1
Shall I pull this patch? (2/3) [ynWvpxqadjk], or ? for help: n


Thu Jan  5 11:13:13 GMT 2006  edwint
  * Removed line 3
Shall I pull this patch? (3/3) [ynWvpxqadjk], or ? for help: y

Finished pulling and applying.
[repo2]$ darcs tag -m 'Tag'
Darcs needs to know what name (conventionally an email address) to use as the
(...)

What is your email address? edwint
Finished tagging patch 'TAG Tag'
[repo2]$ darcs push -a
Pushing to "C:/darcsbug/repo1"...
Finished applying...

[repo2]$ cd ..
$ darcs get --tag='Tag' repo1
Directory 'c:/darcsbug/repo1' already exists, creating repository as
'c:/darcsbug/repo1_0'
Copying patch 4 of 4... done!
Applying patch 1 of 1... done.
Finished getting.
$ cd repo1_0
[repo1_0]$ cat file
1
2
4
[repo1_0]$ darcs check
Applying patch 2 of 3...
darcs failed:  Error applying hunk to file ./file
Unapplicable patch:
Thu Jan  5 11:13:13 GMT 2006  edwint
  * Removed line 3
msg512 (view) Author: tommy Date: 2006-02-28.11:31:41
fixed in 1.0.6
Wed Feb  8 18:34:41 CET 2006  edwin.thomson@businesswebsoftware.com
  * Commute patches when getting a specific version of a repo
  Fix for issue 67
History
Date User Action Args
2005-12-20 16:51:57edwintcreate
2005-12-22 15:57:53zookosetstatus: unread -> unknown
nosy: + zooko
messages: + msg264
2006-01-02 14:08:52droundysettopic: + Windows
nosy: + wglozer, eivuokko
2006-01-02 14:36:22droundysettopic: - Windows
nosy: droundy, tommy, wglozer, zooko, eivuokko, edwint
messages: + msg295
2006-01-02 14:49:12droundysetnosy: droundy, tommy, wglozer, zooko, eivuokko, edwint
messages: + msg296
2006-01-05 11:36:23granthsetnosy: + granth
messages: + msg306
2006-02-28 11:31:43tommysetstatus: unknown -> resolved
nosy: droundy, tommy, wglozer, zooko, eivuokko, edwint, granth
messages: + msg512
2009-08-06 17:50:51adminsetnosy: + markstos, jast, Serware, dmitry.kurochkin, darcs-devel, dagit, mornfall, simon, kowey, beschmi, thorkilnaur, - droundy, wglozer, eivuokko, edwint, granth
2009-08-06 20:47:32adminsetnosy: - beschmi
2009-08-10 22:14:54adminsetnosy: + edwint, wglozer, eivuokko, granth, - markstos, darcs-devel, jast, dagit, Serware, mornfall
2009-08-25 18:02:14adminsetnosy: + darcs-devel, - simon
2009-08-27 13:46:35adminsetnosy: tommy, kowey, wglozer, darcs-devel, zooko, eivuokko, edwint, granth, thorkilnaur, dmitry.kurochkin