Re: svn commit: r1544027 - /subversion/trunk/subversion/libsvn_subr/object_pool.c
You can't just write an error to stderr and exit *in a library*. That function is (like SVN_INT) only for command line applications.
On Windows your application will just disappear if this code is reached. Please use the standard malfunction handling in this case, as then applications have at least the option of showing what happened. They could crash while showing the error, but at least it is not by default not showing anything.
Sent from Windows Mail
From: Stefan Fuhrmann
Sent: Thursday, November 21, 2013 4:57 AM
Date: Thu Nov 21 03:57:12 2013
New Revision: 1544027
If we cannot synchronize data access in an APR pool cleanup function,
there is not much we can do except to log the error and to terminate.
Do that in the object pool code.
(exit_on_error): new error checking function
(object_ref_cleanup): terminate upon sync failure
--- subversion/trunk/subversion/libsvn_subr/object_pool.c (original)
+++ subversion/trunk/subversion/libsvn_subr/object_pool.c Thu Nov 21 03:57:12 2013
@@ -229,6 +229,15 @@ remove_unused_objects(svn_object_pool__t
object_pool->objects_hash_pool = new_pool;
+/* If ERR is not 0, handle it and terminate the application.
+ if (err)
+ svn_handle_error2(err, stderr, TRUE, "svn: ");
/* Cleanup function called when an object_ref_t gets released.
@@ -256,7 +265,8 @@ object_ref_cleanup(void *baton)
+ /* begin critical section */
/* put back into "available" container */
@@ -275,7 +285,8 @@ object_ref_cleanup(void *baton)
- SVN_INT_ERR(svn_mutex__unlock(object_pool->mutex, NULL));
+ /* end critical section */
+ exit_on_error(svn_error_trace(svn_mutex__unlock(object_pool->mutex, NULL)));
/* Maintain reference counters and handle object cleanup */
if (svn_atomic_dec(&object->ref_count) == 0)
Received on 2013-11-21 10:50:26 CET
This is an archived mail posted to the Subversion Dev