0

As I understood it, we're not supposed to be seeing these unless working with native code, which I am definitely not. I'm simply calling a bunch of AsyncTasks that fetch web data and populate a listview.

How do I debug it? There is absolutely no indication on what causes it and it's pretty consistent, 1 out of every 6 or 7 runs of my action and it only happen on a GNex, not in the emulator. Is putting tons of logcat around it the only way?

12-08 00:26:03.362: D/dalvikvm(10906): GC_CONCURRENT freed 651K, 12% free 10861K/12320K, paused 4ms+9ms, total 52ms
12-08 00:26:03.362: D/dalvikvm(10906): WAIT_FOR_CONCURRENT_GC blocked 18ms
12-08 00:26:03.362: D/dalvikvm(10906): WAIT_FOR_CONCURRENT_GC blocked 6ms
12-08 00:26:03.401: A/libc(10906): Fatal signal 11 (SIGSEGV), thread 10958 (pool-1-thread-9)
12-08 00:26:03.401: A/libc(10906): Fatal signal 11 (SIGSEGV) at 0x637f4008 (code=1), thread 10923 (pool-2-thread-1)
12-08 00:26:04.330: I/Choreographer(10906): Skipped 47 frames!  The application may be doing too much work on its main thread.
Glebbb
  • 356
  • 1
  • 8
  • This line explains many things `The application may be doing too much work on its main thread.` so what is going on in main thread? – Ali Imran Dec 08 '12 at 08:55
  • I'm pretty sure it's not that. I have strict mode on and this is only displayed after the app hangs due to the SIGSEV. I did manage to get a backtrace running 'adb -d logcat', here it is: http://pastebin.com/ANvNZzPK I do a bunch of regex/parsing the info I get off the web, going to have to look into that... – Glebbb Dec 08 '12 at 09:03
  • Since JNI is in the path and you're not using native code, it seems you are calling something that uses native code. – David Schwartz Dec 08 '12 at 09:09
  • 1
    I looked AOSP and MatchChunkAt() seems to be the matching engine used in "Matcher"... looking at my code I use a static Matcher in a class of which multiple instances exist in parallelized code... this is probably it, will close upon confirmation. – Glebbb Dec 08 '12 at 10:04

1 Answers1

1

How do I debug it?

Most likely, you don't. You report it for somebody else to fix.

First, create a sample project that can reproduce the error.

Then:

  • If you are encountering this on a ROM mod, and it works normally in standard Android environments, file a bug report against the ROM mod, providing your sample project and the complete LogCat output (including all of the core dump from the SIGSEGV, if available)

  • If you are encountering this on a particular manufacturer's device(s) and not other environments (e.g., emulator), try contacting the manufacturer in question. For example, HTC tends to monitor the htc tag here on StackOverflow.

  • If you are encountering this in the emulator, in a Nexus device (running stock ROM), or across multiple devices from different manufacturers, then the problem probably lies in Android proper, so file an issue on http://b.android.com with the sample project, LogCat dump, and steps to reproduce the error

Between logging and commenting out parts of your app (or perhaps running it in the debugger, if you can reproduce the error there), you should be able to get a handle on which segment of your code is triggering the SIGSEGV. That can give you data to perhaps help with a workaround, plus it gives you an idea of what to put in the sample project to reproduce the error.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Thanks. I saved the info necessary to reproduce this and will send it to Google, time permitting. My issue was indeed threads interfering with a shared static Matcher. – Glebbb Dec 09 '12 at 12:10
  • @Glebbb: Hmmmm... while it may not have been safe [to assume that `Matcher` is thread-safe](http://stackoverflow.com/questions/1360113/is-java-regex-thread-safe), it still should fail more gracefully than a `SIGSEGV`. There's also a documentation bug, as neither `Pattern` nor `Matcher` mention this thread-safety issue. I have filed a bug report on the documentation problem: http://code.google.com/p/android/issues/detail?id=41143 – CommonsWare Dec 09 '12 at 12:20
  • @Glebbb: If you click on the issue link in my previous comment, you will see that it is confirmed that `Matcher` is not thread-safe, though Google is interested in more details so that they can avoid the `SIGSEGV`. If you could chime in on the issue, we can hopefully improve matters for future releases. Thanks! – CommonsWare Dec 09 '12 at 17:41
  • I updated the bug report with the full stack and enough code to reproduce, hopefully. – Glebbb Dec 10 '12 at 08:55