Thanks for reporting it!

An analysis (so we don't need to go through the back traces over and over again):

Thread1:

Calls the object finallizer: XrdCl::DefaultEnv::Finalize,
which in turn calls XrdCl::PostMaster::Stop -> XrdCl:: PollerBuiltIn:: Stop,

at that point the XrdCl::PollerBuiltIn::pMutex gets locked,

then we continue up the stack until XrdSys::IOEvents::Poller::SendCmd,
where a semaphore is being created and sent through a pipe as part of PipeData struct, and than the
XrdSysSemaphore::Wiat() routine is being called, at that point Thread1 gets stuck.

Thread3:

The XrdSys::IOEvents::PollE::Begin calls the XrdSys::IOEvents::Poller::TmoGet routine that is suppose to provide the timeout value for epoll_wait.

If we go up the stack we will reach XrdCl::PollerBuiltIn::RemoveSocket, where Thread3 tries to lock XrdCl::PollerBuiltIn::pMutex, at that point Thread3 gets stuck (the mutex was previously locked by Thread1).

Few lines under the XrdSys::IOEvents::Poller::TmoGet, Thread3 calls XrdSys::IOEvents::PollE::Process, which retrieves the PipeData struct, and posts the semaphore Thread1 is waiting for. However Thread3 never gets there, because it is waiting for a mutex that has been locked by Thread1.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/xrootd/xrootd","title":"xrootd/xrootd","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/xrootd/xrootd"}},"updates":{"snippets":[{"icon":"PERSON","message":"@simonmichal in #418: Thanks for reporting it!\r\n\r\nAn analysis (so we don't need to go through the back traces over and over again):\r\n\r\n**Thread1:**\r\n\r\nCalls the object finallizer: XrdCl::DefaultEnv::Finalize, \r\nwhich in turn calls XrdCl::PostMaster::Stop -\u003e XrdCl:: PollerBuiltIn:: Stop,\r\n\r\nat that point the **XrdCl::PollerBuiltIn::pMutex** gets locked,\r\n\r\nthen we continue up the stack until XrdSys::IOEvents::Poller::SendCmd,\r\nwhere a semaphore is being created and sent through a pipe as part of PipeData struct, and than the\r\n**XrdSysSemaphore::Wiat()** routine is being called, at that point Thread1 gets stuck.\r\n\r\n\r\n**Thread3:**\r\n\r\nThe XrdSys::IOEvents::PollE::Begin calls the XrdSys::IOEvents::Poller::TmoGet routine that is suppose to provide the timeout value for epoll_wait.\r\n\r\nIf we go up the stack we will reach XrdCl::PollerBuiltIn::RemoveSocket, where Thread3 tries to lock **XrdCl::PollerBuiltIn::pMutex**, at that point Thread3 gets stuck (the mutex was previously locked by Thread1).\r\n\r\nFew lines under the XrdSys::IOEvents::Poller::TmoGet, Thread3 calls XrdSys::IOEvents::PollE::Process, which retrieves the PipeData struct, and posts the semaphore Thread1 is waiting for. However Thread3 never gets there, because it is waiting for a mutex that has been locked by Thread1.\r\n\r\n\r\n\r\n"}],"action":{"name":"View Issue","url":"https://github.com/xrootd/xrootd/issues/418#issuecomment-248855290"}}}

Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1