Otto
Otto

Reputation: 1685

Android "suspended (Exception X)" stack trace

Someone testing an Android app submitted a stack trace to us that looks like this:

Thread [<21> Thread-31] (Suspended (exception SQLiteException)) 
FooClass.bar(Foo2Class) line: 198

The line of code it points to is not related to SQLite (it's not an Android class, it's my code). If you want to know, the line of code it points to looks like this:

if (s_arrayList.contains(foo2))

so the only exception I could imagine happening here is a NullPointer... definitely not a SQLite exception.

My main question is: What does the "Suspended (exception X)" really mean? If the exception happened on a different thread, why is Android reporting this stack trace?

Update:

I think this issue has to do with Eclipse, which suspended the thread when it detected an exception. This still leaves the question unanswered for me, which is why Eclipse suspded the thread at precisely this place. I found a related question, which discusses this quirk of Eclipse. You can read more about it here:

Eclipse Android Debugger - Where in my code did I cause the exception?

Upvotes: 1

Views: 401

Answers (2)

Ilya Gazman
Ilya Gazman

Reputation: 32231

When your thread throwing an suspension - exception (just like in your stack trace), it does not mean that you had a null pointer it means that some one from other thread called to Thread.suspend().

Upvotes: 1

stefan bachert
stefan bachert

Reputation: 9606

I could imagine much more cases. In order to track it down more code would be helpful. However, very little time is left

Check whether the stack trace really fit to your code version.

Check of which type s_arraylist really is. It might be some special code doing late binding on sqllite. However, I don't think this is very likely but it is better to verify

Check of which type foo2 really is. May be its hashcode or equals method is using directly or indirectly SqlLite. This is my favorite.

Upvotes: 1

Related Questions