Closed Bug 1722422 Opened 1 year ago Closed 7 months ago

Assertion failure: !mRawPtr, at /builds/worker/workspace/obj-build/dist/include/mozilla/AlreadyAddRefed.h:129

Categories

(Core :: Graphics: ImageLib, defect)

defect

Tracking

()

RESOLVED FIXED
99 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox92 --- wontfix
firefox97 --- wontfix
firefox98 --- wontfix
firefox99 --- fixed

People

(Reporter: tsmith, Assigned: tnikkel)

References

(Blocks 1 open bug, Regression)

Details

(4 keywords, Whiteboard: [stockwell unknown])

Attachments

(3 files)

Attached file testcase.html

Found while fuzzing m-c 20210724-8117cf719533 (--enable-debug --enable-fuzzing)

Assertion failure: !mRawPtr, at /builds/worker/workspace/obj-build/dist/include/mozilla/AlreadyAddRefed.h:129

#0 0x7ff0973f901d in ~already_AddRefed /builds/worker/workspace/obj-build/dist/include/mozilla/AlreadyAddRefed.h:129:5
#1 0x7ff0973f901d in DropImageReference src/image/DecodedSurfaceProvider.cpp:46:3
#2 0x7ff0973f901d in mozilla::image::DecodedSurfaceProvider::FinishDecoding() src/image/DecodedSurfaceProvider.cpp:200:3
#3 0x7ff0973f8638 in mozilla::image::DecodedSurfaceProvider::Run() src/image/DecodedSurfaceProvider.cpp:129:5
#4 0x7ff097413283 in mozilla::image::DecodingTask::Run() src/image/DecodePool.cpp:146:12
#5 0x7ff095a303af in mozilla::TaskController::RunPoolThread() src/xpcom/threads/TaskController.cpp:287:33
#6 0x7ff0aa6d6ac7 in _pt_root src/nsprpub/pr/src/pthreads/ptthread.c:201:5
#7 0x7ff0ab451608 in start_thread /build/glibc-eX1tMB/glibc-2.31/nptl/pthread_create.c:477:8
#8 0x7ff0ab01a292 in clone /build/glibc-eX1tMB/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Flags: in-testsuite?
Attached image sample.jpg

Couldn't reproduce in a regular debug opt build. The function checks that the image is not null at the start, so maybe we are racing with another thread that clears mImage?

Severity: -- → S4
Priority: -- → P5

Update:
There have been 34 failures within the last 7 days:
• 14 failures on Linux 18.04 x64 WebRender debug
• 7 failures on OS X 10.15 WebRender debug
• 4 failures on Windows 10 x86 2004 WebRender debug
• 9 failures on Windows 10 x64 2004 WebRender debug
Recent failure log: https://treeherder.mozilla.org/logviewer?job_id=368503598&repo=mozilla-central&lineNumber=68181

