[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: [PATCH] svn_dso_initialize can *silently* fail to create lock

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: Sat, 2 Aug 2008 00:27:19 +0530

Thanks Stefan for the review, committed at r32353.

>Looks good to me.

>A curiosity: The return value of apr_thread_mutex_create is
>not checked consistently even within APR itself.

>Have you seen crashes because of this
>In apr-1.3.2, the function can only return an error it if fails
>to allocate memory (at least the way we're calling it with
>APR_THREAD_MUTEX_DEFAULT). Anyway, checking the error code is a good
>idea. We don't want to rely on implementation details like that.

I did see the crash with apr-0.9.x(I think 0.9.12)

In my local box(apr-1.2.12) I could see 'apr_thread_mutex_create' handling error properly.
<snip>
        rv = pthread_mutex_init(&new_mutex->mutex, NULL);

    if (rv) {
#ifdef PTHREAD_SETS_ERRNO
        rv = errno;
#endif
        return rv;
    }
</snip>

>I would suggest using

> SVN_ERR_ASSERT(status == APR_SUCCESS);

It will give a compiler warning as the caller here is a void function and SVN_ERR_ASSERT would evaluate to 'return svn_error_t *'.

With regards
Kamesh Jayachandran
Received on 2008-08-01 20:57:35 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.