New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USE_RWLOCK option freeze with multi-fork software #5376
Comments
Thank your for taking the time to report this issue. Could you please provide some more details to help analyzing the problem?
|
I use Linux (Debian - kernel 4.10.15) with the OpenSSL version 1.1.0f (25 May 2017).
My application used the RAND_bytes function to generate a transaction ID.
In fact, all my forks using this function can be block if the pthread_rwlock_wrlock function is called at the same time (withtout an initialisation with PTHREAD_PROCESS_SHARED attribute). https://linux.die.net/man/3/pthread_mutexattr_init
|
Can you read the commit message for commit 63ab5ea and confirm which of the enumerated cases your application fits into? I fear that it sounds like you are in case (4), which is basically hopeless to attempt to support. |
Hi, |
Then good look! A quick internet search will show you that mixing threads and forks (i.e., forks without immediate exec) means looking for trouble. It is extremely hard to get everything right. Maybe you should reconsider your application design whether it is possible to stick with one of the two. Can this issue be closed now? |
Yes of course, my software use only multi-forks (like Kamailio). I don't use multi-threads in forks, but the issue is the same. In my case it is more the case(2) with 'N' forks. |
In general, OpenSSL can be used safely in case (2) without problems. However, it looks like the first sentence of the paragraph below applies.
It would be nice to know for sure whether it's a bug in your application or in OpenSSL that triggers the double lock. Could you provide us with a minimalistic compilable example that exhibits this bug? If yes, then please reopen this issue and post the code here. |
Hi,
When I used the RAND_bytes function in my software with multi-fork, this one was frozen because the pthread_rwlock_init was not initialised with PTHREAD_PROCESS_SHARED attribute.
How can I resolve this issue ?
Best regards,
crypto/threads_pthread.c:26
The text was updated successfully, but these errors were encountered: