René's URL Explorer Experiment


Title: Permanent app freeze on foreground: main thread blocks in ReplayIntegration.start while replay executor hangs in MediaCodec.dequeueOutputBuffer holding the replay lock (HyperOS 3 / Android 16) · Issue #5870 · getsentry/sentry-java · GitHub

Open Graph Title: Permanent app freeze on foreground: main thread blocks in ReplayIntegration.start while replay executor hangs in MediaCodec.dequeueOutputBuffer holding the replay lock (HyperOS 3 / Android 16) · Issue #5870 · getsentry/sentry-java

X Title: Permanent app freeze on foreground: main thread blocks in ReplayIntegration.start while replay executor hangs in MediaCodec.dequeueOutputBuffer holding the replay lock (HyperOS 3 / Android 16) · Issue #5870 · getsentry/sentry-java

Description: Integration sentry-android (via sentry-flutter) Java Version N/A (Flutter app) Version sentry-android 8.49.0 (bundled by sentry_flutter 9.25.0) Steps to Reproduce Device: Xiaomi 14 (houji), HyperOS 3 / Android 16, build OS3.0.303.0.WNCCN...

Open Graph Description: Integration sentry-android (via sentry-flutter) Java Version N/A (Flutter app) Version sentry-android 8.49.0 (bundled by sentry_flutter 9.25.0) Steps to Reproduce Device: Xiaomi 14 (houji), HyperOS...

X Description: Integration sentry-android (via sentry-flutter) Java Version N/A (Flutter app) Version sentry-android 8.49.0 (bundled by sentry_flutter 9.25.0) Steps to Reproduce Device: Xiaomi 14 (houji), HyperOS...

