subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1572049 - in /subversion/trunk/subversion: libsvn_fs_fs/cached_data.c libsvn_fs_fs/tree.c libsvn_fs_x/tree.c
Date Wed, 26 Feb 2014 13:49:56 GMT
Author: stefan2
Date: Wed Feb 26 13:49:56 2014
New Revision: 1572049

URL: http://svn.apache.org/r1572049
Log:
Fix pool usage / object lifetime issues in FSFS found by valgrind.
Update FSX where it uses the same code.

* subversion/libsvn_fs_fs/cached_data.c
  (read_dir_entries): Use hash keys that live as long as the hash.
                      Luckily, we already have a suitable one.

* subversion/libsvn_fs_fs/tree.c
  (merge): When modifying members of the TARGET node, we must use
           a pool that lives at least as long as that node.

* subversion/libsvn_fs_x/tree.c
  (merge): Same.

Found by: philip

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/cached_data.c
    subversion/trunk/subversion/libsvn_fs_fs/tree.c
    subversion/trunk/subversion/libsvn_fs_x/tree.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/cached_data.c?rev=1572049&r1=1572048&r2=1572049&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/cached_data.c Wed Feb 26 13:49:56 2014
@@ -2048,9 +2048,10 @@ read_dir_entries(apr_array_header_t *ent
       dirent->id = svn_fs_fs__id_parse(str, strlen(str), result_pool);
 
       /* In incremental mode, update the hash; otherwise, write to the
-       * final array. */
+       * final array.  Be sure to use hash keys that survive this iteration.
+       */
       if (incremental)
-        apr_hash_set(hash, entry.key, entry.keylen, dirent);
+        apr_hash_set(hash, dirent->name, entry.keylen, dirent);
       else
         APR_ARRAY_PUSH(entries, svn_fs_dirent_t *) = dirent;
     }

Modified: subversion/trunk/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/tree.c?rev=1572049&r1=1572048&r2=1572049&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/tree.c Wed Feb 26 13:49:56 2014
@@ -1957,7 +1957,7 @@ merge(svn_stringbuf_t *conflict_p,
                                                s_entry->id,
                                                s_entry->kind,
                                                txn_id,
-                                               iterpool));
+                                               pool));
             }
           else
             {

Modified: subversion/trunk/subversion/libsvn_fs_x/tree.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/tree.c?rev=1572049&r1=1572048&r2=1572049&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/tree.c Wed Feb 26 13:49:56 2014
@@ -1932,7 +1932,7 @@ merge(svn_stringbuf_t *conflict_p,
                                               s_entry->id,
                                               s_entry->kind,
                                               txn_id,
-                                              iterpool));
+                                              pool));
             }
           else
             {



Mime
View raw message