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?