Opengraph URL: https://github.com/getsentry/sentry-java/issues/5870

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Permanent app freeze on foreground: main thread blocks in ReplayIntegration.start while replay executor hangs in MediaCodec.dequeueOutputBuffer holding the replay lock (HyperOS 3 / Android 16)","articleBody":"### Integration\n\nsentry-android (via sentry-flutter)\n\n### Java Version\n\nN/A (Flutter app)\n\n### Version\n\nsentry-android 8.49.0 (bundled by sentry_flutter 9.25.0)\n\n### Steps to Reproduce\n\nDevice: Xiaomi 14 (houji), HyperOS 3 / Android 16, build `OS3.0.303.0.WNCCNXM` (latest stable).\n\nReplay config:\n\n```dart\noptions.replay.onErrorSampleRate = 1.0;  // buffer mode for all sessions\noptions.replay.sessionSampleRate = 0.1;\n```\n\n1. Use the app normally, then send it to background (screen off or app switch).\n2. HyperOS 3 aggressively freezes the cached process (cgroup freezer). This appears to leave the in-flight `MediaCodec` session in a broken state.\n3. Return to the app.\n\n### Expected Result\n\nApp resumes normally. A hung replay video encoder must never block the main thread.\n\n### Actual Result\n\nThe app is **permanently frozen**: no touch, no back gesture, window never gains focus. The OS records an ANR with subject *\"Input dispatching timed out (Application does not have a focused window)\"*. Only force-stop recovers.\n\nIt is a classic lock-ordering hazard rather than a device quirk:\n\n**Thread 1 —** `SentryReplayIntegration-0` is stuck forever inside `MediaCodec.dequeueOutputBuffer` (native `ALooper::awaitResponse` never returns after the process was frozen mid-encode), while **holding the replay lock**:\n\n```\n\"SentryReplayIntegration-0\" daemon prio=5 tid=4 Native\n  native: #03 pc 0001f2c8  libstagefright_foundation.so (android::ALooper::awaitResponse+284)\n  native: #04 pc 0002432c  libstagefright_foundation.so (android::AMessage::postAndAwaitResponse+452)\n  native: #05 pc 001d6390  libstagefright.so (android::MediaCodec::dequeueOutputBuffer+436)\n  at android.media.MediaCodec.native_dequeueOutputBuffer(Native method)\n  at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:4308)\n  at io.sentry.android.replay.video.SimpleVideoEncoder.drainCodec(SimpleVideoEncoder.kt:218)\n  at io.sentry.android.replay.video.SimpleVideoEncoder.release(SimpleVideoEncoder.kt:288)\n  at io.sentry.android.replay.ReplayCache.createVideoOf(ReplayCache.kt:212)\n  at io.sentry.android.replay.capture.CaptureStrategy$Companion.createSegment(CaptureStrategy.kt:92)\n  at io.sentry.android.replay.capture.BaseCaptureStrategy.createSegmentInternal(BaseCaptureStrategy.kt:142)\n  at io.sentry.android.replay.capture.BufferCaptureStrategy.createCurrentSegment$lambda$5(BufferCaptureStrategy.kt:241)\n  at io.sentry.android.replay.util.ReplayExecutorService.submit$lambda$0(ReplayExecutorService.kt:26)\n```\n\n**Thread 2 —** `main` then blocks forever acquiring that same lock during activity start, killing the whole app:\n\n```\n\"main\" prio=5 tid=1 Waiting\n  at jdk.internal.misc.Unsafe.park(Native method)\n  at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:322)\n  at io.sentry.util.AutoClosableReentrantLock.acquire(AutoClosableReentrantLock.java:37)\n  at io.sentry.android.replay.ReplayIntegration.start(ReplayIntegration.kt:171)\n  at io.sentry.android.core.LifecycleWatcher.startSession(LifecycleWatcher.java:87)\n  at io.sentry.android.core.LifecycleWatcher.onForeground(LifecycleWatcher.java:62)\n  at io.sentry.android.core.AppState$LifecycleObserver.onStart(AppState.java:202)\n  at androidx.lifecycle.ProcessLifecycleOwner.activityStarted$lifecycle_process_release(ProcessLifecycleOwner.kt:97)\n  at android.app.Activity.performStart(Activity.java:9522)\n```\n\nA second full dump taken on another day shows the identical pair of stacks, so this is stable, not a one-off.\n\n### Impact\n\nOur analytics defined a \"frozen resume\" signature (app opened from background → zero further events → cold start within 120 s, i.e. user force-killed a dead app). Over 30 days:\n\n* Xiaomi devices on Android 16 (HyperOS 3): **6.3 %** of resumes (1785 sampled devices)\n* Xiaomi on Android ≤ 15: 0.3–0.6 %\n* Every other brand on Android 16: 0.3–0.8 %\n\nThe rate climbed week over week as the HyperOS 3 OTA rolled out, independent of our app releases. Battery-optimization whitelisting on the device does not prevent it. We had to disable Session Replay entirely to fix our users, confirmed by an affected user: freeze gone with a replay-disabled build.\n\n### Suggestions\n\n* `ReplayIntegration.start()` (and `stop`/`pause`/`resume`) run on the main thread via `LifecycleWatcher`; acquiring a lock there that can be held across a **blocking native** `MediaCodec` **call** turns any codec hang into a whole-app deadlock. Either move the work off the main thread, use `tryLock` with a short timeout, or never hold the replay lock across encoder drain/release.\n* `SimpleVideoEncoder.drainCodec` passes an infinite/long timeout to `dequeueOutputBuffer` in the `endOfStream`/release path; a bounded timeout with bail-out would make a dead codec merely drop a segment instead of hanging the executor while holding the lock.\n\nPossibly related: getsentry/sentry-java#5529 (encoder kept running while rate-limited).","author":{"url":"https://github.com/Adherentman","@type":"Person","name":"Adherentman"},"datePublished":"2026-07-30T05:32:21Z","url":"https://github.com/getsentry/sentry-java/issues/5870"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:41aa59fc-1f2a-6ce0-fe88-ffd45a4f25b5
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCA4E:DBD8D:624751:84EF32:6B04A86F
html-safe-nonce2a199ee0cd1827fb8c97db9199635ea808c65f0cb3b0e7764d9b0551f375777a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTRFOkRCRDhEOjYyNDc1MTo4NEVGMzI6NkIwNEE4NkYiLCJ2aXNpdG9yX2lkIjoiMzIwMDcxMTY5NjM3NzQ4OTUxOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaceabea0494fc4f21be3b85759b62faa02beaf5a7eb19cfd32c693469aecd8c66f
hovercard-subject-tagissue:5016552359
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-java/5870/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2a014340067dd1e96d445f3649486228de885d39d510e4ef43bfe385bb721c22/getsentry/sentry-java/issues/5870
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2a014340067dd1e96d445f3649486228de885d39d510e4ef43bfe385bb721c22/getsentry/sentry-java/issues/5870
og:image:altIntegration sentry-android (via sentry-flutter) Java Version N/A (Flutter app) Version sentry-android 8.49.0 (bundled by sentry_flutter 9.25.0) Steps to Reproduce Device: Xiaomi 14 (houji), HyperOS...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameAdherentman
hostnamegithub.com
expected-hostnamegithub.com
None188497a0f45a7aa8f7c866faa1950d1a7f8d82b59416adf549b222ad1d1dd19b
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-java git https://github.com/getsentry/sentry-java.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3368190
octolytics-dimension-repository_nwogetsentry/sentry-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3368190
octolytics-dimension-repository_network_root_nwogetsentry/sentry-java
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release557cfbac6cdb532730c95c90f2cefdc0c4128029
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-java/issues/5870#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-java%2Fissues%2F5870
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-java%2Fissues%2F5870
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-java
Reloadhttps://github.com/getsentry/sentry-java/issues/5870
Reloadhttps://github.com/getsentry/sentry-java/issues/5870
Reloadhttps://github.com/getsentry/sentry-java/issues/5870
getsentryhttps://github.com/getsentry
sentry-javahttps://github.com/getsentry/sentry-java
Codehttps://github.com/getsentry/sentry-java
Issues266 (266)https://github.com/getsentry/sentry-java/issues
Pull requests57 (57)https://github.com/getsentry/sentry-java/pulls
Discussionshttps://github.com/getsentry/sentry-java/discussions
Actionshttps://github.com/getsentry/sentry-java/actions
Projectshttps://github.com/getsentry/sentry-java/projects
Security and quality2 (2)https://github.com/getsentry/sentry-java/security
Insightshttps://github.com/getsentry/sentry-java/insights
https://github.com/getsentry/sentry-java
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-java/issues/5870
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-java/issues/5870
#5842https://github.com/getsentry/sentry-java/pull/5842
Permanent app freeze on foreground: main thread blocks in ReplayIntegration.start while replay executor hangs in MediaCodec.dequeueOutputBuffer holding the replay lock (HyperOS 3 / Android 16)https://github.com/getsentry/sentry-java/issues/5870#top
#5842https://github.com/getsentry/sentry-java/pull/5842
https://github.com/romtsn
Androidhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Android%22
Bughttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Bug%22
Platform: Javahttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Platform%3A%20Java%22
Replayshttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Replays%22
https://github.com/Adherentman
Adherentmanhttps://github.com/Adherentman
on Jul 30, 2026https://github.com/getsentry/sentry-java/issues/5870#issue-5016552359
#5529https://github.com/getsentry/sentry-java/issues/5529
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Jul 30, 2026https://github.com/getsentry/sentry-java/issues/5870#event-28701991857
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Jul 30, 2026https://github.com/getsentry/sentry-java/issues/5870#event-28701994400
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Jul 30, 2026https://github.com/getsentry/sentry-java/issues/5870#issuecomment-5127001380
Linear Codehttps://linear.app
JAVA-678https://linear.app/getsentry/issue/JAVA-678
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Jul 30, 2026https://github.com/getsentry/sentry-java/issues/5870
github-actionshttps://github.com/apps/github-actions
Platform: Javahttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Platform%3A%20Java%22
on Jul 30, 2026https://github.com/getsentry/sentry-java/issues/5870#event-28701995410
linear-codehttps://github.com/apps/linear-code
Replayshttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Replays%22
Bughttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Bug%22
Androidhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Android%22
on Jul 30, 2026https://github.com/getsentry/sentry-java/issues/5870#event-28702024773
https://github.com/markushi
markushihttps://github.com/markushi
on Jul 31, 2026https://github.com/getsentry/sentry-java/issues/5870#issuecomment-5141646208
@Adherentmanhttps://github.com/Adherentman
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Jul 31, 2026https://github.com/getsentry/sentry-java/issues/5870#event-28770171144
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Jul 31, 2026https://github.com/getsentry/sentry-java/issues/5870
https://github.com/romtsn
romtsnhttps://github.com/romtsn
on Jul 31, 2026https://github.com/getsentry/sentry-java/issues/5870#issuecomment-5142075613
#5842https://github.com/getsentry/sentry-java/pull/5842
linear-codehttps://github.com/apps/linear-code
romtsnhttps://github.com/romtsn
on Aug 3, 2026https://github.com/getsentry/sentry-java/issues/5870#event-28887471282
romtsnhttps://github.com/romtsn
completedhttps://github.com/getsentry/sentry-java/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#5842https://github.com/getsentry/sentry-java/pull/5842
on Aug 11, 2026https://github.com/getsentry/sentry-java/issues/5870#event-29307883216
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
on Aug 12, 2026https://github.com/getsentry/sentry-java/issues/5870#issuecomment-5269621589
GitHub Actionshttps://help.github.com/en/actions
#5842https://github.com/getsentry/sentry-java/pull/5842
8.53.0 releasehttps://github.com/getsentry/sentry-java/releases/tag/8.53.0
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-java/issues/5870
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-java/issues/5870
romtsnhttps://github.com/romtsn
Androidhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Android%22
Bughttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Bug%22
Platform: Javahttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Platform%3A%20Java%22
Replayshttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Replays%22
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.