[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Crash with 'svn st -u' and Version 1.3 (1.3.x branch)

From: Daniel Rall <dlr_at_finemaltcoding.com>
Date: 2005-10-18 19:10:26 CEST

On Tue, 18 Oct 2005, Philip Martin wrote:

> John Peacock <jpeacock@rowman.com> writes:
>
> > Philip Martin wrote:
> >> You don't need to keep it, the crash is caused by a HEAD revison
> >> without an svn:author:
> >> $ svnadmin create repo
> >> $ echo '#!/bin/sh' > repo/hooks/pre-revprop-change
> >> $ chmod +x repo/hooks/pre-revprop-change
> >> $ svn pd --revprop -rHEAD svn:author file://`pwd`/repo
> >> $ svn co file://`pwd`/repo wc
> >> $ svn st -u wc
> >> Segmentation fault
> >
> > Hrm... I wonder if that is in the keywords-as-hash code, then (since
> > you didn't provide a backtrace). I'll see if I can quickly track it
> > down...
>
> It's the new ood stuff:
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 16384 (LWP 1847)]
> 0x4006f34b in change_dir_prop (dir_baton=0x80a4cd0,
> name=0x40456357 "svn:entry:last-author", value=0x0, pool=0x8088408)
> at ../svn/subversion/libsvn_wc/status.c:1510
> 1510 db->ood_last_cmt_author = apr_pstrdup (db->pool, value->data);
> (gdb) p value
> $1 = (const svn_string_t *) 0x0
> (gdb)

Peter and I also tracked this to the same spot. I wrote a simple patch a
while ago, and am trying to get my httpd WC into a testable state.

To fix this problem, checking for a NULL value for "svn:author" is really
all that's needed, but perhaps the following patch would be better (given
that it's more defensive against other unexpected NULL values)?

[[[
* subversion/libsvn_wc/status.c
  (change_dir_prop): Assure that we actually have a value for
   properties sent from the repository before trying to use them.
]]]

--- subversion/libsvn_wc/status.c (revision 16782)
+++ subversion/libsvn_wc/status.c (working copy)
@@ -1504,15 +1504,18 @@
     db->prop_changed = TRUE;
 
   /* Note any changes to the repository. */
- if (strcmp (name, SVN_PROP_ENTRY_COMMITTED_REV) == 0)
- db->ood_last_cmt_rev = SVN_STR_TO_REV (value->data);
- else if (strcmp (name, SVN_PROP_ENTRY_LAST_AUTHOR) == 0)
- db->ood_last_cmt_author = apr_pstrdup (db->pool, value->data);
- else if (strcmp (name, SVN_PROP_ENTRY_COMMITTED_DATE) == 0)
+ if (value != NULL)
     {
- apr_time_t tm;
- SVN_ERR (svn_time_from_cstring (&tm, value->data, db->pool));
- db->ood_last_cmt_date = tm;
+ if (strcmp (name, SVN_PROP_ENTRY_COMMITTED_REV) == 0)
+ db->ood_last_cmt_rev = SVN_STR_TO_REV (value->data);
+ else if (strcmp (name, SVN_PROP_ENTRY_LAST_AUTHOR) == 0)
+ db->ood_last_cmt_author = apr_pstrdup (db->pool, value->data);
+ else if (strcmp (name, SVN_PROP_ENTRY_COMMITTED_DATE) == 0)
+ {
+ apr_time_t tm;
+ SVN_ERR (svn_time_from_cstring (&tm, value->data, db->pool));
+ db->ood_last_cmt_date = tm;
+ }
     }
 
   return SVN_NO_ERROR;

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Oct 18 19:09:54 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.