You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by plasma <pl...@pchome.com.tw> on 2003/06/17 06:50:31 UTC

[PATCH] Correupt fields in file_baton when using 'svn export'

Hi all,

  After upgrading to 0.24.0, I encountered core dump when using 'svn
export', but seems others don't have this problem.  After fighting
with gdb, I think I have fixed the problem.

  The problem is that many fields are corrupted in file_baton.  The
reason is delta_proplists() in delta.c creates a subpool, and it
passes the subpool to called functions, including change_file_prop()
in export.c.  Since file_baton cached its own pool, I just use it
instead passed from calling function.


plasma


LOG:

* subversion/libsvn_client/export.c
  (change_file_prop()):  Don't use pool passed from caller to create
  a duplicate value of keywords, because the pool might be a temporary
  one, and the values are needed later.  Use the cached pool stored in
  file_baton instead.

PATCH:

--- export.c.orig	Mon Jun 16 03:09:58 2003
+++ export.c	Tue Jun 17 14:31:01 2003
@@ -398,23 +398,23 @@
 
   /* Store only the magic three properties. */
   if (strcmp (name, SVN_PROP_EOL_STYLE) == 0)
-    fb->eol_style_val = svn_string_dup (value, pool);
+    fb->eol_style_val = svn_string_dup (value, fb->pool);
 
   else if (strcmp (name, SVN_PROP_KEYWORDS) == 0)
-    fb->keywords_val = svn_string_dup (value, pool);
+    fb->keywords_val = svn_string_dup (value, fb->pool);
 
   else if (strcmp (name, SVN_PROP_EXECUTABLE) == 0)
-    fb->executable_val = svn_string_dup (value, pool);
+    fb->executable_val = svn_string_dup (value, fb->pool);
 
   /* Try to fill out the baton's keywords-structure too. */
   else if (strcmp (name, SVN_PROP_ENTRY_COMMITTED_REV) == 0)
-    fb->revision = apr_pstrdup (pool, value->data);
+    fb->revision = apr_pstrdup (fb->pool, value->data);
 
   else if (strcmp (name, SVN_PROP_ENTRY_COMMITTED_DATE) == 0)
-      SVN_ERR (svn_time_from_cstring (&fb->date, value->data, pool));
+      SVN_ERR (svn_time_from_cstring (&fb->date, value->data, fb->pool));
 
   else if (strcmp (name, SVN_PROP_ENTRY_LAST_AUTHOR) == 0)
-    fb->author = apr_pstrdup (pool, value->data);
+    fb->author = apr_pstrdup (fb->pool, value->data);
 
   return SVN_NO_ERROR;
 }

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

Re: [PATCH] Correupt fields in file_baton when using 'svn export'

Posted by Philip Martin <ph...@codematters.co.uk>.
plasma <pl...@pchome.com.tw> writes:

> * subversion/libsvn_client/export.c
>   (change_file_prop()):  Don't use pool passed from caller to create
>   a duplicate value of keywords, because the pool might be a temporary
>   one, and the values are needed later.  Use the cached pool stored in
>   file_baton instead.

Yup, valgrind agrees with you.  Committed in r6260.

We could do with some export regression tests.

-- 
Philip Martin

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