Note that there are some explanatory texts on larger screens.

plurals
  1. PODebugging service crashes
    primarykey
    data
    text
    <p>I have a music service that takes care of music playback in the background of course, and also a few other things such as notifying activities of UI changes that need to be made, storing and restoring queues, obtaining song records via a cursor, and every time the song changes it takes care of updating the bitmap on the ongoing notification. </p> <p><strong>What is the problem?</strong> The service <strong>crashes</strong> almost all the time the user tries to do..well pretty much anything else. For instance, playing a song, and then opening a game crashes the service, sometimes light things like browsing the web on chrome will crash it too. </p> <p>A few details: </p> <p><strong>1 -</strong> The service is started via <code>startService(new Intent(this, MyMusicService.class));</code> but when user leaves activity I call <code>startForeground(mId, mNotification);</code> to show an ongoing notification that provides easy controls, and also because <code>startForeground()</code> is intented for services that should be prioritized as the killing of these by the activityManager would be disruptive for the user experience (music is stopped if service is killed)</p> <p><strong>2 -</strong> I have attempted to reproduce the crash, and it certainly happens when doing not so heavy work, like browsing on chrome (this would reproduce the crash almost 50% of the time), and <strong>always</strong> when doing things like launching temple run 2. FYI, if not doing anything at all - just playing music on the background and idle, playback will <strong>not</strong> stop at all, and it is works just the way it's intended to. </p> <p><strong>3 -</strong> The phone I am using as test device is not by any means a slow or low-memory device, it is a Galaxy Nexus. </p> <p><strong>4 -</strong> I've tried catching a few longs and sometimes it simply says: </p> <pre><code>02-24 06:53:32.586: I/ActivityManager(387): Process com.deadpixels.light.player (pid 27720) has died. </code></pre> <p>without any other messages, and sometimes the same message is accompanied by a WINDEATH: </p> <pre><code> 02-24 06:53:32.586: W/ActivityManager(387): Scheduling restart of crashed service com.deadpixels.light.player/.service.MyMusicService in 5000ms 02-24 06:53:32.602: W/InputDispatcher(387): channel '418d09c8 com.deadpixels.light.player/com.deadpixels.light.player.HomeActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9 02-24 06:53:32.602: E/InputDispatcher(387): channel '418d09c8 com.deadpixels.light.player/com.deadpixels.light.player.HomeActivity (server)' ~ Channel is unrecoverably broken and will be disposed! 02-24 06:53:32.602: W/InputDispatcher(387): Attempted to unregister already unregistered input channel '418d09c8 com.deadpixels.light.player/com.deadpixels.light.player.HomeActivity (server)' 02-24 06:53:32.602: I/WindowState(387): WIN DEATH: Window{418d09c8 u0 com.deadpixels.light.player/com.deadpixels.light.player.HomeActivity} </code></pre> <p>What I've also noticed is that almost always when the crash happens, a lot of other services "<strong>die</strong>". I am attaching the full log <a href="http://db.tt/P2BOgBlL">here</a>.</p> <p><strong>5 -</strong> I tried using <a href="https://github.com/ACRA/acra">ACRA</a> to get more information about the crash but even though everything seems to be setup correctly, after crashing the log is not being sent, or just nothing happens. I know ACRA detects the crash and starts: </p> <pre><code>02-24 06:53:37.719: D/ACRA(28293): ACRA is enabled for com.deadpixels.light.player, intializing... 02-24 06:53:37.742: D/ACRA(28293): Using default Mail Report Fields 02-24 06:53:37.742: D/ACRA(28293): Looking for error files in /data/data/com.deadpixels.light.player/files 02-24 06:53:37.742: W/ACRA(28293): com.deadpixels.light.player reports will be sent by email (if accepted by user). </code></pre> <p>but nothing is being sent, neither to the mailto I set, or to the form in Google docs. </p> <p>Not sure what else to try, and I was hoping to get some good ideas on what to look for. As I said, the service does do a few things, that to my knowledge are not that resource-extensive, and to be honest, I am not even sure if it is anything to do with the service that's crashing. </p> <p>Here's a <a href="https://gist.github.com/daniel-c05/308d878b5539933f6541">gist</a> of several code bits that take place in the service, and also the ACRA code I set up. It's also worth noting that I tried to reproduce the service crashing with other music players and I did not run into the issue at all. </p> <p>Thanks for the help!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload