Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » Segmentation Fault Issue
Segmentation Fault Issue [message #1015622] Fri, 01 March 2013 12:39 Go to next message
Ajar Behari is currently offline Ajar BehariFriend
Messages: 2
Registered: March 2013
Junior Member
Trying to port MQTT C Async example to Beaglebone using example code provided here:
http://www.eclipse.org/paho/files/mqttdoc/Casync/publish.html. I am able to run the publish example and connect to RSMB and relay a message to connected IA92 client.

The problem is that when there is no ethernet cable connected the program crashes with a segmentation fault which seems to be triggered by a Thread_lockmutex call in MQTTAsync_create function. Can you provide a hint what might be causing this crash.







Re: Segmentation Fault Issue [message #1015653 is a reply to message #1015622] Fri, 01 March 2013 14:31 Go to previous messageGo to next message
Ian Craggs is currently offline Ian CraggsFriend
Messages: 16
Registered: March 2013
Junior Member
The problem is that the code for onConnectFailure is:
void onConnectFailure(void* context, MQTTAsync_failureData* response)
{
  printf("Connect failed, rc %d\n", response->code);
  finished = 1;
}


but response in this case is NULL because we have no Connack return code from the server. Changing the sample code to:

void onConnectFailure(void* context, MQTTAsync_failureData* response)
{
  printf("Connect failed, rc %d\n", response ? response->code : 0);
  finished = 1;
}


avoids the problem. I'll update the sample
Re: Segmentation Fault Issue [message #1015966 is a reply to message #1015653] Mon, 04 March 2013 12:43 Go to previous message
Ajar Behari is currently offline Ajar BehariFriend
Messages: 2
Registered: March 2013
Junior Member
Thanks Ian , this change solved the segmentation fault issue at the point of Ethernet connection removed. I was able to test subscribe function also and receive messages.

However the re-connection of client to broker in case of Ethernet connection resuming was still an issue :

Case A : The Ethernet cable was removed during a active MQTT session. RSMB detected client connection lost correctly after 20 seconds MQTT timeout. However there was no callback to connlost function on client end. Is there an implementation to detect MQTT ping failure on client end ?

Hope you can give some pointers on above test case. Thanks in advance.













[Updated on: Tue, 05 March 2013 05:51]

Report message to a moderator

Previous Topic:Paho SSL with pre-shared key
Next Topic:publish exception issue
Goto Forum:
  


Current Time: Fri Nov 28 00:40:20 GMT 2014

Powered by FUDForum. Page generated in 0.09172 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software