ywkaras commented on issue #10129: URL: https://github.com/apache/trafficserver/issues/10129#issuecomment-1662917787
OK, here's my guess #2 of what the problem scenario is: 1. While it has a mutex M locked, a function F makes a call that can trigger the initialization of a thread_local variable. 2. F is called during the non-local dynamic initialization of a shared library S. It appears to be the case that the runtime has an implicit mutex MS, which is locked during while any shared library is being dynamically loaded, **or** a thread_local variable is being initialized. It seems MS is kept locked during the non-local initialization of the library being loaded. 3. F is also called from the core executable, and there is a race condition between this/these calls for F, and the loading of S. The deadlock scenario is: 1. Thread T1 locks MS, starts loading S. 2. Thread T2 calls F, and locks M. T2 then blocks on MS, because it needs to initialize a thread_local variable. 3. T1, after calling F, blocks on M. Deadlock. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
