Discussion:
[sipXtapi] SipClient task does not terminate (macosx)
Paulo Vicentini
2009-09-23 02:04:54 UTC
Permalink
Hi,

I am coping with an issue while calling sipxUnInitialize (mac os x):



stack:

OsTaskBase::delay() /sipXportLib/src/os/OsTask.cpp:122 0x001e46d8

OsTaskBase::waitUntilShutDown() /sipXportLib/src/os/OsTask.cpp:255
0x001e4f30

SipClient::~SipClient() /sipXtackLib/src/net/SipClient.cpp:140 0x0011eb76

SipUdpServer::~SipUdpServer() /sipXtackLib/src/net/SipUdpServer.cpp:247
0x00184228

SipUserAgent::~SipUserAgent() /sipXtackLib/src/net/SipUserAgent.cpp:457
0x0018a7f8

sipxUnInitialize() /sipXcallLib/src/tapi/sipXtapi.cpp:692 0x0004fe67


pClient-6 failed to terminate after 16.000000 seconds"

"2009-09-23T01:05:13.998085Z":838:KERNEL:WARNING:Macintosh.local::00000000:sipXtapi:"Task:
SipClient-6 failed to terminate after 17.000000 seconds"

"2009-09-23T01:05:14.998147Z":839:KERNEL:WARNING:Macintosh.local::00000000:sipXtapi:"Task:
SipClient-6 failed to terminate after 18.000000 seconds"

"2009-09-23T01:05:15.998289Z":840:KERNEL:WARNING:Macintosh.local::00000000:sipXtapi:"Task:
SipClient-6 failed to terminate after 19.000000 seconds"

"2009-09-23T01:05:26.514896Z":841:KERNEL:ERR:Macintosh.local::00000000:sipXtapi:"Task:
SipClient-6 failed to terminate after 20.000000 seconds"

"2009-09-23T01:05:38.981677Z":842:KERNEL:ERR:Macintosh.local::00000000:sipXtapi:"Task:
SipClient-6 failed to terminate, waiting..."

"2009-09-23T01:11:21.804683Z":843:KERNEL:ERR:Macintosh.local::00000000:sipXtapi:"Task:
SipClient-6 failed to terminate, waiting..."




SipClient::~SipClient()

...

...

if(isStarted() || isShuttingDown())

{

#ifdef TEST_PRINT

osPrintf("SipClient::~SipClient waitUntilShutDown\n");

#endif

waitUntilShutDown();


---->

UtlBoolean OsTaskBase::waitUntilShutDown(int milliSecToWait)

{

// If task is already shut down, just return.

if (isShutDown()) ---->>>RETURN FALSE (SHUTTING_DOWN != SHUT_DOWN)

return TRUE;

....

.....

// wait up to another nineteen seconds (20 total) for the task to terminate

// printing out a console complaint every second

if (isShuttingDown())

{....


// Do not exit if not shut down

while (isShuttingDown())

{

OsSysLog::add(FAC_KERNEL, PRI_ERR, "Task: %s failed to terminate,
waiting...",

taskName.data());

delay(300000);


/********************/

I will try to find out what is preventing SipClient task to return from its
run method

Do you have any suggestion?


Thanks


Paulo
Paulo Vicentini
2009-09-25 21:57:40 UTC
Permalink
It seems that the blocked poll (-1) is not returning after shutting down the
socket so that SipClient does not exit from its run method.
I made a test putting a timeout while calling isReadyToReady(15000) and
SipClient returned since poll had returned too due timeout
OsSocket::close()
...
...
// This forces any selects which are blocked on
// this socket to return
shutdown(tempSocketDescriptor, SHUT_RDWR);
It seems this is not the case with mac os x
What do you say about that?

Thanks
Paulo
Post by Paulo Vicentini
Hi,
OsTaskBase::delay() /sipXportLib/src/os/OsTask.cpp:122 0x001e46d8
OsTaskBase::waitUntilShutDown() /sipXportLib/src/os/OsTask.cpp:255
0x001e4f30
SipClient::~SipClient() /sipXtackLib/src/net/SipClient.cpp:140 0x0011eb76
SipUdpServer::~SipUdpServer() /sipXtackLib/src/net/SipUdpServer.cpp:247
0x00184228
SipUserAgent::~SipUserAgent() /sipXtackLib/src/net/SipUserAgent.cpp:457
0x0018a7f8
sipxUnInitialize() /sipXcallLib/src/tapi/sipXtapi.cpp:692 0x0004fe67
pClient-6 failed to terminate after 16.000000 seconds"
SipClient-6 failed to terminate after 17.000000 seconds"
SipClient-6 failed to terminate after 18.000000 seconds"
SipClient-6 failed to terminate after 19.000000 seconds"
SipClient-6 failed to terminate after 20.000000 seconds"
SipClient-6 failed to terminate, waiting..."
SipClient-6 failed to terminate, waiting..."
SipClient::~SipClient()
...
...
if(isStarted() || isShuttingDown())
{
#ifdef TEST_PRINT
osPrintf("SipClient::~SipClient waitUntilShutDown\n");
#endif
waitUntilShutDown();
---->
UtlBoolean OsTaskBase::waitUntilShutDown(int milliSecToWait)
{
// If task is already shut down, just return.
if (isShutDown()) ---->>>RETURN FALSE (SHUTTING_DOWN != SHUT_DOWN)
return TRUE;
....
.....
// wait up to another nineteen seconds (20 total) for the task to terminate
// printing out a console complaint every second
if (isShuttingDown())
{....
// Do not exit if not shut down
while (isShuttingDown())
{
OsSysLog::add(FAC_KERNEL, PRI_ERR, "Task: %s failed to terminate,
waiting...",
taskName.data());
delay(300000);
/********************/
I will try to find out what is preventing SipClient task to return from its
run method
Do you have any suggestion?
Thanks
Paulo
Loading...