This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bug in libffi with selinux and a fork


Le mardi 27 octobre 2009 14:18:22, Jakub Jelinek a écrit :
> Unfortunately pthread_atfork is -lpthread only thing (and when using
>  threads any use of libffi APIs in the child would be invalid anyway), so
>  perhaps closures.c should record the pid of the current process and if it
>  notices a different pid, it should reinitialize all its global variables
>  to make sure the file isn't shared nor the mappings.

In my library Hasad, I'm also storing the pid to support other thread 
implementations than pthread. I check the pid for each operation using the 
object (read or write access) (explicit check using a macro). It doesn't mean 
that *all* functions check the pid.

-- 
Victor Stinner
http://www.haypocalc.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]