issue with fork

Stef Walter stefw at collabora.co.uk
Sun Aug 14 09:50:50 PDT 2011


On 08/14/2011 02:08 PM, Nikos Mavrogiannopoulos wrote:
> Hey Stef,
>  Concerning the issue I had with opensc being unusable with
> p11-kit in my system, I think I have identified it. It seems
> SCardEstablishContext (from libpcsclite used by opensc) starts
> a pcsc server if it is not already running and thus in my system it
> executes fork(). This causes an infinite loop of p11-kit trying to
> reinitialize the same module over and over.
> 
> The problem seems to be in reinitialize_after_fork() which
> sets the initialize_count = 0 in all modules and try to reinitialize
> them causing the loop. I don't have a quick fix but it seems it
> should only include the fully initialized modules, thus allow
> a module to include a fork() in its initialization.

Okay, I think this is fixed in master. Could you let me know if it works
for you?

I also included a test for this in the unit tests.

http://cgit.freedesktop.org/p11-glue/p11-kit/commit/?id=d4abb441450deceff760086dcdf9d493b258074a

Cheers,

Stef


More information about the p11-glue mailing list