Are kernel signals on Android ever benign? - android

I've installed a native code crash reporting system in my Android app, based on signal processing. There's a bunch of sigaction() calls for all the popular crash causes, there's crash report dumping and sending home to the bug tracker.
I'm receiving pretty consistent reports about some signals that are definitely not in my code. There are multiple instances of SISSEGV that originates in android.view.GLES20Canvas.nDrawDisplayList. There's another that comes from within android.webkit.JWebCoreJavaBridge.sharedTimerFired.
Question: is there any chance those signals constitute normal program operation and won't cause a crash/termination if not caught by me? Naturally, I can't reproduce any of those at will. They happen on customer devices.

Related

Prevent ACRA from sending duplicate exception

I'm using ACRA, to sending crash reports to my server. But for two reason, I don't want to send duplicate exceptions to server:
It's boring and make it hard to read and handle exceptions in panel.
My server bandwidth is limited.
So is there any option to enable/disable sending duplicate exceptions?
Duplicate exceptions means duplicate exceptions in specific device. For example if there is a button in my application that cause of a error, I don't want to send occurred error each time user push that button.(If application version increased, it should be sent).
There is no way to do this OOTB.
To do so would mean that you would need to build a database of crashes on your device and check to see if that error had occurred previously.
ACRA is designed to be lightweight and robust. Added that kind of functionality into it would diminish both of those design criteria.
I suggess you consider using a commercial cloud instance for your crash reporting instead of relying on your own server. A good crash server will aggregate crash instances for you. Which let's you focus on the high volume ones.

Flex mobile app crashes/hangs while waiting for web service response

I have having problems with a WSDL/SOAP service call in an app I have built in flash builder for mobile. I have connected to the service using flash builders built in data/services functionality.
For the most part, the service call works perfectly but once in a while it will cause the app to crash - on my android device it completely locks up (spinning animation stops) and then Android informs me that the app is not responding and asks if I want to close it.
The crash appears to occur quite frequently but not with any pattern. One time it happened on my third attempt, another time it took approximately 30, a couple of times I could not get it to happen and most times it occurs somewhere in between.
It appears that the crash happens after a service call is made but before any response is received. Neither the success or the fault listeners are ever fired. I am very confident that I am sending exactly the same variables to the service every time.
I have used web service calls in other apps without trouble so I have to assume there is something in this particular build that is causing problems but I can't seem to find anything.
Any thoughts on possible causes, things to test or even a solution would be hugely appreciated.
Thank you,
Jamie
Your question lacks essential details, so now I can suggest you to setup Charles proxy and monitor you requests trough it.
If you send too many requests simultaneously, you shall not be confident in fault/result events as air runtime has limitations (in any case, it is a good practice to handle request timeout).

App dies with "Sending signal." but no exception or other info

