Skip to content
Snippets Groups Projects
  1. Jun 03, 2024
    • Mitch Phillips's avatar
      Workaround bad GC of tombstone watcher. · 476ed072
      Mitch Phillips authored
      There's some bad behaviour going on that's exclusive to WatchOS
      (discovered on the Pixel Watch 2). The TombstoneWatcher class is
      responsible for watching the /data/tombstones/ directory. It is a member
      of the NativeTombstoneManager class, which is created when
      ActivityManager starts, and lives until the device is powered off.
      
      Unfortunately, some bad behaviour (unclear exactly what at this stage)
      means that the TombstoneWatcher class is spuriously garbage collected,
      even though the parent NativeTombstoneMenager class is still alive and
      reachable. I chatted with hboehm@ from the ART team, and his hypothesis
      is that because the TombstoneWatcher member is initialized in the
      constructor and never used again, some optimiser is doing the wrong
      thing and thinking that it's unused and can be GC'd.
      
      The TombstoneWatcher uses inotify in native code to execute a callback
      when a file is added to a directory, so it's clearly in use, but
      unfortunately the bug allows this class to be GC'd anyway.
      
      What this means, in practice, is that app native crashes on WatchOS are
      not being handled correctly. This includes:
       - Apps cannot get their own crashes through the
         ApplicationExitInfo::getHistoricalProcessExitReasons API.
       - Crash reports are never sent to Google, with the exception of
         tombstones that last until the next reboot, where they're one-time
         scooped up and sent to Google. This has substantially increased
         latency (requires a reboot) and also probably drops quite a number of
         reports because there's a limit of tombstones on the device, and a
         rate limit of how many are sent by GMS.
      
      Bug: 339371242
      Test: atest CtsGwpAsanTestCases on eos (Pixel Watch 2, WatchOS)
      Change-Id: I9226e4368b03bd4742fccdafde6018f145da63e6
      476ed072
  2. May 28, 2024
  3. May 27, 2024
  4. May 25, 2024
  5. May 24, 2024
  6. May 23, 2024
  7. May 22, 2024
  8. May 21, 2024
Loading