Closed Bug 1829542 Opened 2 years ago Closed 1 years ago

VAAPI/Intel: `GlobalRefRelease failed: already zero reference! UID` is printed to Dmabuf log

Categories

(Core :: Graphics, defect)

x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
115 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox112 --- disabled
firefox113 --- disabled
firefox114 --- disabled
firefox115 --- fixed

People

(Reporter: jan, Assigned: stransky)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: nightly-community, regression)

Crash Data

Attachments

(7 files)

Attached file aboutsupport.txt
  1. Play the video for some seconds.
  2. Pause video.
  3. Wait some seconds.
  4. GlobalRefRelease failed: already zero reference! UID is printed to Dmabuf log.

MOZ_LOG="PlatformDecoderModule:5 Dmabuf:5" mozregression --launch 2023-04-23 -P stdout -a https://bug1619882.bmoattachments.org/attachment.cgi?id=9149605

0:38.64 INFO: b'[Parent 13209: Compositor]: D/Dmabuf DMABufSurface::ReleaseDMABuf() UID 6'
0:38.64 INFO: b'[Parent 13209: Compositor]: D/Dmabuf DMABufSurface::GlobalRefRelease UID 6'
0:38.64 INFO: b'[Child 13335: MediaPDecoder #1]: D/PlatformDecoderModule RemoteMediaDataDecoder[7f4ebc7706d0] ::~RemoteMediaDataDecoder: 7f4ebc7706d0 is released'
0:38.64 INFO: b'[Child 13335: RemVidChild]: D/PlatformDecoderModule RemoteMediaDataDecoder[7f4ebc770430] ::~RemoteMediaDataDecoder: 7f4ebc770430 is released'
0:38.64 INFO: b'[RDD 13403: MediaPDecoder #2]: D/Dmabuf VideoFrameSurface: deleting dmabuf surface UID 3'
0:38.64 INFO: b'[RDD 13403: MediaPDecoder #2]: D/Dmabuf VideoFrameSurface: VAAPI releasing dmabuf surface UID 3 FFMPEG ID 0xf aForFrameRecycle 0 mLib 7f19d73ca1b8 mAVHWFrameContext 7f19b2619240 mHWAVBuffer 7f19b2619280'
0:38.64 INFO: b'[RDD 13403: MediaPDecoder #2]: D/Dmabuf DMABufSurfaceYUV::ReleaseSurface() UID 3'
0:38.64 INFO: b'[RDD 13403: MediaPDecoder #2]: D/Dmabuf DMABufSurfaceYUV::ReleaseTextures() UID 3'
0:38.64 INFO: b'[RDD 13403: MediaPDecoder #2]: D/Dmabuf DMABufSurface::ReleaseDMABuf() UID 3'
0:38.64 INFO: b'[RDD 13403: MediaPDecoder #2]: D/Dmabuf DMABufSurface::GlobalRefRelease UID 3'
0:38.64 INFO: b'[RDD 13403: MediaPDecoder #2]: D/Dmabuf GlobalRefRelease failed: already zero reference! UID 3'
0:38.64 INFO: b'[RDD 13403: MediaPDecoder #2]: D/Dmabuf VideoFrameSurface: deleting dmabuf surface UID 4'
0:38.64 INFO: b'[RDD 13403: MediaPDecoder #2]: D/Dmabuf VideoFrameSurface: VAAPI releasing dmabuf surface UID 4 FFMPEG ID 0x10 aForFrameRecycle 0 mLib 7f19d73ca1b8 mAVHWFrameCon

MOZ_LOG="PlatformDecoderModule:5 Dmabuf:5" mozregression --good 2023-01-23 --bad 2023-04-23 -P stdout -a https://bug1619882.bmoattachments.org/attachment.cgi?id=9149605

8:46.03 INFO: Last good revision: ce20888662f791f3c22fd361d56d761642e259ec
8:46.03 INFO: First bad revision: cf328273030f09826f924b6d6300981ecc8cbbdd
8:46.03 INFO: Pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=ce20888662f791f3c22fd361d56d761642e259ec&tochange=cf328273030f09826f924b6d6300981ecc8cbbdd

