You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by John Locke <ma...@freelock.com> on 2005/02/27 00:34:56 UTC

svn st -N crash: tweak_statushash: Assertion failed

Hello,

This is part a bug report, part a question as to whether my workaround 
will lead to dire consequences down the road.

Situation: I recently installed ActiveState Komodo 3.1, which now has 
Subversion support. However, it was generating errors on my working 
copy, so the revision control wasn't showing up at all. This in Mandrake 
10.1 with subversion-1.1.0-1mdk.i586, installed a while ago from some 
media source I can't easily figure out right now.

Running svn st -u -N, with more than one directory specified, caused a 
segmentation fault. So I uninstalled the Subversion RPMs and 
compiled/installed svn 1.1.3 from source. This time I got this error:
svn: subversion/libsvn_wc/status.c:910: tweak_statushash: Assertion 
`repos_text_status == svn_wc_status_added' failed.
Aborted

After some troubleshooting, I found it was a single directory in the 
argument list causing the problem--if I omitted that directory from the 
arguments list, svn st -u -N worked fine. If I specified that directory, 
I got the error. I tried removing the directory and doing an svn up to 
bring it back. Still got the same result.

So I went to the source code, and found line 910 in the status.c file:
      assert (repos_text_status == svn_wc_status_added);

Now, I'm not a C programmer, so none of this makes a whole lot of sense 
to me. But I thought this looked funny--it looks like this is comparing 
these two values, when perhaps it should be assigning 
svn_wc_status_added to repos_text_status?

Anyway, I changed it to:
      assert (repos_text_status = svn_wc_status_added);

... and recompiled, and this seemed to fix my problem.

Then I ran across issue 2122 and 695 in the Subversion issue database.

So... is my fix going to cause any data loss or other strange things here?

Thanks,

-- 
John Locke
"Open Source Solutions for Small Business Problems"
published by Charles River Media, June 2004
http://www.freelock.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn st -N crash: tweak_statushash: Assertion failed

Posted by John Locke <ma...@freelock.com>.
Ben Collins-Sussman wrote:

>
> Well, yes, I can tell you what's different about our environments:  
> I'm using svn /trunk code, you're using 1.1.3 code.  Can you reproduce 
> your problem using /trunk?


Well, I knew that... just hoping to get away with letting somebody else 
test, so I didn't have to go track down a bunch of dev packages I don't 
have installed ;-)

But... I went ahead and did it, and yes, the issue is fixed in /trunk. 
Thanks for the help!

Cheers,

-- 
John Locke
"Open Source Solutions for Small Business Problems"
published by Charles River Media, June 2004
http://www.freelock.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn st -N crash: tweak_statushash: Assertion failed

Posted by Ben Collins-Sussman <su...@collab.net>.
On Feb 27, 2005, at 4:25 PM, John Locke wrote:
>
> I just checked out the Subversion HEAD, and followed the same steps
> (still with svn 1.1.3):
>
> [john@hunter subversion]$ cd subversion
> [john@hunter subversion]$ svn up -rPREV doc/README
> U  doc/README
> Updated to revision 6352.
> [john@hunter subversion]$ svn st -uvN doc
> svn: subversion/libsvn_wc/status.c:910: tweak_statushash: Assertion
> `repos_text_status == svn_wc_status_added' failed.
> Aborted
>
> So either it's recently been fixed, or there's something strange about
> one of our environments...
>

Well, yes, I can tell you what's different about our environments:  I'm 
using svn /trunk code, you're using 1.1.3 code.  Can you reproduce your 
problem using /trunk?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn st -N crash: tweak_statushash: Assertion failed

Posted by John Locke <ma...@freelock.com>.
Okay, maybe it's been fixed in HEAD...

On Sun, 2005-02-27 at 15:43 -0600, Ben Collins-Sussman wrote:
> 
> Hm, nope, this recipe doesn't work for me, using the latest svn code.  
> I tried it using my working copy of svn:
> 
> [sussman@BenBook:~]$ cd projects/svn
> [sussman@BenBook:~/projects/svn]$ svn up -rPREV doc/README
> U  doc/README
> Updated to revision 6352.
> [sussman@BenBook:~/projects/svn]$ svn st -uvN doc
>              13177    13126 sunny256     doc
> Status against revision:  13181
> 

