I've found that my problem have been report many times on Internet, but I do not found any correct explanantion about it.
On my Galaxy Note, when I exit from my program, I have some time this kind of message into le logcat.
threadid=3: reacting to signal 3
Wrote stack traces to '/data/anr/traces.txt'
I can't acces to the file. DDMS view does not show me anything into the Explorer.
I read on Internet that ANR (Application Not Responding) was due to Activity long process. But in my case, my activity does not do any special things.
I'm using a SurfaceView that launch 3 Threads. One of them can take a long time (1 or 2 seconds) at the beginnig of the application (it read's big data files from sdcard), but it does not do anything at the end when I exit.
I can see 10 process into DDMS view, but I do not know what thread is the #3 ! So I do not know if it's one of the thread I launch or if this is a Android thread.
More than finding the problem, I'd like to understand what is signal 3. When this king of problem happened. Is it only due to a process that not responding or can it be due to another problem ? I tested my native code under linux (beagleboard). There is no memory leak and no segmentation fault. Why does this problem happened only when I exit my application (and only sometimes). Does it mean that my thread destruction is not correct ?
I'm using this code
public void surfaceDestroyed(SurfaceHolder holder) {
boolean retry = true;
while (retry) {
try {
thread.join();
retry = false;
} catch (InterruptedException e) {
// try again shutting down the thread
}
}
}
I also have a special code into onDestroy of my Activity.
This code make some native Code free. Because it's c++ code, it call all the destructor of my objects. I don't know if this destrution is long, but I suppose it must not take more than 1 ms.
Well. I've work on this problem for 1 week now. The next step for me if I do not understand the problem will be to restart a new projet and import my code, part by part to check when the problem really occured.