cf328273030f09826f924b6d6300981ecc8cbbdd stransky — Bug 1809026 [Linux] Set Debug log ffmpeg level for VA-API decoding r=alwu
77034005a42a5c11cb15a551aeab7e097fd23bfd stransky — Bug 1809026 [Linux] Check and log FFMPEG HW surfaces ID so we're sure we don't use the same surface twice r=alwu
602247c99125ff2e328f9aaa1ef28b0a51bd5822 stransky — Bug 1809026 [Linux] Move global DMABufSurface management from VideoFrameSurface to DMABUFSurfaceImage r=alwu
31d23318230a0f6cc2bc699a0ce5dbee4c3078f7 stransky — Bug 1809026 [Linux] Reference DMABufSurface when it's created/imported r=emilio

That change also caused bug 1820827.

mozregression --repo autoland --launch cf328273030f09826f924b6d6300981ecc8cbbdd -a about:support

Flags: needinfo?(stransky)

MOZ_LOG="PlatformDecoderModule:5 Dmabuf:5" mozregression --repo autoland --launch cf328273030f09826f924b6d6300981ecc8cbbdd -P stdout -a https://bug1619882.bmoattachments.org/attachment.cgi?id=9149605 > bug1829542_firstbad.txt

MOZ_LOG="PlatformDecoderModule:5 Dmabuf:5" mozregression --repo autoland --launch ce20888662f791f3c22fd361d56d761642e259ec -P stdout -a https://bug1619882.bmoattachments.org/attachment.cgi?id=9149605 > bug1829542_lastgood.txt

That happens when video frames are copied on Intel. Need to check that.

This bug seems like it belongs more in Media rather than Graphics if I am reading correctly? Or is the video frame copy distinctly on the graphics side of this?

Severity: -- → S3

Yes, this one involves linux dmabuf implementation.

Flags: needinfo?(stransky)

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

Assignee: nobody → stransky
Duplicate of this bug: 1820827
  • Remove GlobalRefRelease() from GlobalRefCountDelete(). It matches current scenario where GlobalRefCountCreate() is created an unreferenced counter
    so we also should delete it without unref.
  • Call explicitly GlobalRefCountDelete() from ~VideoFrameSurface() to avoid bogus error messages. DMABufSurface may be used by other parts of gecko
    even when video decoder is deleted so we don't care about DMABufSurface ref state here.
  • Explicitly call GlobalRefRelease()/GlobalRefCountDelete() from ~DMABufSurface(). That matches DMABufSurface() life time scenario:
    • GlobalRefAdd/GlobalRefRelease in DMABUFSurfaceImage class / RDD process.
    • GlobalRefCountImport()/~DMABufSurface() if DMABufSurface is transfered via. IPC bridge to content/render/compositor process.
  • Add DmabufRef MOZ_LOG

Depends on D178282

  • Explicitly track used VideoFrameSurface by mUsed.
  • Don't crash if we recycle used dmabuf surface but throw a warning instead. Such scenario produces only visual glitches so no need to hard fail.
  • Set mFFMPEGSurfaceID for copied dmabuf surfaces too.

Depends on D178283

Copying crash signatures from duplicate bugs.

Crash Signature: [@ mozilla::VideoFrameSurface<T>::ReleaseVAAPIData]

The severity field for this bug is set to S3. However, the following bug duplicate has higher severity:

:stransky, could you consider increasing the severity of this bug to S2?

For more information, please visit BugBot documentation.

Flags: needinfo?(stransky)
Severity: S3 → S2
Flags: needinfo?(stransky)
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/5be595679856 [Linux] Disable copy of DMABufSurface class r=emilio https://hg.mozilla.org/integration/autoland/rev/a9c9ea4457af [Linux] Remove GlobalRefRelease() from GlobalRefCountDelete() r=emilio https://hg.mozilla.org/integration/autoland/rev/865ab9a041f5 [Linux] Track used VideoFrameSurface in VideoFramePool r=alwu
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/fe5b634984da [Linux] Track VideoFrameSurface by mFFMPEGSurfaceID and use Maybe class instead of integer r=alwu
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: