You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by sv...@apache.org on 2015/05/12 06:00:20 UTC
svn commit: r1678854 - in /subversion/branches/1.9.x: ./ STATUS
subversion/libsvn_fs_fs/cached_data.c subversion/libsvn_fs_fs/fs_fs.c
subversion/libsvn_fs_fs/recovery.c subversion/libsvn_fs_fs/transaction.c
subversion/libsvn_subr/hash.c
Author: svn-role
Date: Tue May 12 04:00:20 2015
New Revision: 1678854
URL: http://svn.apache.org/r1678854
Log:
Merge the r1678147 group from trunk:
* r1678147, r1678149
Provide more informative error messages for FSFS parsing errors.
Justification:
"Serialized hash missing terminator" is a mostly useless error message.
Votes:
+1: stsp, rhuijben, stefan2
Modified:
subversion/branches/1.9.x/ (props changed)
subversion/branches/1.9.x/STATUS
subversion/branches/1.9.x/subversion/libsvn_fs_fs/cached_data.c
subversion/branches/1.9.x/subversion/libsvn_fs_fs/fs_fs.c
subversion/branches/1.9.x/subversion/libsvn_fs_fs/recovery.c
subversion/branches/1.9.x/subversion/libsvn_fs_fs/transaction.c
subversion/branches/1.9.x/subversion/libsvn_subr/hash.c
Propchange: subversion/branches/1.9.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 12 04:00:20 2015
@@ -91,4 +91,4 @@
/subversion/branches/verify-at-commit:1462039-1462408
/subversion/branches/verify-keep-going:1439280-1546110
/subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1660545-1660547,1660549-1662901,1663003,1663183-1663184,1663338,1663347,1663355,1663374,1663450,1663530,1663671,1663697,1663706,1663738,1663749,1663791,1663991,1664035,1664078,1664080,1664084-1664085,1664187,1664191,1664193,1664200,1664344,1664476,1664480-1664481,1664483,1664489-1664490,1664507,1664520-1664521,1664523,1664526-1664527,1664531-1664532,1664588,1664593-1664594,1664596,1664653,1664664,1664672,1664674,1664684,1664927,1664938-1664940,1664978,1664984,1664997,1665164,1665195,1665213,1665259,1665318,1665437-1665438,1665609,1665611-1665612,1665845,1665850,1665852,1665886,1665894,1665896,1666096,1666258,1666270,1666272,1666379,1666449,1666690,1666832,1666851,1666965,1667101,1667106-1667107,1667120,1667228,1667233-1667235,1667249-1667250,1667258,1667290,1667301,1667471,1667691-1667693,1667699-1667700,1667715,1667941,1667976,1668320,1668598-1668600,1668602-1668603,1668607-1668608,1668618,1669743,1669746,1669749,1669945,1670139,1670149,1670152,1670329,1670337,167
0347,1670353,1671164,1671388,1672295,1672311,1672372,1672404,1672511-1672512,1672578,1672728,1673044,1673062-1673063,1673065,1673153,1673170,1673172,1673197,1673202,1673204,1673228,1673282,1673445,1673691-1673692,1673746,1673785,1673803,1674015,1674032,1674170,1674406,1674415,1674487,1674522,1674580,1674627,1674891,1675771,1676526,1676535,1676538,1676555,1676564,1676570,1676665,1676667,1676769,1677191,1677267,1678494
+/subversion/trunk:1660545-1660547,1660549-1662901,1663003,1663183-1663184,1663338,1663347,1663355,1663374,1663450,1663530,1663671,1663697,1663706,1663738,1663749,1663791,1663991,1664035,1664078,1664080,1664084-1664085,1664187,1664191,1664193,1664200,1664344,1664476,1664480-1664481,1664483,1664489-1664490,1664507,1664520-1664521,1664523,1664526-1664527,1664531-1664532,1664588,1664593-1664594,1664596,1664653,1664664,1664672,1664674,1664684,1664927,1664938-1664940,1664978,1664984,1664997,1665164,1665195,1665213,1665259,1665318,1665437-1665438,1665609,1665611-1665612,1665845,1665850,1665852,1665886,1665894,1665896,1666096,1666258,1666270,1666272,1666379,1666449,1666690,1666832,1666851,1666965,1667101,1667106-1667107,1667120,1667228,1667233-1667235,1667249-1667250,1667258,1667290,1667301,1667471,1667691-1667693,1667699-1667700,1667715,1667941,1667976,1668320,1668598-1668600,1668602-1668603,1668607-1668608,1668618,1669743,1669746,1669749,1669945,1670139,1670149,1670152,1670329,1670337,167
0347,1670353,1671164,1671388,1672295,1672311,1672372,1672404,1672511-1672512,1672578,1672728,1673044,1673062-1673063,1673065,1673153,1673170,1673172,1673197,1673202,1673204,1673228,1673282,1673445,1673691-1673692,1673746,1673785,1673803,1674015,1674032,1674170,1674406,1674415,1674487,1674522,1674580,1674627,1674891,1675771,1676526,1676535,1676538,1676555,1676564,1676570,1676665,1676667,1676769,1677191,1677267,1678147,1678149,1678494
Modified: subversion/branches/1.9.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/STATUS?rev=1678854&r1=1678853&r2=1678854&view=diff
==============================================================================
--- subversion/branches/1.9.x/STATUS (original)
+++ subversion/branches/1.9.x/STATUS Tue May 12 04:00:20 2015
@@ -101,13 +101,6 @@ Veto-blocked changes:
Approved changes:
=================
- * r1678147, r1678149
- Provide more informative error messages for FSFS parsing errors.
- Justification:
- "Serialized hash missing terminator" is a mostly useless error message.
- Votes:
- +1: stsp, rhuijben, stefan2
-
* r1677003
Bump reqired Java version to 1.6 for JavaHL.
Justification:
Modified: subversion/branches/1.9.x/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_fs_fs/cached_data.c?rev=1678854&r1=1678853&r2=1678854&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_fs_fs/cached_data.c Tue May 12 04:00:20 2015
@@ -2641,16 +2641,27 @@ svn_fs_fs__get_proplist(apr_hash_t **pro
if (noderev->prop_rep && svn_fs_fs__id_txn_used(&noderev->prop_rep->txn_id))
{
+ svn_error_t *err;
const char *filename
= svn_fs_fs__path_txn_node_props(fs, noderev->id, pool);
proplist = apr_hash_make(pool);
SVN_ERR(svn_stream_open_readonly(&stream, filename, pool, pool));
- SVN_ERR(svn_hash_read2(proplist, stream, SVN_HASH_TERMINATOR, pool));
+ err = svn_hash_read2(proplist, stream, SVN_HASH_TERMINATOR, pool);
+ if (err)
+ {
+ svn_string_t *id_str = svn_fs_fs__id_unparse(noderev->id, pool);
+
+ svn_error_clear(svn_stream_close(stream));
+ return svn_error_quick_wrapf(err,
+ _("malformed property list for node-revision '%s' in '%s'"),
+ id_str->data, filename);
+ }
SVN_ERR(svn_stream_close(stream));
}
else if (noderev->prop_rep)
{
+ svn_error_t *err;
fs_fs_data_t *ffd = fs->fsap_data;
representation_t *rep = noderev->prop_rep;
pair_cache_key_t key = { 0 };
@@ -2669,7 +2680,16 @@ svn_fs_fs__get_proplist(apr_hash_t **pro
proplist = apr_hash_make(pool);
SVN_ERR(svn_fs_fs__get_contents(&stream, fs, noderev->prop_rep, FALSE,
pool));
- SVN_ERR(svn_hash_read2(proplist, stream, SVN_HASH_TERMINATOR, pool));
+ err = svn_hash_read2(proplist, stream, SVN_HASH_TERMINATOR, pool);
+ if (err)
+ {
+ svn_string_t *id_str = svn_fs_fs__id_unparse(noderev->id, pool);
+
+ svn_error_clear(svn_stream_close(stream));
+ return svn_error_quick_wrapf(err,
+ _("malformed property list for node-revision '%s'"),
+ id_str->data);
+ }
SVN_ERR(svn_stream_close(stream));
if (ffd->properties_cache && SVN_IS_VALID_REVNUM(rep->revision))
Modified: subversion/branches/1.9.x/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_fs_fs/fs_fs.c?rev=1678854&r1=1678853&r2=1678854&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_fs_fs/fs_fs.c Tue May 12 04:00:20 2015
@@ -1944,7 +1944,10 @@ get_node_origins_from_file(svn_fs_t *fs,
stream = svn_stream_from_aprfile2(fd, FALSE, pool);
*node_origins = apr_hash_make(pool);
- SVN_ERR(svn_hash_read2(*node_origins, stream, SVN_HASH_TERMINATOR, pool));
+ err = svn_hash_read2(*node_origins, stream, SVN_HASH_TERMINATOR, pool);
+ if (err)
+ return svn_error_quick_wrapf(err, _("malformed node origin data in '%s'"),
+ node_origins_file);
return svn_stream_close(stream);
}
Modified: subversion/branches/1.9.x/subversion/libsvn_fs_fs/recovery.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_fs_fs/recovery.c?rev=1678854&r1=1678853&r2=1678854&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_fs_fs/recovery.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_fs_fs/recovery.c Tue May 12 04:00:20 2015
@@ -160,6 +160,7 @@ recover_find_max_ids(svn_fs_t *fs,
apr_hash_index_t *hi;
apr_pool_t *iterpool;
node_revision_t *noderev;
+ svn_error_t *err;
baton.stream = rev_file->stream;
SVN_ERR(svn_io_file_seek(rev_file->file, APR_SET, &offset, pool));
@@ -205,7 +206,16 @@ recover_find_max_ids(svn_fs_t *fs,
/* Now read the entries from that stream. */
entries = apr_hash_make(pool);
- SVN_ERR(svn_hash_read2(entries, stream, SVN_HASH_TERMINATOR, pool));
+ err = svn_hash_read2(entries, stream, SVN_HASH_TERMINATOR, pool);
+ if (err)
+ {
+ svn_string_t *id_str = svn_fs_fs__id_unparse(noderev->id, pool);
+
+ svn_error_clear(svn_stream_close(stream));
+ return svn_error_quick_wrapf(err,
+ _("malformed representation for node-revision '%s'"),
+ id_str->data);
+ }
SVN_ERR(svn_stream_close(stream));
/* Now check each of the entries in our directory to find new node and
Modified: subversion/branches/1.9.x/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_fs_fs/transaction.c?rev=1678854&r1=1678853&r2=1678854&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_fs_fs/transaction.c Tue May 12 04:00:20 2015
@@ -1127,6 +1127,7 @@ get_txn_proplist(apr_hash_t *proplist,
apr_pool_t *pool)
{
svn_stream_t *stream;
+ svn_error_t *err;
/* Check for issue #3696. (When we find and fix the cause, we can change
* this to an assertion.) */
@@ -1140,7 +1141,14 @@ get_txn_proplist(apr_hash_t *proplist,
pool, pool));
/* Read in the property list. */
- SVN_ERR(svn_hash_read2(proplist, stream, SVN_HASH_TERMINATOR, pool));
+ err = svn_hash_read2(proplist, stream, SVN_HASH_TERMINATOR, pool);
+ if (err)
+ {
+ svn_error_clear(svn_stream_close(stream));
+ return svn_error_quick_wrapf(err,
+ _("malformed property list in transaction '%s'"),
+ path_txn_props(fs, txn_id, pool));
+ }
return svn_stream_close(stream);
}
Modified: subversion/branches/1.9.x/subversion/libsvn_subr/hash.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.9.x/subversion/libsvn_subr/hash.c?rev=1678854&r1=1678853&r2=1678854&view=diff
==============================================================================
--- subversion/branches/1.9.x/subversion/libsvn_subr/hash.c (original)
+++ subversion/branches/1.9.x/subversion/libsvn_subr/hash.c Tue May 12 04:00:20 2015
@@ -132,7 +132,7 @@ svn_hash__read_entry(svn_hash__entry_t *
0, APR_SIZE_MAX, 10);
if (err)
return svn_error_create(SVN_ERR_MALFORMED_FILE, err,
- _("Serialized hash malformed"));
+ _("Serialized hash malformed key length"));
entry->keylen = (apr_size_t)ui64;
/* Now read that much into a buffer. */
@@ -145,19 +145,19 @@ svn_hash__read_entry(svn_hash__entry_t *
SVN_ERR(svn_stream_read_full(stream, &c, &len));
if (c != '\n')
return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
- _("Serialized hash malformed"));
+ _("Serialized hash malformed key data"));
/* Read a val length line */
SVN_ERR(svn_stream_readline(stream, &buf, "\n", &eof, pool));
if ((buf->data[0] == 'V') && (buf->data[1] == ' '))
{
- /* Get the length of the key */
+ /* Get the length of the val */
err = svn_cstring_strtoui64(&ui64, buf->data + 2,
0, APR_SIZE_MAX, 10);
if (err)
return svn_error_create(SVN_ERR_MALFORMED_FILE, err,
- _("Serialized hash malformed"));
+ _("Serialized hash malformed value length"));
entry->vallen = (apr_size_t)ui64;
entry->val = apr_palloc(pool, entry->vallen + 1);
@@ -169,7 +169,7 @@ svn_hash__read_entry(svn_hash__entry_t *
SVN_ERR(svn_stream_read_full(stream, &c, &len));
if (c != '\n')
return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
- _("Serialized hash malformed"));
+ _("Serialized hash malformed value data"));
}
else
return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
@@ -183,7 +183,7 @@ svn_hash__read_entry(svn_hash__entry_t *
0, APR_SIZE_MAX, 10);
if (err)
return svn_error_create(SVN_ERR_MALFORMED_FILE, err,
- _("Serialized hash malformed"));
+ _("Serialized hash malformed key length"));
entry->keylen = (apr_size_t)ui64;
/* Now read that much into a buffer. */
@@ -196,7 +196,7 @@ svn_hash__read_entry(svn_hash__entry_t *
SVN_ERR(svn_stream_read_full(stream, &c, &len));
if (c != '\n')
return svn_error_create(SVN_ERR_MALFORMED_FILE, NULL,
- _("Serialized hash malformed"));
+ _("Serialized hash malformed key data"));
/* Remove this hash entry. */
entry->vallen = 0;