Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Locate Segfault(Finding FB which caused Segmentation Fault)
Locate Segfault [message #1833399] Mon, 12 October 2020 11:03 Go to next message
Mario Krizic is currently offline Mario KrizicFriend
Messages: 38
Registered: April 2019
Member
Hello,

I have recently added a few FBs throughout my application, mostly Publish Blocks sending values of the Sensors and Motors used in my Application.

Now it sometimes happens that I get a Segmentation fault, but I don't know which FB is causing it as there is no further info in the console or log.

Is there a way to locate the cause of the error other than trying out different things while monitoring the application?

Thank you in advance,

Mario
Re: Locate Segfault [message #1833400 is a reply to message #1833399] Mon, 12 October 2020 11:12 Go to previous messageGo to next message
Martin Melik-Merkumians is currently offline Martin Melik-MerkumiansFriend
Messages: 99
Registered: March 2016
Member
Hi,

start FORTE with a debugger. It should stop at the segfault and then you have to inspect the stack trace to locate where it is happening.

Best regards,
Martin
Re: Locate Segfault [message #1833401 is a reply to message #1833400] Mon, 12 October 2020 11:35 Go to previous messageGo to next message
Mario Krizic is currently offline Mario KrizicFriend
Messages: 38
Registered: April 2019
Member
Hello Martin,

Is there a guide how to do that on a remote device? My application is running on a Lego EV3 Brick and I communicate using SSH.

Best Regards,

Mario
Re: Locate Segfault [message #1833403 is a reply to message #1833401] Mon, 12 October 2020 11:52 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member
Hi Mario,

I use this tool from eclipse that allows to debug remotely. It can be tricky to set up, but once everything is correct, it's really like a regular local debugger:

https://marketplace.eclipse.org/content/direct-remote-c-debugging

I assume that since you're using the EV3, then probably the error is in the code related to it. If you could reduce the amount of FBs or features you're using, then the bad code will be easier to find.
Re: Locate Segfault [message #1833404 is a reply to message #1833403] Mon, 12 October 2020 12:18 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1209
Registered: January 2014
Senior Member
as EV3 is linux the simplest would be to have gdb there. If you have a gdb there you could run forte with gdb forte and then press -r on the command line. On segfaults the debugger should give you a stack trace which can help to trace back the issue.
Re: Locate Segfault [message #1833405 is a reply to message #1833403] Mon, 12 October 2020 12:34 Go to previous message
Mario Krizic is currently offline Mario KrizicFriend
Messages: 38
Registered: April 2019
Member
Thank you, I will give it a try
Previous Topic:4DIAC IDE Preferences - show full value of ID
Next Topic:Custom CLIENT FB with additional SDs
Goto Forum:
  


Current Time: Wed May 05 23:07:59 GMT 2021

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

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

Back to the top