lyind opened a new pull request #257: GUACAMOLE-958: Avoid race/deadlock in 
guacd_timed_client_free()
URL: https://github.com/apache/guacamole-server/pull/257
 
 
   Fix for GUACAMOLE-958.
   
   Two separate problems:
   
   1. Race condition may lead to unwarranted wait and then timeout:
   `guacd_timed_client_free()` raced with `guacd_client_free_thread()` for 
signalling on `free_operation.completed_cond`
   
   2. Potential deadlock/hang of the thread `client_free_thread` if 
`pthread_cond_timedwait()` failed early or `guacd_client_free_thread()` took 
longer to reach it's signalling part than the timeout. The reason is that 
`pthread_cond_timedwait()` re-acquires the mutex before returning 0 or 
ETIMEDOUT and doesn't ever release it on other errors. Please refer to the man 
page.
   
   Reference:
   http://man7.org/linux/man-pages/man3/pthread_cond_timedwait.3p.html
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to