[task 2022-02-19T22:55:48.366Z] 22:55:48     INFO - TEST-START | netwerk/test/browser/browser_opaque_response_blocking_telemetry.js
[task 2022-02-19T22:55:48.367Z] 22:55:48     INFO - GECKO(3608) | Chrome file doesn't exist: /opt/worker/tasks/task_164530920033008/build/tests/mochitest/browser/netwerk/test/browser/head.js
[task 2022-02-19T22:55:48.370Z] 22:55:48     INFO - GECKO(3608) | [Child 3623, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x804B0050 (NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS): file /builds/worker/checkouts/gecko/toolkit/components/antitracking/URLQueryStringStripper.cpp:129
[task 2022-02-19T22:55:48.371Z] 22:55:48     INFO - GECKO(3608) | [Child 3622, Main Thread] WARNING: IPC message 'PIdleScheduler::Msg_StartedGC' discarded: actor cannot send: file /builds/worker/checkouts/gecko/ipc/glue/ProtocolUtils.cpp:498
[task 2022-02-19T22:55:48.371Z] 22:55:48     INFO - GECKO(3608) | [Child 3621, Main Thread] WARNING: IPC message 'PIdleScheduler::Msg_StartedGC' discarded: actor cannot send: file /builds/worker/checkouts/gecko/ipc/glue/ProtocolUtils.cpp:498
[task 2022-02-19T22:55:48.373Z] 22:55:48     INFO - GECKO(3608) | [Child 3623, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x804B0050 (NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS): file /builds/worker/checkouts/gecko/toolkit/components/antitracking/URLQueryStringStripper.cpp:129
[task 2022-02-19T22:55:48.375Z] 22:55:48     INFO - GECKO(3608) | [Child 3622, Main Thread] WARNING: IPC message 'PIdleScheduler::Msg_DoneGC' discarded: actor cannot send: file /builds/worker/checkouts/gecko/ipc/glue/ProtocolUtils.cpp:498
[task 2022-02-19T22:55:48.376Z] 22:55:48     INFO - GECKO(3608) | [Child 3621, Main Thread] WARNING: IPC message 'PIdleScheduler::Msg_DoneGC' discarded: actor cannot send: file /builds/worker/checkouts/gecko/ipc/glue/ProtocolUtils.cpp:498
[task 2022-02-19T22:55:48.377Z] 22:55:48     INFO - GECKO(3608) | [Child 3622: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 2 (10cf9f6a0) [pid = 3622] [serial = 1] [outer = 0] [url = https://example.com/browser/netwerk/test/browser/dummy.html]
[task 2022-02-19T22:55:48.378Z] 22:55:48     INFO - GECKO(3608) | [Child 3622: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 1 (115e1c400) [pid = 3622] [serial = 2] [outer = 0] [url = about:blank]
[task 2022-02-19T22:55:48.378Z] 22:55:48     INFO - GECKO(3608) | [Child 3621: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 2 (100d9f6a0) [pid = 3621] [serial = 1] [outer = 0] [url = https://example.com/browser/netwerk/test/browser/dummy.html]
[task 2022-02-19T22:55:48.379Z] 22:55:48     INFO - GECKO(3608) | [Child 3622: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 0 (115e23c00) [pid = 3622] [serial = 3] [outer = 0] [url = https://example.com/browser/netwerk/test/browser/dummy.html]
[task 2022-02-19T22:55:48.379Z] 22:55:48     INFO - GECKO(3608) | [Child 3621: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 1 (117737400) [pid = 3621] [serial = 2] [outer = 0] [url = about:blank]
[task 2022-02-19T22:55:48.380Z] 22:55:48     INFO - GECKO(3608) | [Child 3621: Main Thread]: I/DocShellAndDOMWindowLeak --DOMWINDOW == 0 (11773ec00) [pid = 3621] [serial = 3] [outer = 0] [url = https://example.com/browser/netwerk/test/browser/dummy.html]
[task 2022-02-19T22:55:48.381Z] 22:55:48     INFO - GECKO(3608) | [Child 3622, Main Thread] WARNING: Extra shutdown CC: 'i < NORMAL_SHUTDOWN_COLLECTIONS', file /builds/worker/checkouts/gecko/xpcom/base/nsCycleCollector.cpp:3359
[task 2022-02-19T22:55:48.381Z] 22:55:48     INFO - GECKO(3608) | [Child 3621, Main Thread] WARNING: Extra shutdown CC: 'i < NORMAL_SHUTDOWN_COLLECTIONS', file /builds/worker/checkouts/gecko/xpcom/base/nsCycleCollector.cpp:3359
[task 2022-02-19T22:55:48.382Z] 22:55:48     INFO - GECKO(3608) | [Child 3622, Main Thread] WARNING: IPC message 'PIdleScheduler::Msg_StartedGC' discarded: actor cannot send: file /builds/worker/checkouts/gecko/ipc/glue/ProtocolUtils.cpp:498
<...>
[task 2022-02-19T22:55:57.780Z] 22:55:57     INFO - GECKO(3608) | ###!!! [Parent][PCompositorManagerParent] Error: RunMessage(msgname=PCompositorBridge::Msg___delete__) Channel closing: too late to send/recv, messages will be lost
[task 2022-02-19T22:55:57.781Z] 22:55:57     INFO - GECKO(3608) | MEMORY STAT | vsize 17185MB | residentFast 440MB | heapAllocated 127MB
[task 2022-02-19T22:55:57.782Z] 22:55:57     INFO - TEST-OK | netwerk/test/browser/browser_opaque_response_blocking_telemetry.js | took 9415ms
[task 2022-02-19T22:55:57.783Z] 22:55:57     INFO - GECKO(3608) | [Child 3648, Main Thread] WARNING: IPC message 'PIdleScheduler::Msg_StartedGC' discarded: actor cannot send: file /builds/worker/checkouts/gecko/ipc/glue/ProtocolUtils.cpp:498
[task 2022-02-19T22:55:57.788Z] 22:55:57     INFO - GECKO(3608) | [Child 3616: Main Thread]: I/DocShellAndDOMWindowLeak ++DOCSHELL 116517800 == 1 [pid = 3616] [id = 3]
[task 2022-02-19T22:55:57.788Z] 22:55:57     INFO - GECKO(3608) | [Child 3616: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 4 (10d69f6a0) [pid = 3616] [serial = 7] [outer = 0]
[task 2022-02-19T22:55:57.789Z] 22:55:57     INFO - GECKO(3608) | [Child 3616: Main Thread]: I/DocShellAndDOMWindowLeak ++DOMWINDOW == 5 (116519400) [pid = 3616] [serial = 8] [outer = 10d69f6a0]
[task 2022-02-19T22:55:57.789Z] 22:55:57     INFO - GECKO(3608) | Assertion failure: !mRawPtr, at /builds/worker/workspace/obj-build/dist/include/mozilla/AlreadyAddRefed.h:133
[task 2022-02-19T22:55:57.791Z] 22:55:57     INFO - GECKO(3608) | [Parent 3608, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x804B0050 (NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS): file /builds/worker/checkouts/gecko/toolkit/components/antitracking/URLQueryStringStripper.cpp:129
[task 2022-02-19T22:55:57.792Z] 22:55:57     INFO - GECKO(3608) | #01: mozilla::image::DecodedSurfaceProvider::FinishDecoding() [image/DecodedSurfaceProvider.cpp:202]
[task 2022-02-19T22:55:57.793Z] 22:55:57     INFO - GECKO(3608) | #02: mozilla::image::DecodedSurfaceProvider::Run() [image/DecodedSurfaceProvider.cpp:131]
[task 2022-02-19T22:55:57.793Z] 22:55:57     INFO - GECKO(3608) | #03: mozilla::image::DecodingTask::Run() [image/DecodePool.cpp:147]
[task 2022-02-19T22:55:57.794Z] 22:55:57     INFO - GECKO(3608) | #04: mozilla::TaskController::RunPoolThread() [xpcom/threads/TaskController.cpp:256]
[task 2022-02-19T22:55:58.014Z] 22:55:58     INFO - GECKO(3608) | #05: _pt_root [nsprpub/pr/src/pthreads/ptthread.c:204]
[task 2022-02-19T22:55:58.015Z] 22:55:58     INFO - GECKO(3608) | #06: _pthread_start [/usr/lib/system/libsystem_pthread.dylib + 0x6109]
[task 2022-02-19T22:55:58.015Z] 22:55:58     INFO - GECKO(3608) | [Child 3616, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x804B0050 (NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS): file /builds/worker/checkouts/gecko/toolkit/components/antitracking/URLQueryStringStripper.cpp:129
[task 2022-02-19T22:55:58.016Z] 22:55:58     INFO - GECKO(3608) | [Child 3616, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x804B0050 (NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS): file /builds/worker/checkouts/gecko/toolkit/components/antitracking/URLQueryStringStripper.cpp:129
[task 2022-02-19T22:55:58.016Z] 22:55:58     INFO - checking window state
[task 2022-02-19T22:55:58.017Z] 22:55:58     INFO - TEST-START | netwerk/test/browser/browser_post_auth.js
Whiteboard: [stockwell needswork:owner]

Hi Andrew! Can you please take a look at this? Maybe you could help us assign it to someone.
Thank you!

Any chance it's not too hard to get a pernosco of this?

Flags: needinfo?(twsmith)

Seems to be always after netwerk/test/browser/browser_opaque_response_blocking_telemetry.js.

(In reply to Timothy Nikkel (:tnikkel) from comment #2)

Couldn't reproduce in a regular debug opt build. The function checks that the image is not null at the start, so maybe we are racing with another thread that clears mImage?

This was off base. The assert is that the mRawPtr is non-null when the already_AddRefed object is destructed.

Caused by bug 1719108, this is the intentional leak we want to cause from that changeset. The fix is to change the code so we don't assert when we hit this.

Flags: needinfo?(twsmith)
Regressed by: 1719108

Destroying an already_AddRefed if it holds a non-null pointers asserts because it leaks. But we want the leak here, so leak in a way that doesn't assert.

Assignee: nobody → tnikkel
Status: NEW → ASSIGNED

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

Pushed by tnikkel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9dfa7711709f
Change code in SurfaceCache::ReleaseImageOnMainThread so that it doesn't assert. r=aosmond

Backed out for causing build bustages on SurfaceCache.cpp

Backout link : https://hg.mozilla.org/integration/autoland/rev/b78ad54c77d934c786f72303b68304c6f32d6214

Push with failures : https://treeherder.mozilla.org/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception%2Crunnable&revision=9dfa7711709fff4f1494bdb426714a8d365da54f&selectedTaskRun=ZQOeOdYaS_2hMyh7py0Y4Q.0

Link to failure log : https://treeherder.mozilla.org/logviewer?job_id=368762016&repo=autoland&lineNumber=16697

Failure message: /builds/worker/checkouts/gecko/image/SurfaceCache.cpp:1887:19: error: unused variable 'intentionalLeak' [-Werror,-Wunused-variable]

Flags: needinfo?(tnikkel)
Flags: needinfo?(tnikkel)
Pushed by tnikkel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e061f92d6079
Change code in SurfaceCache::ReleaseImageOnMainThread so that it doesn't assert. r=aosmond
Regressions: 1756696
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch
See Also: → 1757282
You need to log in before you can comment on or make changes to this bug.