App crash debugging


#1

So, I have a strange problem… I’ve had to add a third party functionality to my app. And all is well, as long as I don’t run the third party thread, but when I do, something interesting happens.
A lot of the time, as the third party code runs (in a spawned thread), it sends off a bunch of information to an outside source, and then about 1 minute later (or sometimes less) the thread crashes. When it does, it’s always off in the weeds, so the printed crash info isn’t very useful (at least as far as I can tell) other than it’s accessing an illegal address.
The thing is, sometimes I can just clean my app and recompile and the crash no longer appears. Sometimes, I just have to recompile and it works. And sometimes I have to rebuild it into the full Legato section (I have a customized version of Legato that doesn’t contain all the default apps). And when I do this sometimes it just works without any other issues. But sometimes, it will restart my app after the crash and usually within 3 times of crashing, it miraculously starts working, and runs exactly like it’s supposed to. I’ve had it run overnight and over a weekend with no issues. I’ve tried debugging, but all I get is the debugger breaking when it accesses the illegal address, which again isn’t telling me anything.

Is there anyway that I can track this down? Or can someone explain why it’s consistently crashing but after the Legato system restarts my app a few times it starts working? Like it got more memory or stacksize?

Thanks!


#2

Hi @EvetsMostel,
Is it possible for you to provide the application with the third party feature? So that we can try and check on our side also.

Also please provide module which you are using, firmware version , legato -AF version and any other details.

Regards,
Muralidhara N.


#3

Unfortunately, I due to legal reasons, I can’t post it to a public forum.
I am using a WP7601-1, currently version R10.1 of Legato and the modem and MCU. The Yocto Linux version is still what it was with R9, as I haven’t recompiled that yet with our changes. I was using R9 when I posted this as R10.1 just came out this week.
Generally, when I do a clean and rebuild of the Legato system (with some apps removed and my apps added), it doesn’t crash anymore. At that point, I can make some small changes to my app and recompile the Legato system, it will work most of the time. Sometimes it will restart my app a couple of times before it will run without crashing. If I make more significant changes, like add a new class, even a small one, it will crash consistently. If I then clean and rebuild Legato it always seems to work.


#4

Hi @EvetsMostel,
So you are using legato-AF, modem, MCU of R10.1 and yocto of R9?
That could be the reason your application is behaving inconsistently because of mismatch between R10.1 and R9 components.

Please recompile your yocto changes with the R10.1 yocto version and verify.

Regards,
Muralidhara N.


#5

Hi @muralinagraj,
No, this has been happening since R8. It is always crashing in the libcurl.so library, when it crashes, at least that’s where the PC is when it accesses invalid memory according to the process map.

Thanks,
Evets


#6

I changed some timing where the third party app was being called. It was 1 minute and I changed it to two. Now it doesn’t crash at all. Something wasn’t getting transferred yet apparently.