Stuart Henderson wrote:
> On 2015/02/24 10:48, Ted Unangst wrote:
> > 
> > I don't know what's going on here, but I'll note that rthread_atfork.c 
> > hasn't
> > changed since before 5.5.
> 
> What changed is p11-kit's atfork handler. Reverting this commit
> fixes AGI in asterisk. (URL here, their diff inline below).


> --- a/common/library.c
> +++ b/common/library.c
> @@ -111,6 +120,8 @@ p11_library_init_impl (void)
>       p11_mutex_init (&p11_library_mutex);
>       pthread_key_create (&thread_local, free);
>       p11_message_storage = thread_local_message;
> +
> +     pthread_atfork (NULL, NULL, count_forks);

> --- a/p11-kit/modules.c
> +++ b/p11-kit/modules.c
> @@ -719,9 +695,6 @@ init_globals_unlocked (void)
>       if (once)
>               return CKR_OK;
>  
> -#ifdef OS_UNIX
> -     pthread_atfork (NULL, NULL, reinitialize_after_fork);
> -#endif

Reading the tea leaves, I'm guessing the first function, where pthread_atfork
lives now, is called immediately after dlopen(), whereas the second function
was only called if you actually used the library.

Moving the call back to where it used to be may work, but I'm not especially
experienced with interpreting these particular leaves.

Reply via email to