You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On iOS, entering a WebXR/AR session crashes with EXC_BAD_ACCESS (SIGSEGV) inside NativeXr::Impl::BeginUpdate. The framebuffer-creation continuation dereferences GraphicsContext.GetActiveEncoder(), which returns nullptr because it runs on the runtime thread with no frame in flight. This reproduces in the stock iOS Playground and appears to be a regression from the threading rework (#1652).
In Plugins/NativeXr/Source/NativeXrImpl.cpp, BeginUpdate() creates the per-view framebuffers inside a .then(m_runtimeScheduler, ...) continuation and then does the WebXR implicit clear:
DeviceContext::GetActiveEncoder() returns DeviceImpl::m_frameEncoder, which is only non-null between frame start/end on the render thread. This continuation runs on the runtime thread with no frame in flight, so GetActiveEncoder() returns nullptr and the dereference crashes.
Before #1652 this used an explicitly-acquired encoder that was always valid:
#1652 (6bb80141, "Reworked threading model") replaced the UpdateToken encoder with GraphicsContext.GetActiveEncoder() and removed the Update/UpdateToken API.
Regression range
Works:≤ ff9d4dbc (2026-06-08, the commit before the threading rework)
The creation-time clear needs a valid encoder. Options:
Guard the clear on a non-null active encoder. On ARKit/ARCore the camera feed pre-composites (requiresAppClear == false), so skipping this one-time implicit clear when no encoder is active is visually safe there:
(This unblocks ARKit, but likely leaves the initial clear missing for backends that don't pre-composite, e.g. OpenXR.)
A more complete fix would acquire/attach a valid encoder for this creation-time clear (or defer the implicit clear to the first frame on the render thread) so it works across all backends.
Happy to open a PR for option 1 if that's an acceptable stopgap.
Summary
On iOS, entering a WebXR/AR session crashes with
EXC_BAD_ACCESS (SIGSEGV)insideNativeXr::Impl::BeginUpdate. The framebuffer-creation continuation dereferencesGraphicsContext.GetActiveEncoder(), which returnsnullptrbecause it runs on the runtime thread with no frame in flight. This reproduces in the stock iOS Playground and appears to be a regression from the threading rework (#1652).Environment
master@64f545de(also present on every commit since Reworked threading model. #1652)Apps/Playground(iOS), built viacmake -B build -G Xcode -D IOS=ONRepro
Apps/Playground/Scripts/experience.js, setconst ar = true;enterXRAsync("immersive-ar", ...)path, ~5s after load) the app crashes immediately.Crash
Root cause
In
Plugins/NativeXr/Source/NativeXrImpl.cpp,BeginUpdate()creates the per-view framebuffers inside a.then(m_runtimeScheduler, ...)continuation and then does the WebXR implicit clear:DeviceContext::GetActiveEncoder()returnsDeviceImpl::m_frameEncoder, which is only non-null between frame start/end on the render thread. This continuation runs on the runtime thread with no frame in flight, soGetActiveEncoder()returnsnullptrand the dereference crashes.Before #1652 this used an explicitly-acquired encoder that was always valid:
// pre-#1652 frameBuffer.Clear(*m_sessionState->Update.GetUpdateToken().GetEncoder(), ...);#1652 (
6bb80141, "Reworked threading model") replaced theUpdateTokenencoder withGraphicsContext.GetActiveEncoder()and removed theUpdate/UpdateTokenAPI.Regression range
≤ ff9d4dbc(2026-06-08, the commit before the threading rework)6bb80141(Reworked threading model. #1652, 2026-06-09) throughmastertip (64f545de)Suggested fix
The creation-time clear needs a valid encoder. Options:
requiresAppClear == false), so skipping this one-time implicit clear when no encoder is active is visually safe there:Happy to open a PR for option 1 if that's an acceptable stopgap.