Closed Bug 1799495 Opened 5 months ago Closed 5 months ago

Crash [@ OnReadback]

Categories

(Core :: Graphics: CanvasWebGL, defect)

x86_64
Linux
defect

Tracking

()

VERIFIED FIXED
108 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox106 --- wontfix
firefox107 --- wontfix
firefox108 --- verified

People

(Reporter: jkratzer, Assigned: lsalzman)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression, testcase, Whiteboard: [bugmon:bisected,confirmed])

Crash Data

Attachments

(2 files)

Testcase found while fuzzing mozilla-central rev 2db9822e6dd3 (built with: --enable-address-sanitizer --enable-fuzzing).

Testcase can be reproduced using the following commands:

$ pip install fuzzfetch grizzly-framework
$ python -m fuzzfetch --build 2db9822e6dd3 --asan --fuzzing -n firefox
$ python -m grizzly.replay ./firefox/firefox testcase.html
[@ OnReadback]

    =================================================================
    ==80285==ERROR: AddressSanitizer: SEGV on unknown address 0x0000000000b0 (pc 0x7f28c89a4bcd bp 0x7ffd7f4ec370 sp 0x7ffd7f4ec350 T0)
    ==80285==The signal is caused by a WRITE memory access.
    ==80285==Hint: address points to the zero page.
        #0 0x7f28c89a4bcd in OnReadback /dom/canvas/DrawTargetWebgl.h:129:25
        #1 0x7f28c89a4bcd in mozilla::gfx::DrawTargetWebgl::SharedContext::WaitForShmem() /dom/canvas/DrawTargetWebgl.cpp:3238:30
        #2 0x7f28c89bea60 in mozilla::gfx::DrawTargetWebgl::MarkSkiaChanged(mozilla::gfx::DrawOptions const&) /dom/canvas/DrawTargetWebgl.cpp:3244:5
        #3 0x7f28c89d170f in mozilla::gfx::DrawTargetWebgl::DrawFilter(mozilla::gfx::FilterNode*, mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, float> const&, mozilla::gfx::PointTyped<mozilla::gfx::UnknownUnits, float> const&, mozilla::gfx::DrawOptions const&) /dom/canvas/DrawTargetWebgl.cpp:3494:3
        #4 0x7f28c56ccbc0 in mozilla::gfx::FilterSupport::RenderFilterDescription(mozilla::gfx::DrawTarget*, mozilla::gfx::FilterDescription const&, mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, float> const&, mozilla::gfx::SourceSurface*, mozilla::gfx::IntRectTyped<mozilla::gfx::UnknownUnits> const&, mozilla::gfx::SourceSurface*, mozilla::gfx::IntRectTyped<mozilla::gfx::UnknownUnits> const&, mozilla::gfx::SourceSurface*, mozilla::gfx::IntRectTyped<mozilla::gfx::UnknownUnits> const&, nsTArray<RefPtr<mozilla::gfx::SourceSurface> >&, mozilla::gfx::PointTyped<mozilla::gfx::UnknownUnits, float> const&, mozilla::gfx::DrawOptions const&) /gfx/src/FilterSupport.cpp:1351:8
        #5 0x7f28c8b01c8a in mozilla::dom::AdjustedTargetForFilter::~AdjustedTargetForFilter() /dom/canvas/CanvasRenderingContext2D.cpp:456:5
        #6 0x7f28c8a0813f in operator() /builds/worker/workspace/obj-build/dist/include/mozilla/UniquePtr.h:459:5
        #7 0x7f28c8a0813f in reset /builds/worker/workspace/obj-build/dist/include/mozilla/UniquePtr.h:301:7
        #8 0x7f28c8a0813f in mozilla::dom::AdjustedTarget::~AdjustedTarget() /dom/canvas/CanvasRenderingContext2D.cpp:664:19
        #9 0x7f28c8a058f1 in mozilla::dom::CanvasRenderingContext2D::FillRect(double, double, double, double) /dom/canvas/CanvasRenderingContext2D.cpp:2779:1
        #10 0x7f28c7935cea in mozilla::dom::CanvasRenderingContext2D_Binding::fillRect(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/CanvasRenderingContext2DBinding.cpp:6091:24
        #11 0x7f28c8840e0f in bool mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::NormalThisPolicy, mozilla::dom::binding_detail::ThrowExceptions>(JSContext*, unsigned int, JS::Value*) /dom/bindings/BindingUtils.cpp:3287:13
        #12 0x7f28d312e8d3 in CallJSNative /js/src/vm/Interpreter.cpp:459:13
        #13 0x7f28d312e8d3 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:547:12
        #14 0x7f28d311d207 in InternalCall /js/src/vm/Interpreter.cpp:614:10
        #15 0x7f28d311d207 in CallFromStack /js/src/vm/Interpreter.cpp:619:10
        #16 0x7f28d311d207 in Interpret(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:3375:16
        #17 0x7f28d310277e in js::RunScript(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:431:13
        #18 0x7f28d312e9f5 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:579:13
        #19 0x7f28d313049e in InternalCall /js/src/vm/Interpreter.cpp:614:10
        #20 0x7f28d313049e in js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>, js::CallReason) /js/src/vm/Interpreter.cpp:646:8
        #21 0x7f28d1aa4714 in js::CallSelfHostedFunction(JSContext*, JS::Handle<js::PropertyName*>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>) /js/src/vm/SelfHosting.cpp:1488:10
        #22 0x7f28d16f0f41 in AsyncFunctionResume(JSContext*, JS::Handle<js::AsyncFunctionGeneratorObject*>, ResumeKind, JS::Handle<JS::Value>) /js/src/vm/AsyncFunction.cpp:154:8
        #23 0x7f28d19cd67e in AsyncFunctionPromiseReactionJob(JSContext*, JS::Handle<PromiseReactionRecord*>) /js/src/builtin/Promise.cpp:2111:12
        #24 0x7f28d19cb474 in PromiseReactionJob(JSContext*, unsigned int, JS::Value*) /js/src/builtin/Promise.cpp:2174:12
        #25 0x7f28d312e8d3 in CallJSNative /js/src/vm/Interpreter.cpp:459:13
        #26 0x7f28d312e8d3 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:547:12
        #27 0x7f28d313049e in InternalCall /js/src/vm/Interpreter.cpp:614:10
        #28 0x7f28d313049e in js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>, js::CallReason) /js/src/vm/Interpreter.cpp:646:8
        #29 0x7f28d172d2c5 in JS::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::HandleValueArray const&, JS::MutableHandle<JS::Value>) /js/src/vm/CallAndConstruct.cpp:117:10
        #30 0x7f28c759634c in mozilla::dom::PromiseJobCallback::Call(mozilla::dom::BindingCallContext&, JS::Handle<JS::Value>, mozilla::ErrorResult&) /builds/worker/workspace/obj-build/dom/bindings/PromiseBinding.cpp:83:8
        #31 0x7f28c32e2dd7 in Call /builds/worker/workspace/obj-build/dist/include/mozilla/dom/PromiseBinding.h:198:12
        #32 0x7f28c32e2dd7 in Call /builds/worker/workspace/obj-build/dist/include/mozilla/dom/PromiseBinding.h:211:12
        #33 0x7f28c32e2dd7 in mozilla::PromiseJobRunnable::Run(mozilla::AutoSlowOperation&) /xpcom/base/CycleCollectedJSContext.cpp:213:18
        #34 0x7f28c32c34d7 in mozilla::CycleCollectedJSContext::PerformMicroTaskCheckPoint(bool) /xpcom/base/CycleCollectedJSContext.cpp:676:17
        #35 0x7f28c32c452f in mozilla::CycleCollectedJSContext::AfterProcessTask(unsigned int) /xpcom/base/CycleCollectedJSContext.cpp:463:3
        #36 0x7f28c4fb1790 in XPCJSContext::AfterProcessTask(unsigned int) /js/xpconnect/src/XPCJSContext.cpp:1480:28
        #37 0x7f28c35048b8 in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1241:24
        #38 0x7f28c350ee14 in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:465:10
        #39 0x7f28c4cc51ef in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:85:21
        #40 0x7f28c4b41ed1 in RunInternal /ipc/chromium/src/base/message_loop.cc:381:10
        #41 0x7f28c4b41ed1 in RunHandler /ipc/chromium/src/base/message_loop.cc:374:3
        #42 0x7f28c4b41ed1 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:356:3
        #43 0x7f28cc0461d7 in nsBaseAppShell::Run() /widget/nsBaseAppShell.cpp:150:27
        #44 0x7f28d1256c37 in XRE_RunAppShell() /toolkit/xre/nsEmbedFunctions.cpp:884:20
        #45 0x7f28c4b41ed1 in RunInternal /ipc/chromium/src/base/message_loop.cc:381:10
        #46 0x7f28c4b41ed1 in RunHandler /ipc/chromium/src/base/message_loop.cc:374:3
        #47 0x7f28c4b41ed1 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:356:3
        #48 0x7f28d1255d23 in XRE_InitChildProcess(int, char**, XREChildData const*) /toolkit/xre/nsEmbedFunctions.cpp:743:34
        #49 0x5634ecd6e6b5 in content_process_main(mozilla::Bootstrap*, int, char**) /browser/app/../../ipc/contentproc/plugin-container.cpp:57:28
        #50 0x5634ecd6eb07 in main /browser/app/nsBrowserApp.cpp:357:18
        #51 0x7f28ebbd6d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
        #52 0x7f28ebbd6e3f in __libc_start_main csu/../csu/libc-start.c:392:3
        #53 0x5634eccaea19 in _start (/home/jkratzer/builds/m-c-20221031214452-fuzzing-asan-opt/firefox+0x7aa19) (BuildId: a3b6dbd004682c6755802e59474064f859bfb56b)
    
    AddressSanitizer can not provide additional info.
    SUMMARY: AddressSanitizer: SEGV /dom/canvas/DrawTargetWebgl.h:129:25 in OnReadback
    ==80285==ABORTING
