Print

Print


Here is another case where it is more clear:

```

(gdb) thread 251
[Switching to thread 251 (Thread 0x2ad501d36940 (LWP 11329))]#0  0x0000003d6640d654 in __lll_lock_wait () from /lib64/libpthread.so.0
(gdb) where
#0  0x0000003d6640d654 in __lll_lock_wait () from /lib64/libpthread.so.0
#1  0x0000003d66408f65 in _L_lock_1127 () from /lib64/libpthread.so.0
#2  0x0000003d66408e63 in pthread_mutex_lock () from /lib64/libpthread.so.0
#3  0x0000003dec42211c in Lock (this=0x2ad4f941d180, cP=0x80) at /usr/src/debug/xrootd/xrootd/src/XrdSys/XrdSysPthread.hh:149
#4  XrdSysMutexHelper (this=0x2ad4f941d180, cP=0x80) at /usr/src/debug/xrootd/xrootd/src/XrdSys/XrdSysPthread.hh:208
#5  XrdSys::IOEvents::Poller::TmoAdd (this=0x2ad4f941d180, cP=0x80) at /usr/src/debug/xrootd/xrootd/src/XrdSys/XrdSysIOEvents.cc:965
#6  0x0000003dec42300a in XrdSys::IOEvents::Channel::Enable (this=0x2ad4f6cfde20, events=<value optimized out>, timeout=1, eText=0x2ad501d35768)
    at /usr/src/debug/xrootd/xrootd/src/XrdSys/XrdSysIOEvents.cc:373
#7  0x0000003ded035293 in XrdCl::PollerBuiltIn::EnableWriteNotification (this=<value optimized out>, socket=0x2ad4fb62b580, notify=<value optimized out>, timeout=1)
    at /usr/src/debug/xrootd/xrootd/src/XrdCl/XrdClPollerBuiltIn.cc:404
#8  0x0000003ded03b423 in EnableUplink (this=0x2ad4fb60fc80, path=...) at /usr/src/debug/xrootd/xrootd/src/XrdCl/XrdClAsyncSocketHandler.hh:96
#9  XrdCl::Stream::EnableLink (this=0x2ad4fb60fc80, path=...) at /usr/src/debug/xrootd/xrootd/src/XrdCl/XrdClStream.cc:186
#10 0x0000003ded03b729 in XrdCl::Stream::Send (this=0x2ad4fb60fc80, msg=0x2ad4fbe3a700, handler=0x2ad4fbc20d88, stateful=true, expires=1365672412)
    at /usr/src/debug/xrootd/xrootd/src/XrdCl/XrdClStream.cc:273
#11 0x0000003ded037ede in XrdCl::Channel::Send (this=0x2ad4fb60fb40, msg=0x2ad4fbe3a700, handler=0x2ad4fbc20d88, stateful=true, expires=1365672412)
    at /usr/src/debug/xrootd/xrootd/src/XrdCl/XrdClChannel.cc:266
#12 0x0000003ded03739e in XrdCl::PostMaster::Send (this=<value optimized out>, url=<value optimized out>, msg=0x2ad4fbe3a700, handler=0x2ad4fbc20d88, stateful=true, expires=1365672412)
    at /usr/src/debug/xrootd/xrootd/src/XrdCl/XrdClPostMaster.cc:169
#13 0x0000003ded056f10 in XrdCl::MessageUtils::SendMessage (url=..., msg=0x2ad4fbe3a700, handler=<value optimized out>, sendParams=...) at /usr/src/debug/xrootd/xrootd/src/XrdCl/XrdClMessageUtils.cc:109
#14 0x0000003ded060836 in XrdCl::FileStateHandler::SendOrQueue (this=0x2ad4fb60f280, url=<value optimized out>, msg=0x2ad4fbe3a700, handler=0x2ad4fbc2b1a0, sendParams=...)
    at /usr/src/debug/xrootd/xrootd/src/XrdCl/XrdClFileStateHandler.cc:1129
#15 0x0000003ded062716 in XrdCl::FileStateHandler::Stat (this=0x2ad4fb60f280, force=<value optimized out>, handler=0x2ad501d35f00, timeout=0)
    at /usr/src/debug/xrootd/xrootd/src/XrdCl/XrdClFileStateHandler.cc:496
#16 0x0000003ded059904 in XrdCl::File::Stat (this=<value optimized out>, force=false, handler=0xffffffffffffffff, timeout=53752) at /usr/src/debug/xrootd/xrootd/src/XrdCl/XrdClFile.cc:103
#17 0x0000003ded05a58e in XrdCl::File::Stat (this=0x2ad4f6c0f710, force=true, response=@0x2ad501d36020, timeout=0) at /usr/src/debug/xrootd/xrootd/src/XrdCl/XrdClFile.cc:114
#18 0x00002ad4f72aa299 in XrdMqClient::RecvMessage (this=0x2ad4f75fdca0) at /usr/src/debug/eos-0.3.0-1/mq/XrdMqClient.cc:304
#19 0x00002ad4f70874f8 in eos::mgm::Messaging::Listen (this=0x2ad4f61cdf80) at /usr/src/debug/eos-0.3.0-1/mgm/Messaging.cc:185
#20 0x00002ad4f72b0b29 in XrdMqMessaging::Start (pp=<value optimized out>) at /usr/src/debug/eos-0.3.0-1/mq/XrdMqMessaging.cc:35
#21 0x0000003dec41fc2f in XrdSysThread_Xeq (myargs=<value optimized out>) at /usr/src/debug/xrootd/xrootd/src/XrdSys/XrdSysPthread.cc:86
#22 0x0000003d6640683d in start_thread () from /lib64/libpthread.so.0
#23 0x0000003d65cd503d in clone () from /lib64/libc.so.6

(gdb) frame 3
(gdb) print *this
$7 = {cs = {__data = {__lock = 2, __count = 1, __owner = 11305, __nusers = 1, __kind = 1, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
    __size = "\002\000\000\000\001\000\000\000),\000\000\001\000\000\000\001", '\000' <repeats 22 times>, __align = 4294967298}}

Now looking at the owner of the lock (which in this case still exists)

(gdb) thread 253
[Switching to thread 253 (Thread 0x2ad4f9302940 (LWP 11305))]#0  0x0000003d6640d654 in __lll_lock_wait () from /lib64/libpthread.so.0
(gdb) where
#0  0x0000003d6640d654 in __lll_lock_wait () from /lib64/libpthread.so.0
#1  0x0000003d66408f65 in _L_lock_1127 () from /lib64/libpthread.so.0
#2  0x0000003d66408e63 in pthread_mutex_lock () from /lib64/libpthread.so.0
#3  0x0000003dec422637 in Lock (this=0x2ad4f941d180, cP=0x2ad4f6cfde20, events=<value optimized out>, eNum=0, eTxt=0x0) at /usr/src/debug/xrootd/xrootd/src/XrdSys/XrdSysPthread.hh:149
#4  Lock (this=0x2ad4f941d180, cP=0x2ad4f6cfde20, events=<value optimized out>, eNum=0, eTxt=0x0) at /usr/src/debug/xrootd/xrootd/src/XrdSys/XrdSysPthread.hh:197
#5  XrdSys::IOEvents::Poller::CbkXeq (this=0x2ad4f941d180, cP=0x2ad4f6cfde20, events=<value optimized out>, eNum=0, eTxt=0x0) at /usr/src/debug/xrootd/xrootd/src/XrdSys/XrdSysIOEvents.cc:626
#6  0x0000003dec42286c in XrdSys::IOEvents::Poller::CbkTMO (this=0x2ad4f941d180) at /usr/src/debug/xrootd/xrootd/src/XrdSys/XrdSysIOEvents.cc:548
#7  0x0000003dec4229bb in XrdSys::IOEvents::PollE::Begin (this=0x2ad4f941d180, syncsem=<value optimized out>, retcode=<value optimized out>, eTxt=<value optimized out>)
    at /usr/src/debug/xrootd/xrootd/src/XrdSys/XrdSysIOEventsPollE.icc:202
#8  0x0000003dec421aa4 in XrdSys::IOEvents::BootStrap::Start (parg=0x2ad4f90ff2e0) at /usr/src/debug/xrootd/xrootd/src/XrdSys/XrdSysIOEvents.cc:110
#9  0x0000003dec41fc2f in XrdSysThread_Xeq (myargs=<value optimized out>) at /usr/src/debug/xrootd/xrootd/src/XrdSys/XrdSysPthread.cc:86
#10 0x0000003d6640683d in start_thread () from /lib64/libpthread.so.0
#11 0x0000003d65cd503d in clone () from /lib64/libc.so.6

Even the owner wants to lock the same thing again .... look's like a reentrant lock ...

```



---
Reply to this email directly or view it on GitHub:
https://github.com/xrootd/xrootd/issues/4#issuecomment-16284963

########################################################################
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