Select to view content in your preferred language

SIGSEGV error and application crash when using SDK

5300
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
JozefKaslikowski
Emerging Contributor
Im sorry, my writeup wasn't clear originally.

My app starts and runs fine. Only after panning and zooming for a random period does it crash and always with the SIGSEGV error.

I should have wrote that the app immediately closes (no warnings or logcat output) when receiving the SIGSEGV.
0 Kudos
AndyGup
Esri Regular Contributor
Okay, that makes sense, thanks. I'd still suggest restarting the phone and then trying out your panning and zooming on the Hello World map app and see if you can recreate the problem on that.

And, if that works fine then you'd most likely agree it's something in your custom app. Then creating  a new project from scratch will help you pinpoint the problem.
0 Kudos
AndyGup
Esri Regular Contributor
I had a few more thoughts since your use case calls for extensive panning and zooming. When the app crashes pay attention to the data and cache size as found in Settings > App Info > your application.

Also consider setting up the app to ask for a larger heap: http://developer.android.com/reference/android/R.styleable.html#AndroidManifestApplication_largeHeap. This is a common approach in apps that are data intensive, even with the caveats such as you can't predict how large the heap will do. It also depends on what the device has for available memory and CPU, etc. I'd consider your use case as following into this category.

Example:

android:largeHeap="true" 


You might also monitor the heap in DDMS and see if that provides any hints if you are using too much memory somewhere.

-Andy
0 Kudos
JozefKaslikowski
Emerging Contributor
Thank you. I will give those a try and see what happens.
0 Kudos
SebastianGreifeneder
Emerging Contributor
Jozef, did you come to any results since then?

I'm running exactly into the same problem. After some time of panning and zooming, the app crashes without any UI message. Only this one SIGSEGV error shows up in the LogCat.
09-17 11:43:33.880: A/libc(2056): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)


What I guess:
I've built an offline app, using two compact caches. Actually I'm experiencing this problem when both compact caches and a graphics layer are shown in the map. So maybe there is some kind of memory problem and two caches are too much ...

I will try the largeHeap hint, as Andy mentioned before.


Best regards,

Sebastian
0 Kudos
JozefKaslikowski
Emerging Contributor
I have taken my app apart and removed the graphics layers and everything seems to work. I have not found a final resolution to the problem yet however. So, it seems that the offline tiles are fine, just something to do with large graphics feature layers is causing an issue (or multiple graphics layers).
0 Kudos
SebastianGreifeneder
Emerging Contributor
Thanks for your answer!

I actually have 3 graphics layers, but two of them are more or less temporary layers with only a few graphics. However, the other graphics layer can contain a few hundred up to several thousand graphics. Is this what you mean with "large" graphics layer?
Do you now use feature layers to display your graphics?


Best regards,

Sebastian
0 Kudos
JozefKaslikowski
Emerging Contributor
I have pretty much the same setup. 3 layers and about the same number of objects in one.

I load the big one using an async task every time the view changes at all (including every pan operation). The dataset I am using contains 110,000 items so I only display when zoomed in past a threshold. So I may dump and reload 1,000 or more graphics features on every pan. I just dont think it was made for that kind of duty.

Right now I just deal with the crashes, but at some point i will revisit the underlying issue. It would be awesome if an ESRI person would run it and show the crash point in their debugger, but that is asking a bit much for them to do that. Everyone would ask then.

It is crashing in native code, so there isnt much you can do with it for troubleshooting or pinpointing. I tried to run it in the emulator to get the actual process dump when it crashes, but my computer cant run the emulator fast enough to make it happen.
0 Kudos
OliviaWattson
Emerging Contributor
Hello everyone I am new to android development , can anyone give me some tips and basic key ideas for an app development?
0 Kudos
SebastianGreifeneder
Emerging Contributor
Jozef,

I think we have to wait for ESRI to release its native offline functionality to overcome this problem.
Because also using feature layers, all features have to be stored within memory, so imo it can't be that better. And everything else with graphic layers can only be a workaround.

And using the emulator with ArcGIS Runtime SDK for Android is just not practical!

Best regards,
Sebastian
0 Kudos