Tombstone "last reported" marker lives in the cache dir: a cache clear re-reports the latest tombstone, unmerged and sometimes without release

Aberta
#6,758 4 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
45/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
android, kotlin

Direção de pesquisa

Start by tracing TombstoneIntegration and the code that writes and reads the “last reported” marker, then check how the options cache and outbox sender affect tombstone metadata and native event matching. Reproduce the cache-clear steps on Android and inspect the relevant integration tests. Done when clearing the cache no longer causes the same tombstone to be reported again, and the reported event retains the expected release and environment.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Android Bug Platform: Java Waiting for: Product Owner
Integration

sentry-android

Build System

Other

AGP Version

n/a (.NET for Android 36.1.53, via Sentry .NET 6.11.1)

Proguard

Disabled

Other Error Monitoring Solution

No

Version

8.57.0

Steps to Reproduce

SDK: sentry-android 8.57.0, through Sentry .NET 6.11.1 (Sentry.Maui), with TombstoneEnabled = true. Android 16 emulator (API 36, arm64-v8a).

  1. Cause a native crash (SIGABRT) with the default signal-handler strategy, then relaunch. The tombstone is reported once and merged with the native event: "Writing last reported Tombstone marker with timestamp 1795592196503".
  2. Relaunch a few more times. Each launch logs "Latest Tombstone has already been reported, returning early." This is correct.
  3. Clear the app's cache directory. Android does this itself when storage runs low; we reproduced it with run-as <pkg> rm -rf cache.
  4. Relaunch.
Expected Result

The marker that prevents re-reporting should survive a cache clear, for example by living in noBackupFilesDir or another persistent location. Failing that, the SDK should not report a tombstone whose release and environment it cannot determine.

Actual Result
  • The same tombstone (same timestamp) is reported a second time, as an unmerged Tombstone event: "No matching native event found for tombstone".
  • In one of our two cache-clear runs, the re-reported event had release: null and no environment; in the other it had both. We suspect it depends on whether the options cache has been written again by the time the tombstone is built.
  • In production, the same process (same pid and timestamp) has been reported up to 8 times, several copies without release or environment.

Note, not yet reproduced locally
In production, many tombstones arrive unmerged while their Sentry Native counterpart is sent separately about 1 s apart, well within the 5 s window. That suggests the outbox sender sometimes ships the native envelope before TombstoneIntegration looks for it. We couldn't test the send race because our emulator had no validated network.

Related: getsentry/sentry-dotnet#6012 (with SignalHandlerStrategy.ChainAtStart, SIGABRT never produces a tombstone at all).

Linguagem predominante
Kotlin
Estrelas
1.4k
Forks
483
Merge médio
2d 54min
PRs com merge (30d)
207

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de getsentry/sentry-java

Todas as issues de getsentry/sentry-java

Issues semelhantes

Mais issues de Kotlin

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.