Select to view content in your preferred language

SIGSEGV error and application crash when using SDK

4765
21
07-25-2013 10:39 AM
JozefKaslikowski
Emerging Contributor
I have been trying to track this down for a couple of days now.

I am getting

07-25 13:03:49.340: A/libc(7133): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)


My application instantly crashes and I get no stack trace. I can usually run for 5-10 minutes panning around until this happens.

I have removed all of my tiles, all graphics features and it still happens. Since this is happening in native code, my debugging options appear to be pretty limited at this point.
0 Kudos
21 Replies
AndyGup
Esri Regular Contributor
Jozef, can you run a basic, Hello World map from the SDK?

Here's a blog post I wrote that may help narrow the problem down: http://www.andygup.net/troubleshooting-multi-threading-problems-related-to-androids-onresume/

-Andy
0 Kudos
JozefKaslikowski
Emerging Contributor
I have not tried running the hello world app on the newest version of the SDK, but I haven't had any issues in the past.

I have done the console logging after every line already to no avail. It is crashing in native code, and there are no exceptions thrown that I can catch. The app simply goes away without even an error on the device screen.

This isn't a terribly complex application, but it does use multiple graphics layers (with async tasks) and a custom tile loader.

I have tried running it in the simulator so I can get the actual core dumps, but the emulator takes ages to work and the app barely functions at all when panning. I am nearly to the point of rooting the device to just see if I can get something useful.
0 Kudos
AndyGup
Esri Regular Contributor
Gotcha. I see there are other references to the same error after doing a quick internet search.

Your best bet is to try the app on another phone or tablet. Is that an option?

If it crashes on several phones with the same version of the Android OS then the problem is most likely the app. If it only crashes on one phone in particular, then the problem could be related to that phone. I suggest trying it out on several phones before rooting or resetting your phone.

What phone and OS version are you running?

-Andy
0 Kudos
JozefKaslikowski
Emerging Contributor
I am running it on a ASUS transformer 101, android 4.0.3

I dont know if it will run on a phone, but maybe I can borrow a tablet.

I can't seem to find anything on the internet about getting the stack trace in a case like this. That would make it much more simple.
0 Kudos
AndyGup
Esri Regular Contributor
I noticed you said you couldn't capture an error on the device screen. Have you looked at the ADB logcat dump for your phone?

You could also try Acra http://acra.ch/. I haven't used it in a while so I don't know much about the latest version.

And, there are also ways to capture an NDK stack dump if the error is happening below the application level and further down in the Android OS. You could look into way to capture that.

-Andy
0 Kudos
JozefKaslikowski
Emerging Contributor
I have seen both of those and used logcat, but acra cannot work on anything below the java level. The logcat output just tells me the SIGSEGV happened but with no context at all so I can't see what happened leading up to it.

The NDK doesnt run on windows, so that is a problem (at least not easily). I am reading about JNI hooks now, so maybe that will be useful.
0 Kudos
AndyGup
Esri Regular Contributor
Yep, I've been there and done that. Before you go any farther then I suggest the following things to make sure you've eliminated the easy problems. IMHO I've found it's almost never worth the time to do deep OS-level debugging when working at the application level. I've found some interesting things like busted power controller boards and corrupted methods within patches, but it all meant I should have either replaced or rebuilt the device in the first place.

- Make sure you've installed the latest ArcGIS Runtime
- Restart your phone
- Try running a Hello World Android (non-ArcGIS) app and see if it happens
- Then, try running the Hello World ArcGIS app.

If everything works with these three steps, then I recommend creating a brand new project and start building your app from the ground up until you hit the spot where the problem starts happening again.

-Andy
0 Kudos
JozefKaslikowski
Emerging Contributor
You make me sad Andy, but I suppose I will make that plunge and rebuild slowly. I have tried commenting out large sections of code with no luck. The worst part is that it make take 20 minutes or more of solid panning and zooming to crash it. That is why I had hoped to find a place to look.
0 Kudos
AndyGup
Esri Regular Contributor
Just to clarify I was referring to Scenario 1. What you have are two different scenarios:

Scenario 1 - app crashes immediately
Scenario 2 - app crashes after 5 - 20(?) minutes of panning and zooming.

Do you get the exact same error in both scenarios?


-Andy
0 Kudos