I just checked out the Subversion HEAD, and followed the same steps
(still with svn 1.1.3):

[john@hunter subversion]$ cd subversion
[john@hunter subversion]$ svn up -rPREV doc/README
U  doc/README
Updated to revision 6352.
[john@hunter subversion]$ svn st -uvN doc
svn: subversion/libsvn_wc/status.c:910: tweak_statushash: Assertion
`repos_text_status == svn_wc_status_added' failed.
Aborted

So either it's recently been fixed, or there's something strange about
one of our environments... 

-- 
John Locke
"Open Source Solutions for Small Business Problems"
published by Charles River Media, June 2004
http://www.freelock.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn st -N crash: tweak_statushash: Assertion failed

Posted by Ben Collins-Sussman <su...@collab.net>.
On Feb 27, 2005, at 3:27 PM, John Locke wrote:
>
> Steps:
> 1. Check out a working copy from an existing repository with lots of 
> revisions and subdirectories.
> 2. Use svn up to get an older copy of any file in one of the 
> subdirectories:
> svn up -r PREV subdirectory/file.txt
> 3. Now, in the parent directory, try to do a non-recursive status on 
> the directory:
> svn st -uvN subdirectory
>
> You'll get the error.
>

Hm, nope, this recipe doesn't work for me, using the latest svn code.  
I tried it using my working copy of svn:

[sussman@BenBook:~]$ cd projects/svn
[sussman@BenBook:~/projects/svn]$ svn up -rPREV doc/README
U  doc/README
Updated to revision 6352.
[sussman@BenBook:~/projects/svn]$ svn st -uvN doc
             13177    13126 sunny256     doc
Status against revision:  13181


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn st -N crash: tweak_statushash: Assertion failed

Posted by John Locke <ma...@freelock.com>.

Ben Collins-Sussman wrote:

>
> No, it's definitely supposed to be comparing the two values.  assert() 
> always tests a condition.  Putting an assignment into assert(), 
> especially when the right-side of the assignment is a positive 
> integer, will always return a "true" value.  So it's a meaningless 
> assertion now.  The change you made is equivalent to having written 
> assert(1), which will always succeed.  You might as well have deleted 
> the whole assert call.  :-)
>
> So the question is:  *why* does the code expect repos_text_status to 
> be svn_wc_status_added?  And how does it happen that this isn't true?
>
Beats me.



Okay. I just figured out steps to reproduce, and determined the 
situation. There was one file in the problem directory that was 
"updated" to an earlier version. This causes the bug. I worked around it 
by doing the right thing--copying the desired version to a new branch, 
and switching the file to the branch. But it's quite an unfriendly 
response...

Steps:
1. Check out a working copy from an existing repository with lots of 
revisions and subdirectories.
2. Use svn up to get an older copy of any file in one of the subdirectories:
svn up -r PREV subdirectory/file.txt
3. Now, in the parent directory, try to do a non-recursive status on the 
directory:
svn st -uvN subdirectory

You'll get the error.

Cheers,

-- 
John Locke
"Open Source Solutions for Small Business Problems"
published by Charles River Media, June 2004
http://www.freelock.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn st -N crash: tweak_statushash: Assertion failed

Posted by Ben Collins-Sussman <su...@collab.net>.
On Feb 26, 2005, at 6:34 PM, John Locke wrote:
>
> Now, I'm not a C programmer,

Apparently not.  :-)

>  so none of this makes a whole lot of sense to me. But I thought this 
> looked funny--it looks like this is comparing these two values, when 
> perhaps it should be assigning svn_wc_status_added to 
> repos_text_status?

No, it's definitely supposed to be comparing the two values.  assert() 
always tests a condition.  Putting an assignment into assert(), 
especially when the right-side of the assignment is a positive integer, 
will always return a "true" value.  So it's a meaningless assertion 
now.  The change you made is equivalent to having written assert(1), 
which will always succeed.  You might as well have deleted the whole 
assert call.  :-)

So the question is:  *why* does the code expect repos_text_status to be 
svn_wc_status_added?  And how does it happen that this isn't true?

>
> Anyway, I changed it to:
>      assert (repos_text_status = svn_wc_status_added);
>
> ... and recompiled, and this seemed to fix my problem.
>
> Then I ran across issue 2122 and 695 in the Subversion issue database.

I haven't looked at these yet... lemme see.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org