TL;DR: In late September my Ride app crashed on every launch. Using ADB, I traced it to a personal heatmap file stitched together from two different versions, after a download resumed at the wrong moment. Hammerhead support answered within hours, confirmed a known issue, and a fix shipped a week after my detailed report. I'm sharing the process in case it helps someone else.
1. The symptom
On the morning of September 25, the Ride app closed about a second after each launch: 19 crashes in 17 minutes. The ride I had started with the play button on the home screen kept recording in the background, but without the Ride app I couldn't stop or save it.
2. What the crash logs say
Android keeps app crash traces, and you can read them over ADB without root:
adb shell dumpsys dropbox --print system_app_crash
All 19 traces were identical:
SQLiteDatabaseCorruptException: database disk image is malformed (code 11 SQLITE_CORRUPT),
while compiling: SELECT name, value FROM metadata
at org.oscim.android.tiling.source.mbtiles.MBTilesTileDataSource.getMetadata
At launch, the Ride app opens the personal heatmap (/sdcard/offline/personal_heatmap.mbtiles, an SQLite database) to draw it on the map. SQLite couldn't read the file, nothing caught the exception, and the app crashed. An optional map layer was enough to take down the whole app.
As soon as the Karoo got a connection back, it downloaded the heatmap again and everything went back to normal. The broken file went away with it: I knew what crashed, but not why the file was corrupted.
3. The second time: keep the evidence
On October 8, same crash. This time I kept the Karoo offline (no Wi-Fi, no Bluetooth) so it couldn't replace the file, and I pulled:
- the corrupted file, plus its SHA-256 hash computed on the Karoo;
- its timestamps (
stat) and a listing of /sdcard/offline/; - usage events and boot history (
dumpsys usagestats, dumpsys dropbox).
The evening before, after an update, the Karoo had written the file for the last time ten seconds before I switched it off. No leftover .tmp file: the download had finished normally.
4. Dissecting the file
An SQLite file states its own size in its header (the page count, at byte offset 28). Here:
- the header says 10,257 pages, but the file holds only 10,250. That mismatch alone makes SQLite refuse to open it;
- up to about page 1,560 (around 6.4 MB), everything matches the header and the tables' root pages;
- from about page 2,196 (9 MB) on, nothing matches: the root pages point to the wrong kind of data, while the pages they expect sit a few dozen pages further along;
- no zeroed pages, and the overflow chains are contiguous, which rules out random storage corruption.
So the beginning and the end of the file came from two different generations of my heatmap. The total size matched the new version, and the header belonged to the old one.
5. Finding the cause in the code
That left one question: how can a "successful" download produce this? I pulled the system app that handles offline maps (offlineregionservice) over ADB and read its disassembled code. The heatmap download:
- writes to a temporary
.tmp file; - after an interruption, resumes where it stopped with an HTTP
Range request; - appends the rest to the
.tmp file, then renames it to the final name.
One check is missing. On resume, nothing verifies that the file on the server hasn't changed in the meantime (no If-Range header with an ETag), and nothing validates the result before use. And the server regenerates the heatmap after every ride. So:
- a first download gets interrupted (power off, lost connection);
- I go for a ride, and the server regenerates my heatmap;
- the download resumes and appends the end of the new version to the start of the old one.
The file has the right size and gets renamed normally. The Ride app then crashes on its next launch.
6. If it happens to you
Build 1.665 should have fixed this crash (see below), and I haven't had it since. I don't know whether the fix also covers the mixed-file case, though. Other riders hit the same crash in this thread, where I first posted these steps. If the Ride app still crashes at launch because of the heatmap:
- Connect the Karoo to Wi-Fi and wait a bit. It downloads the heatmap again, and the Ride app starts normally once the new file is in place.
- Your ride isn't lost. Recording continues during the crashes. You just need the Ride app back to stop and save it.
- With ADB: deleting
/sdcard/offline/personal_heatmap.mbtiles lets the Ride app start right away. The Karoo downloads the heatmap again on the next connection. - You don't need a factory reset.
7. On the support side
| When | What |
|---|
| Sep 25, ~10 am | First ticket: crash trace, faulty file, suggested fixes |
| ~8 h later | Standard reply: remove extensions, reset the Karoo |
| Sep 28 | After my explanation, support agreed a reset wouldn't tell us anything and passed everything on to the software team |
| Oct 8, ~11 am | Second ticket, with the file analysis |
| 5 h later | Known issue, fix already developed, planned for the next release |
| Oct 9 | The mixed-file case is in their action plan, possibly for a later release |
| Oct 15 | Build 1.665: "We fixed an issue where Karoo would crash when heatmaps were partially downloaded and disconnected from the internet." |
Credit where it's due: after a generic first answer, support took the analysis seriously, apologized for suggesting the reset, and answered my detailed report within five hours. The fix reached my Karoo over the air a week later. That's a short loop from a user report to a shipped fix, and I appreciated it. As I write this, I don't know whether they've fixed the mixed-file case.
What I took away from it
- Read the crash logs before any reset. They pointed at the faulty file from the first minute.
- Keep the evidence offline: without the corrupted file, I could only guess.
- A report that names the cause and suggests a fix gets a precise answer, and a quick one.