Subject: pose: deadlock when doing hotsync through pesudo tty
Package: pose
Version: 3.5-1
Severity: normal
Tags: fixed
when doing hotsync between ptyqe/ttyqe with pilot-xfer, POSE sometimes
hang up and stop responding.
from the source code, SrcUnix/EmTransportSerialUnix.cpp line 1059,
function "CommWrite" (running as a thread):
This->fDataCondition.wait ();
this line will wait and can be wake-up by "fDataCondition.broadcast
()" (same file, line 749, function "PutOutgoingData") of another thread,
before wake up, "fDataCondition.wait ()" (actually is
"pthread_cond_wait" under linux) will re-acquires "fDataMutex".
if thread "CommWrite" wake up immediately after
"fDataCondition.broadcast ()", everything goes fine. Otherwise, if it
wake up just before "fDataMutex.lock ()" of the next "PutOutgoingData"
call, "PutOutgoingData" will stop and wait "fDataMutex" to be release
because it is locked by thread "CommWrite".
After thread "CommWrite" wake up, it will call "OutgoingDataSize" and
"GetOutgoingData", all of them will try to acquare "fWriteMutex",
unfortunately, it may already be locked by "PutOutgoingData", and it is
waitting for "fDataMutex". These two threads are all waiting for others
to release its mutex, this cause the deadlock.
My simple workaround to prevent this is to remove "fDataMutex.lock ()"
and "fDataMutex.unlock ()" which around the "fDataCondition.broadcast
()"
-- System Information:
Debian Release: 3.1
APT prefers testing
APT policy: (800, 'testing'), (100, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.10-ibm.x31
Locale: LANG=zh_CN.GBK, LC_CTYPE=zh_CN.GBK (charmap=GBK)
Versions of packages pose depends on:
ii libc6 2.3.2.ds1-20 GNU C Library: Shared
libraries an
ii libfltk1 1.0.11-5 The Fast Light Toolkit, a
GUI tool
ii libstdc++2.10-glibc2.2 1:2.95.4-22 The GNU stdc++ library
ii xlibs 4.3.0.dfsg.1-10 X Keyboard Extension (XKB)
configu
-- no debconf information
--
YuLei <[EMAIL PROTECTED]>
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]