You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Mattias Rönnblom <ho...@lysator.liu.se> on 2001/11/08 08:46:50 UTC

segfault in propget-cmd.c

Hi,

I've just built the latest version of subversion (revision 423, if
I've understood everything correctly), and tried this:

[98%] matro@mortain$~> mkdir -p svnrepro/svntest
[98%] matro@mortain$~> svnadmin create /home/matro/svnrepro/svntest/
[98%] matro@mortain$~> svn co file:///home/matro/svnrepro/svntest/
[98%] matro@mortain$~> cd svntest/
[98%] matro@mortain$~/svntest> touch some-file
[98%] matro@mortain$~/svntest> svn add some-file
A          some-file
[98%] matro@mortain$~/svntest> svn propset some-key some-value some-file
property `some-key' set  on 'some-file'
[98%] matro@mortain$~/svntest> svn propget some-key some-file
some-file - some-key : some-value
Segmentation fault (core dumped)
[98%] matro@mortain$~/svntest> 

I guess this isn't the desired behaviour. This tiny patch seems to fix
the problem.

Index: subversion/clients/cmdline/propget-cmd.c
===================================================================
--- subversion/clients/cmdline/.svn/text-base/propget-cmd.c     Wed Nov  7 16:17:08 2001
+++ subversion/clients/cmdline/propget-cmd.c    Thu Nov  8 09:44:04 2001
@@ -76,7 +76,7 @@
       SVN_ERR (svn_client_propget (&props, propname, target,
                                    opt_state->recursive, pool));
 
-      for (hi = apr_hash_first(pool, props); hi; apr_hash_next(hi))
+      for (hi = apr_hash_first(pool, props); hi; hi = apr_hash_next(hi))
         {
           const char * filename; 
           const svn_string_t *propval;

Kind regards,
        Mattias

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

Re: segfault in propget-cmd.c

Posted by Ben Collins-Sussman <su...@collab.net>.
cmpilato@collab.net writes:

> > -      for (hi = apr_hash_first(pool, props); hi; apr_hash_next(hi))
> > +      for (hi = apr_hash_first(pool, props); hi; hi = apr_hash_next(hi))

In my extreme paranoia, I did an emacs tags-search for
'apr_hash_next', and found no other instances that lack assignment.
Phew.  :-)

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

Re: segfault in propget-cmd.c

Posted by cm...@collab.net.
=?iso-8859-1?Q?Mattias_R=F6nnblom?= <ho...@lysator.liu.se> writes:

Hey, Mattias.

Thanks for the patch.  I've reviewed it (yes, all one line of it) and
despite its immense complexity, I think I've finally determined that
it was a patch well written.  Oh, and I'm feeling sarcastic this
morning, too.

But sincerely, thanks for the fix.  One minor issue -- in the future,
please include with your patches a log message (see the HACKING file
in the top-level source code directory for more instructions on
this).  Don't worry about it for this patch -- I'm applying it now and
will compose the log message myself.

> Hi,
> 
> I've just built the latest version of subversion (revision 423, if
> I've understood everything correctly), and tried this:
> 
> [98%] matro@mortain$~> mkdir -p svnrepro/svntest
> [98%] matro@mortain$~> svnadmin create /home/matro/svnrepro/svntest/
> [98%] matro@mortain$~> svn co file:///home/matro/svnrepro/svntest/
> [98%] matro@mortain$~> cd svntest/
> [98%] matro@mortain$~/svntest> touch some-file
> [98%] matro@mortain$~/svntest> svn add some-file
> A          some-file
> [98%] matro@mortain$~/svntest> svn propset some-key some-value some-file
> property `some-key' set  on 'some-file'
> [98%] matro@mortain$~/svntest> svn propget some-key some-file
> some-file - some-key : some-value
> Segmentation fault (core dumped)
> [98%] matro@mortain$~/svntest> 
> 
> I guess this isn't the desired behaviour. This tiny patch seems to fix
> the problem.
> 
> Index: subversion/clients/cmdline/propget-cmd.c
> ===================================================================
> --- subversion/clients/cmdline/.svn/text-base/propget-cmd.c     Wed Nov  7 16:17:08 2001
> +++ subversion/clients/cmdline/propget-cmd.c    Thu Nov  8 09:44:04 2001
> @@ -76,7 +76,7 @@
>        SVN_ERR (svn_client_propget (&props, propname, target,
>                                     opt_state->recursive, pool));
>  
> -      for (hi = apr_hash_first(pool, props); hi; apr_hash_next(hi))
> +      for (hi = apr_hash_first(pool, props); hi; hi = apr_hash_next(hi))
>          {
>            const char * filename; 
>            const svn_string_t *propval;
> 
> Kind regards,
>         Mattias
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

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