Re: [Opalvoip-devel] Opal sample application not running
Brought to you by:
csoutheren,
rjongbloed
|
From: Rahul D. - r. <rah...@r2...> - 2020-10-27 02:51:23
|
Hi,
Posting solution for this issue so it's useful for others
PTLib was trying to lock the semaphore using the "sem_timedwait" system call. This call was always returning false on target system, possibly because it was not supported. After this system call,
PTLib tries acquiring the lock in loop which caused a deadlock kind of situation.
#ifdef P_HAS_SEMAPHORES_XPG6
// use proper timed spinlocks if supported.
// http://www.opengroup.org/onlinepubs/007904975/functions/sem_timedwait.html
struct timespec absTime;
absTime.tv_sec = finishTime.GetTimeInSeconds();
absTime.tv_nsec = finishTime.GetMicrosecond() * 1000;
PPROFILE_PRE_SYSTEM();
do {
if (sem_timedwait(GetSemPtr(), &absTime) == 0) {
PPROFILE_POST_SYSTEM();
return true;
}
} while (errno == EINTR);
PPROFILE_POST_SYSTEM();
PAssert(errno == ETIMEDOUT, strerror(errno));
#else
===================
In include/ptlib_config.h, remove defines(P_PTHREADS_XPG6 and P_HAS_SEMAPHORES_XPG6 ) and undefine both on them
#undef P_PTHREADS_XPG6
#undef P_HAS_SEMAPHORES_XPG6
Regards,
RD
From: Rahul Dhuri - r2pAU
Sent: Wednesday, 16 September 2020 3:36 PM
To: 'opa...@li...' <opa...@li...>
Subject: Opal sample application not running
Hello,
I was trying to run the sample application(regtest) provided with opal. Observing that it does not run and gets stuck with a deadlock. Was wondering if anyone else facing this issue ?
./regtest sip:test@192.168.110.60
0:15.157 RegTest:21368 osutils.cxx(4322) PTLib Assertion fail: Possible deadlock in read/write mutex 0xbfd4f0e0 (manager.h(2139),15000ms) :
thread-id=3056351936 (0xb62c3ac0), unique-id=21368, readers=0, writers=1
/home/openaccess/tmp/opalvoip/ptlib/_install/lib/libpt.so.2.18-beta5(PPlatformWalkStack(std::ostream&, unsigned long, int, unsigned int, bool)+0xba) [0xb69dcada]
/home/openaccess/tmp/opalvoip/ptlib/_install/lib/libpt.so.2.18-beta5(PTrace::WalkStack(std::ostream&, unsigned long, int, bool)+0x50) [0xb69f73d0]
/home/openaccess/tmp/opalvoip/ptlib/_install/lib/libpt.so.2.18-beta5(PReadWriteMutex::InternalWait(PReadWriteMutex::Nest&, PSync&, PDebugLocation const&) const+0x397) [0xb69c1bf7]
/home/openaccess/tmp/opalvoip/ptlib/_install/lib/libpt.so.2.18-beta5(PReadWriteMutex::InternalStartWriteWithNest(PReadWriteMutex::Nest&, PDebugLocation const&)+0x9d) [0xb69c20ad]
/home/openaccess/tmp/opalvoip/ptlib/_install/lib/libpt.so.2.18-beta5(PReadWriteMutex::InternalStartWrite(PDebugLocation const*)+0x6e) [0xb69c211e]
/home/openaccess/tmp/opalvoip/opal/_install/lib/libopal.so.3.18.4(OpalManager::AttachEndPoint(OpalEndPoint*, PString const&)+0x9f) [0xb6e47e9f]
/home/openaccess/tmp/opalvoip/opal/_install/lib/libopal.so.3.18.4(OpalEndPoint::OpalEndPoint(OpalManager&, PCaselessString const&, PBitwiseEnum<OpalEndPoint::Attributes_Bits, (OpalEndPoint::Attributes_Bits)2, unsigned int>)+0x2b9) [0xb6e61099]
/home/openaccess/tmp/opalvoip/opal/_install/lib/libopal.so.3.18.4(OpalRTPEndPoint::OpalRTPEndPoint(OpalManager&, PCaselessString const&, PBitwiseEnum<OpalEndPoint::Attributes_Bits, (OpalEndPoint::Attributes_Bits)2, unsigned int>)+0x3c) [0xb6f0ec9c]
/home/openaccess/tmp/opalvoip/opal/_install/lib/libopal.so.3.18.4(OpalSDPEndPoint::OpalSDPEndPoint(OpalManager&, PCaselessString const&, PBitwiseEnum<OpalEndPoint::Attributes_Bits, (OpalEndPoint::Attributes_Bits)2, unsigned int>)+0x3c) [0xb7358f2c]
/home/openaccess/tmp/opalvoip/opal/_install/lib/libopal.so.3.18.4(SIPEndPoint::SIPEndPoint(OpalManager&, unsigned int)+0x5e) [0xb738ec3e]
./regtest(RegTest::Main()+0x176) [0x8052c76]
/home/openaccess/tmp/opalvoip/ptlib/_install/lib/libpt.so.2.18-beta5(PProcess::InternalMain(void*)+0x38) [0xb69bcb38]
./regtest(main
/lib/i386-linux-gnu/libc.so.6(__libc_start_main
./regtest() [0x8051b65]
^C 3:12.494 PTLib Housekeeper:21372 osutils.cxx(3048) PTLib Process "RegTest" terminating without clean up!
Details:
PTLIB version : 2.18.4
Opal version : 3.18.4
PTLIB compilation : (./configure --build=i686-pc-linux-gnu CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 --enable-debug --disable-shared --disable-video --disable-openssl --disable-openldap --prefix=`pwd`/_install)
Opal compilation : (./configure --build=i686-pc-linux-gnu CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 --enable-debug --disable-shared --disable-openssl --prefix=`pwd`/_install --disable-srtp --enable-samples )
It was compiled on a 64 bit and running it on 32 bit machine, seeing same issue with other sample applications of opal.
Regards,
RD
|