Assert in send() throws exception

RCF support and general discussion.
Post Reply
ariel443
Posts: 3
Joined: Sun Aug 09, 2015 2:47 pm

Assert in send() throws exception

Post by ariel443 »

Hello,

We use RCF for communication between a client process that contains multiple RCF objects (object pool, one object per server) to servers that are separate processes all running on the same machine. All communication is synchronous, TCP based. There are both client->server calls and callbacks. Occasionally, in client->server calls an ASSERT condition is raised, maybe once every 5-10K sessions, for a reference, as follows:

File: RCF\src\RCF\ConnectionOrientedClientTransport.cpp
Method: ConnectionOrientedClientTransport::send()
This line throws an exception (366): RCF_ASSERT(mAsync);

All the rest works rather smooth. Any suggestions on how to solve/debug this? What other info could be helpful?

Thanks,
Ariel

jarl
Posts: 238
Joined: Mon Oct 03, 2011 4:53 am
Contact:

Re: Assert in send() throws exception

Post by jarl »

Hi Ariel,

Can you send us a stack trace of the ASSERT?

Is your client process multithreaded? If so you'll need to make sure that only one thread at a time is using any given RcfClient<> object.
Kind Regards

Jarl Lindrud
Delta V Software
http://www.deltavsoft.com

ariel443
Posts: 3
Joined: Sun Aug 09, 2015 2:47 pm

Re: Assert in send() throws exception

Post by ariel443 »

Hi Jarl,

No, the process that implements the clients' side is not multithreaded (we use a message queue in a single process) and each client object has its own RcfClient object. Next time I'm able to reproduce the problem I'll send you the stack trace.
Here's my somewhat more detailed understanding of what happens there:

1. Before a send/receive call, a timeout parameter is passed (say 2000) since we use synchronous operation. I could see this passed correctly in the stack trace inside RCF module.
2. Then in ClientStub::beginReceive()/beginSend() methods there is a timeout calculation:
unsigned int timeoutMs = generateTimeoutMs(mEndTimeMs);
It appears that in a loaded system (or due to some bug) it sometimes returns 0 (might be the time has actually passed, I can't tell).
3. Then, since we use synchronous operation in ConnectionOrientedClientTransport::send() AND the timeout is 0,
this line throws an exception (366): RCF_ASSERT(mAsync);

Please let me know if this makes any sense to you and if you need more information or can provide some other advice.

Regards,
Ariel

jarl
Posts: 238
Joined: Mon Oct 03, 2011 4:53 am
Contact:

Re: Assert in send() throws exception

Post by jarl »

I was eventually able to reproduce this... The assert is faulty - you can comment it out and rebuild, and it should be fine.
Kind Regards

Jarl Lindrud
Delta V Software
http://www.deltavsoft.com

ariel443
Posts: 3
Joined: Sun Aug 09, 2015 2:47 pm

Re: Assert in send() throws exception

Post by ariel443 »

Ok, thanks!

Post Reply