I'm working on an app that is recording data via Bluetooth, but it intermittently crashes after hours of collecting data (making it hard to track down the bug).
The logcat output isn't very helpful:
http://i.imgur.com/EalnX.png
There are no exceptions thrown and no clues for what caused the process to be terminated.
How can I figure out what went wrong? Is there an exception being thrown that isn't being shown by logcat? How can I track this bug down?
Signal 9 is SIGKILL, which will terminate a process immediately (no handlers inside the process will run). From the log line, the process is killing itself, so its not an external agent that is issuing the SIGKILL.
My guess (and its really a guess) is that the memory management code running inside your process (as part of the infrastructure, not code that you wrote) is deciding that you've exhausted some resource and the only recourse is to die. I would expect there to be more messages before this point is reached in the log, so it may be worth browsing the log history to see if there are useful warnings from the process before this point.
The line immediately before this is a GC log, which implies that some sort of memory resource is running low. But it looks like the heaps are not full, so failing allocations seems unlikely. You can still get allocation failures if the object being allocated was too large to fit on the heap, or fragmentation prevented it from being allocated. I'd expect to see more relevant log messages in this case, though.
I think capturing more of the log (perhaps filtering it by your app's PID if necessary) will help you make progress.
In my case there was no warnings or any clues in the log.
Eventually I found that my problem was that one of the activities I was going into (lets say Activity X) was registering to a broadcast receiver but never unregistered from it.
Therefor by closing the activity (Activity X) and coming back to it caused registering Again to the same broadcast receiver - which caused the mess!
Simply adding unregisterReceiver(mybroadcast); (in Activity X) solved it.
(I added mine to onDestroy. make sure you unregister in the right location).
And if you are super desperate I recommend seeing this slide share which explains Android crash debugging your errors.
this problem happens when using RXjava and not implement the onError callback method

Can multiple data reporting utilities report on the same uncaught exception?

My app uses Flurry for analytics and the excellent ACRA for uncaught exception reporting. This means that there are 3 places uncaught exception reporting happens: Flurry, ACRA and the crash error report within the Android Developer Console. As far as I can tell, it looks like only one of the 3 areas catches and reports on an exception. And, more strangely, it seems random as to which one it is. I.e. sometimes an exception is reported in ACRA, sometimes in Flurry and sometimes in the Developer Console. I don't have a high enough volume of exceptions (thankfully!) to see any patterns, but ideally I'd like all exceptions at a minimum to go to ACRA. Am I missing something as to how this works? Is it possible for all exceptions to go to all 3 reporting places?
You can disable Flurry's exception handling using this command in your onStart() -
FlurryAgent.setCaptureUncaughtExceptions(false);
This way it won't interfere with other handlers.
Update June 2013
This answer still stands as the way to achieve this goal, but from my experience, Flurry seem to catch an exception here and there in spite of this flag. So it's not a 100% reliable solution. Recently I moved to Google Analytics, and turned off the exception handling - and it is perfectly reliable in that respect.

Android Force Close Uncatchable Unreportable

I've released my second game project on the Android Market this week, and immediately had multiple 1-star reports due to force closes. I tested it on many handsets and many emulators with zero issues. I'm completely at a loss for how to proceed and looking for advice.
I use Thread.setDefaultUncaughtExceptionHandler to intercept and report uncaught exceptions, then close gracefully. The people reporting force closes aren't getting to any of that, even though it is the first thing set in the application's main task constructor, and everything is wrapped in try/catches throughout. They are also reporting that there is no "Send Report" option in the force close popup (providing the Developer Console error reports), so I have absolutely no way of knowing what the problem is.
Uses Android 2.0, with android:minSdkVersion="5". Only Permission required is INTERNET.
(on Android market as 'Fortunes of War FREE' if you want to test)
I'm a bit surprised about the missing "Send report" button. What API level did you build the game with? I usually build the level with your minimum API level to make sure you're not using any API calls beyond that, but then switch back to the highest API level so you can use functionality like "install to SD".
I'm sure there's at least one user who wrote you a mail. Can you ask them to install LogCollector and mail you the log?
Btw, in general, I wouldn't use Thread.setDefaultUncaughtExceptionHandler so there IS the option to send a report. (It's ominously missing in your case, but normally, it should be there.)
Btw btw, the exception handler applies to the current thread. If you have an OpenGL app, maybe the crash happens in the GL thread?
I'm not sure if I understood you correctly, but as far as I know Android only shows that report dialog if you use its default UncaughtExceptionHandler.
Try this:
In your UncaughtExceptionHander's constructor, call Thread.getDefaultUncaughtExceptionHandler and save the returned object in a variable (let's call it defaultHandler). In your Handler's uncaughtException() do the things you want to do, and then call defaultHandler.uncaughtException() afterwards.
Maybe something you should know:
In my experience, your Context isn't functional anymore at uncaughtException(). So, you can't send broadcasts, etc anymore.
By the way, if you really wrapped everything in try/catch, that could be the reason why error reporting doesn't work as expected? :P
Good luck
Tom
Perhaps the force closes are caused by stalls, rather than exceptions. Users may not notice the difference. This kind of problem can occur more often if users have CPU hogging services running at the same time as your application, which explains why you're not seeing the issue in your testing.
Permission Internet sounds a lot like you try to transfer data from the net, which is very fast in your local LAN, but all of a sudden becomes slow (and time consuming) when people try this over their GSM connections.
If you then do the data transfer in the UI thread, this one is blocked and the system detects the block - but then this should end up in a "Did not respond" -- but then I've seen one user report an error with in the market on my app that was such a slow down cause.

Categories

Resources