issue with fork

Ludovic Rousseau ludovic.rousseau at gmail.com
Sun Aug 14 05:29:03 PDT 2011


Hello,

2011/8/14 Nikos Mavrogiannopoulos <nmav at gnutls.org>:
> 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.

Do you think I should change something in the way
SCardEstablishContext() from pcsc-lite does the fork?
I don't see how that could cause the problem you describe (but I have
not look at the p11-kit source code).

In a future version of pcsc-lite I plan to start the daemon using
systemd instead of a fork from SCardEstablishContext(). But I have no
date for this "improvement".

Bye

-- 
 Dr. Ludovic Rousseau


More information about the p11-glue mailing list