Closed Bug 2093103 Opened 5 days ago Closed 4 days ago

Crash in [@ @0x0 | mozilla::gl::SharedSurface_AndroidHardwareBuffer::Create]

Categories

(Core :: Graphics, defect)

defect

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox-esr153 --- unaffected
firefox160 --- unaffected
firefox161 --- unaffected
firefox162 --- fixed

People

(Reporter: clouseau-bot, Assigned: sotaro)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: crash, regression)

Crash Data

Attachments

(1 external file)

Crash report: https://crash-stats.mozilla.org/report/index/02dd7666-efef-44b2-8736-d43690261115

Crash Reason:

SIGSEGV / SEGV_MAPERR at 0x0000000000000000

Top 10 frames:

0
1  libxul.so  mozilla::gl::SharedSurface_AndroidHardwareBuffer::Create(mozilla::gl::SharedSurf...  gfx/gl/SharedSurfaceAndroidHardwareBuffer.cpp:64
2  libxul.so  mozilla::gl::SurfaceFactory::CreateShared(mozilla::gfx::IntSizeTyped<mozilla::gf...  gfx/gl/SharedSurface.h:222
3  libxul.so  mozilla::gl::SwapChain::Acquire(mozilla::gfx::IntSizeTyped<mozilla::gfx::Unknown...  gfx/gl/GLScreenBuffer.cpp:44
4  libxul.so  mozilla::WebGLContext::PresentInto(mozilla::gl::SwapChain&)  dom/canvas/WebGLContext.cpp:1081
5  libxul.so  mozilla::WebGLContext::Present(mozilla::WebGLFramebuffer*, mozilla::layers::Text...  dom/canvas/WebGLContext.cpp:1259
6  libxul.so  mozilla::HostWebGLContext::Present(unsigned long, mozilla::layers::TextureType, ...  dom/canvas/HostWebGLContext.h:169
7  libxul.so  mozilla::MethodDispatcher<mozilla::WebGLMethodDispatcher, (unsigned long)54, voi...  dom/canvas/WebGLCommandQueue.h:258
8  libxul.so  mozilla::MethodDispatcher<mozilla::WebGLMethodDispatcher, (unsigned long)54, voi...  dom/canvas/WebGLCommandQueue.h:244
9  libxul.so  mozilla::dom::WebGLParent::RecvDispatchCommands(mozilla::ipc::BigBuffer&&, unsig...  dom/canvas/WebGLParent.cpp:80

There are 98 crashes (from 1 installation) in nightly 162 with buildid 20261115092657.

Crash-stats has no report of this signature on any earlier build, and Socorro's all-time signature index has no entry for it yet — as far as we can tell it is new with this build.

Clouseau analysis (automated). The mechanism below fits the evidence but is not proven end-to-end:

WebGL present in the GPU process jumps to address 0x0 while binding an AHardwareBuffer-backed EGLImage (gle->fEGLImageTargetTexture2D, SharedSurfaceAndroidHardwareBuffer.cpp:64), probably because the Android emulator's GLES translator mishandles the GPU-only buffers allocated since bug 2092364.

  1. WebGLContext::PresentInto → SwapChain::Acquire → SurfaceFactory::CreateShared reaches SharedSurface_AndroidHardwareBuffer::Create, which is the factory used whenever WebGL runs in the GPU process on Android.
  2. Since 4746460abfd3 that function allocates the buffer with only AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE | AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT; before, it also had CPU_READ_OFTEN | CPU_WRITE_OFTEN.
  3. Allocation and fCreateImage both succeed (execution passed both early returns).
  4. The bind fEGLImageTargetTexture2D(LOCAL_GL_TEXTURE_2D, image) then probably calls through a null pointer inside the emulator's GL stack, or the stored GL entry point is itself null.

The report fits: frame 0 is 0x0 with SEGV_MAPERR at 0x0, and frame 1 is line 64. All 98 reports share one fault address and one configuration (Android 37 sdk_gphone64_x86_64 emulator, "Android Emulator OpenGL ES Translator", one AMD CPU model). The signature has only been seen in this build, which includes the change landed two days earlier. Limits: frame 0 is unsymbolicated, so I could not observe which pointer is null. The defect probably lives in the emulator driver, with this change as the exposer rather than the root cause.

4746460abfd3 landed 2026-11-13 and is the latest change to SharedSurfaceAndroidHardwareBuffer.cpp; the previous ones touched fence and sync handling. Its diff changes the exact buffer passed to the crashing call. Blame on line 64 goes back to 5d0b26fcb7c2 (2020), so the bind code itself is old, and only its input changed in the window. The other window candidates (252098f85e42, 0ec2b7a88643 and backout 51227c406cb1) touch only WebGL state and linking.

Suspected regressor: 4746460abfd3 (gh) (bug 2092364) by :sotaro.

Impact

The GPU process crashes.

Possible fixes

  • Possibly keep the CPU usage flags (AndroidHardwareBuffer::kDefaultUsage) for WebGL buffers on the Android emulator / "OpenGL ES Translator" driver, or blocklist GPU-only usage there.
  • Possibly fall back to a non-AHB SharedSurface type on emulator GL renderers.

How to confirm

Run a WebGL page on the Android 37 x86_64 emulator with the GPU process, on builds before and after 4746460abfd3. If only the build with the change crashes in SharedSurface_AndroidHardwareBuffer::Create, the change is confirmed as the trigger. Check in a debugger whether mSymbols.fEGLImageTargetTexture2D is non-null, which tells a null Firefox entry point apart from a null call inside the driver.

Code references:

What the automated skeptic pass checked

In its own words (a pass means the check succeeded, which is not always support for the conclusion):

  • unverifiable mechanism — Frame 0 is unsymbolicated (0x0), and frame 1 was recovered by frame-pointer unwinding. So it is undecided whether Firefox's stored fEGLImageTargetTexture2D pointer is null or the emulator's GLES translator calls through a null pointer. Nothing in our code turns GPU-only usage into a null call, so this is most likely an emulator driver defect that the change exposed.
  • fail other_candidates — Changes WebGL color-write-mask state only (mColorWriteMasks). It does not touch the present / shared-surface path. Ruled out.
  • fail other_candidates — Validates attribute locations at link time; 51227c406cb1 is its backout. Neither touches SwapChain or SharedSurface. Ruled out.
  • pass hunk0 — Run inline, without the skeptic subagent. The diff changes the usage flags of the very buffer whose EGLImage is bound on the crashing line (stack pos 1, line 64). Picking the factory (SharedSurface.cpp line 131) depends only on running in the GPU process, not on usage, so the same call ran before the change with a CPU-mappable buffer.

:sotaro, can you have a look please?

Filed automatically by Clouseau with an LLM, from a submitted crash report: not an independent Mozilla discovery

Filed automatically by Clouseau, which analyses nightly crashes with an LLM. Nothing above was written or checked by a human. Please close it as INVALID if it is wrong — that is useful feedback, not a nuisance.

This is not an independent Mozilla discovery: the crash is known here only because somebody submitted the crash report linked at the top. If this duplicates an existing report, please resolve THIS bug as the duplicate and leave the credit with the earlier reporter.

Flags: needinfo?(sotaro.ikeda.g)

Set release status flags based on info from the regressing bug 2092364

Assignee: nobody → sotaro.ikeda.g
Flags: needinfo?(sotaro.ikeda.g)
Pushed by sikeda.birchill@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/582ade133ea3 https://hg.mozilla.org/integration/autoland/rev/a73953ad298a Preserve CPU access usage flags for WebGL AHardwareBuffers on Android emulators r=gfx-reviewers,lsalzman
Status: NEW → RESOLVED
Closed: 4 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: