René's URL Explorer Experiment


Title: Session Replay: native SIGSEGV in `eglDestroySurface` (`libEGL_emulation`) when `SimpleVideoEncoder` releases its input surface on the Android emulator · Issue #6279 · getsentry/sentry-java · GitHub

Open Graph Title: Session Replay: native SIGSEGV in `eglDestroySurface` (`libEGL_emulation`) when `SimpleVideoEncoder` releases its input surface on the Android emulator · Issue #6279 · getsentry/sentry-java

X Title: Session Replay: native SIGSEGV in `eglDestroySurface` (`libEGL_emulation`) when `SimpleVideoEncoder` releases its input surface on the Android emulator · Issue #6279 · getsentry/sentry-java

Description: Integration sentry-android (Session Replay, sentry-android-replay) Build System Gradle AGP Version 9.3.1 Proguard Disabled (debug build) Other Error Monitoring Solution Firebase Crashlytics Version 8.47.0 (sentry-android-gradle-plugin 6....

Open Graph Description: Integration sentry-android (Session Replay, sentry-android-replay) Build System Gradle AGP Version 9.3.1 Proguard Disabled (debug build) Other Error Monitoring Solution Firebase Crashlytics Version...

X Description: Integration sentry-android (Session Replay, sentry-android-replay) Build System Gradle AGP Version 9.3.1 Proguard Disabled (debug build) Other Error Monitoring Solution Firebase Crashlytics Version...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Session Replay: native SIGSEGV in `eglDestroySurface` (`libEGL_emulation`) when `SimpleVideoEncoder` releases its input surface on the Android emulator","articleBody":"### Integration\nsentry-android (Session Replay, `sentry-android-replay`)\n\n### Build System\nGradle\n\n### AGP Version\n9.3.1\n\n### Proguard\nDisabled (debug build)\n\n### Other Error Monitoring Solution\nFirebase Crashlytics\n\n### Version\n8.47.0 (sentry-android-gradle-plugin 6.14.0, sentry-native 0.15.2). The relevant code is unchanged in 8.61.0.\n\n### Steps to Reproduce\n\nThis is an intermittent race, not a deterministic repro.\n\n1. Enable Session Replay in session mode (`io.sentry.session-replay.session-sample-rate = 1.0`), default `PIXEL_COPY` screenshot strategy, NDK integration enabled.\n2. Run the app on an Android Emulator arm64 image: `system-images;android-37.1;google_apis_playstore_ps16k;arm64-v8a` (16 KB page size, Android 17, build `CP31.260623.012`), emulator 37.2.12.0, macOS / Apple Silicon host.\n3. Use the app normally while replay records segments (roughly one every 5 s).\n\nWe saw one crash after about 2 minutes (25 replay segments). An earlier 25-minute session (312 segments) did not crash.\n\n### Expected Result\n\nReleasing a replay segment's video encoder does not crash the process.\n\n### Actual Result\n\nNative crash on hwui's RenderThread while it destroys an EGL window surface. All frames are system/vendor code (no app frames):\n\n```\nSIGSEGV: Segfault (signalhandler, unhandled)\n\n\u003cunknown>                                           /system/lib64/libutils.so\nandroid::RefBase::incStrongRequireStrong            /system/lib64/libutils.so\nandroid::GraphicBuffer::from                        /system/lib64/libui.so\nandroid::Surface::hook_cancelBuffer                 /system/lib64/libgui.so\negl_window_surface_t::~egl_window_surface_t         /vendor/lib64/egl/libEGL_emulation.so\negl_window_surface_t::~egl_window_surface_t         /vendor/lib64/egl/libEGL_emulation.so\neglDestroySurface                                   /vendor/lib64/egl/libEGL_emulation.so\n\u003cunknown>                                           /system/lib64/libEGL.so\n\u003cunknown> x7                                        /system/lib64/libhwui.so\nandroid::Thread::_threadLoop                        /system/lib64/libutils.so\n\u003cunknown>                                           /system/lib64/libutils.so\n\u003cunknown> x2                                        /apex/com.android.runtime/lib64/bionic/libc.so\n```\n\nThe crash time lines up with the end of the last recorded replay segment: the replay for that session ends in the same second the native crash was captured.\n\n**Why we think `SimpleVideoEncoder` is the source.** The `libhwui` frames are not symbolicated, so this comes from the shape of the stack plus the timing, not a frame-by-frame match:\n\n- `SimpleVideoEncoder.encode()` draws each frame with `surface.lockHardwareCanvas()` on non-Xiaomi/Motorola/Unisoc devices ([SimpleVideoEncoder.kt#L201 @ 8.61.0](https://github.com/getsentry/sentry-java/blob/8.61.0/sentry-android-replay/src/main/java/io/sentry/android/replay/video/SimpleVideoEncoder.kt#L201)). That gives the `MediaCodec` input `Surface` a hwui context, which owns an EGL window surface on the RenderThread.\n- `SimpleVideoEncoder.release()` calls `mediaCodec.release()` before `surface?.release()` ([L313-L330 @ 8.61.0](https://github.com/getsentry/sentry-java/blob/8.61.0/sentry-android-replay/src/main/java/io/sentry/android/replay/video/SimpleVideoEncoder.kt#L313-L330)). So the hwui context's EGL surface is destroyed after the codec, which is the BufferQueue consumer, has already been released.\n- The emulator's EGL driver keeps a dequeued buffer on its window surface and cancels it in `~egl_window_surface_t`. By then the buffer behind it has already been freed, so `GraphicBuffer::from` → `incStrongRequireStrong` dereferences a dead object.\n\nThe emulator's `libEGL_emulation` is arguably at fault for touching a freed buffer. But the replay SDK is the code that creates and tears down this surface every few seconds, and only on the emulator does that become a process crash.\n\n### Possible fixes\n\nEither of these, or both, would remove the window:\n\n1. In `SimpleVideoEncoder.release()`, release the input `Surface` (which destroys its hwui context and EGL surface) **before** `mediaCodec.release()`, after `drainCodec(true)` / `mediaCodec.stop()`.\n2. Use `surface.lockCanvas(null)` instead of `lockHardwareCanvas()` on emulators, as is already done for Xiaomi, Motorola, and Unisoc. For example, check `Build.HARDWARE` for `ranchu` or `goldfish`, or `Build.FINGERPRINT` starting with `generic`/`google/sdk_gphone`.\n\nWe can test a patched build on the same emulator image if that helps.\n","author":{"url":"https://github.com/taziz23","@type":"Person","name":"taziz23"},"datePublished":"2026-10-19T00:28:30Z","url":"https://github.com/getsentry/sentry-java/issues/6279"}

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:326f541c-a2b9-b0b2-12bd-432b93be37fe
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8622:45E1A:1A946B:24E4D1:6B0466DB
html-safe-nonce4502856f7c110da058ccf10492faf50a8ec82b209189201c24abdf74996d9227
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NjIyOjQ1RTFBOjFBOTQ2QjoyNEU0RDE6NkIwNDY2REIiLCJ2aXNpdG9yX2lkIjoiMjM1MDg0MDYxMDI3NTIyMzI1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacae296c59764bc9cab04a183c5ecbe5ec1a993f7282dce94e8fcecfb256a2001a
hovercard-subject-tagissue:5915754679
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/6279/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b9fac82240a7b94ea8f73ec95ab1d9e3b331a3432296568c0b90595279481176/getsentry/sentry-java/issues/6279
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b9fac82240a7b94ea8f73ec95ab1d9e3b331a3432296568c0b90595279481176/getsentry/sentry-java/issues/6279
og:image:altIntegration sentry-android (Session Replay, sentry-android-replay) Build System Gradle AGP Version 9.3.1 Proguard Disabled (debug build) Other Error Monitoring Solution Firebase Crashlytics Version...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametaziz23
hostnamegithub.com
expected-hostnamegithub.com
None83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f
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
releaseca4d07a7cef4e4b75f821dc25e7300d80c1450a9
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-java/issues/6279#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-java%2Fissues%2F6279
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%2F6279
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/6279
Reloadhttps://github.com/getsentry/sentry-java/issues/6279
Reloadhttps://github.com/getsentry/sentry-java/issues/6279
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/6279
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-java/issues/6279
#6282https://github.com/getsentry/sentry-java/pull/6282
Session Replay: native SIGSEGV in eglDestroySurface (libEGL_emulation) when SimpleVideoEncoder releases its input surface on the Android emulatorhttps://github.com/getsentry/sentry-java/issues/6279#top
#6282https://github.com/getsentry/sentry-java/pull/6282
https://github.com/romtsn
AndroidSDKhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Android%22
BugIssue typehttps://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/taziz23
taziz23https://github.com/taziz23
on Oct 19, 2026https://github.com/getsentry/sentry-java/issues/6279#issue-5915754679
SimpleVideoEncoder.kt#L201 @ 8.61.0https://github.com/getsentry/sentry-java/blob/8.61.0/sentry-android-replay/src/main/java/io/sentry/android/replay/video/SimpleVideoEncoder.kt#L201
L313-L330 @ 8.61.0https://github.com/getsentry/sentry-java/blob/8.61.0/sentry-android-replay/src/main/java/io/sentry/android/replay/video/SimpleVideoEncoder.kt#L313-L330
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 Oct 19, 2026https://github.com/getsentry/sentry-java/issues/6279#event-33600117621
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Oct 19, 2026https://github.com/getsentry/sentry-java/issues/6279#issuecomment-6257087941
Linear Codehttps://linear.app
JAVA-780https://linear.app/getsentry/issue/JAVA-780
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Oct 19, 2026https://github.com/getsentry/sentry-java/issues/6279#event-33600120124
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Oct 19, 2026https://github.com/getsentry/sentry-java/issues/6279
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 Oct 19, 2026https://github.com/getsentry/sentry-java/issues/6279#event-33600122344
linear-codehttps://github.com/apps/linear-code
BugIssue typehttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Bug%22
Replayshttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Replays%22
AndroidSDKhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Android%22
on Oct 19, 2026https://github.com/getsentry/sentry-java/issues/6279#event-33600136316
https://github.com/romtsn
romtsnhttps://github.com/romtsn
on Oct 19, 2026https://github.com/getsentry/sentry-java/issues/6279#issuecomment-6265384329
#6282https://github.com/getsentry/sentry-java/pull/6282
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 Oct 19, 2026https://github.com/getsentry/sentry-java/issues/6279#event-33635192416
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Oct 19, 2026https://github.com/getsentry/sentry-java/issues/6279
romtsnhttps://github.com/romtsn
on Oct 21, 2026https://github.com/getsentry/sentry-java/issues/6279#event-33838736197
romtsnhttps://github.com/romtsn
completedhttps://github.com/getsentry/sentry-java/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#6282https://github.com/getsentry/sentry-java/pull/6282
on Oct 21, 2026https://github.com/getsentry/sentry-java/issues/6279#event-33866398372
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
on Oct 22, 2026https://github.com/getsentry/sentry-java/issues/6279#issuecomment-6336448125
GitHub Actionshttps://help.github.com/en/actions
#6282https://github.com/getsentry/sentry-java/pull/6282
8.61.1 releasehttps://github.com/getsentry/sentry-java/releases/tag/8.61.1
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-java/issues/6279
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-java/issues/6279
romtsnhttps://github.com/romtsn
AndroidSDKhttps://github.com/getsentry/sentry-java/issues?q=state%3Aopen%20label%3A%22Android%22
BugIssue typehttps://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.