Attached file Testcase

Verified bug as reproducible on mozilla-central 20221107212933-df541ee6f622.
The bug appears to have been introduced in the following build range:

Start: 323335d5c537309f05efa246f42867b703a72914 (20220912130638)
End: a389830fb63fdeb737154791ab1d199cd9082e1d (20220912163432)
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=323335d5c537309f05efa246f42867b703a72914&tochange=a389830fb63fdeb737154791ab1d199cd9082e1d

Keywords: regression
Whiteboard: [bugmon:confirm] → [bugmon:bisected,confirmed]
Crash Signature: [@ OnReadback] → [@ OnReadback] [@ mozilla::gfx::DrawTargetWebgl::UsageProfile::OnReadback ]
Flags: needinfo?(lsalzman)
Regressed by: 1789849

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

Flags: needinfo?(lsalzman)
Assignee: nobody → lsalzman
Status: NEW → ASSIGNED

We are in RC week, wontfix 106.

Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c5112a80ad2f
Ensure WaitForShmem has a valid DrawTargetWebgl to access. r=aosmond
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch

Verified bug as fixed on rev mozilla-central 20221108213602-ca4db8d37ef9.
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.

Status: RESOLVED → VERIFIED
Keywords: bugmon
You need to log in before you can comment on or make changes to this bug.