Closed Bug 1628359 Opened 6 years ago Closed 6 years ago

Hit MOZ_CRASH(invalid UTF-8 string: ReportInvalidCharacter) at /builds/worker/checkouts/gecko/js/src/vm/CharacterEncoding.cpp:297

Categories

(Core :: DOM: Bindings (WebIDL), defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1629390
Tracking Status
firefox-esr68 --- unaffected
firefox75 --- wontfix
firefox76 --- wontfix
firefox77 --- wontfix

People

(Reporter: jkratzer, Unassigned)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: assertion, regression, testcase)

Attachments

(2 files, 1 obsolete file)

Attached file testcase.html (obsolete) —

Testcase found while fuzzing mozilla-central rev 6663d3dc883b (built with --enable-debug).

Hit MOZ_CRASH(invalid UTF-8 string: ReportInvalidCharacter) at /builds/worker/checkouts/gecko/js/src/vm/CharacterEncoding.cpp:297

rax = 0x000055fc53b34380   rdx = 0x0000000000000000
rcx = 0x00007fd553824650   rbx = 0x000000000000000d
rsi = 0x00007fd55ee2d8b0   rdi = 0x00007fd55ee2c680
rbp = 0x00007fff76754960   rsp = 0x00007fff767548a0
r8 = 0x00007fd55ee2d8b0    r9 = 0x00007fd55ff93780
r10 = 0x0000000000000000   r11 = 0x0000000000000000
r12 = 0x000000000000002a   r13 = 0x00007fff767548f0
r14 = 0x000000000000000d   r15 = 0x000000000000000d
rip = 0x00007fd550615f8c
OS|Linux|0.0.0 Linux 5.3.0-28-generic #30~18.04.1-Ubuntu SMP Fri Jan 17 06:14:09 UTC 2020 x86_64
CPU|amd64|family 6 model 94 stepping 3|8
GPU|||
Crash|SIGSEGV|0x0|0
0|0|libxul.so|JS::ConstUTF8CharsZ::validate(unsigned long)|hg:hg.mozilla.org/mozilla-central:js/src/vm/CharacterEncoding.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|612|0x29
0|1|libxul.so|JSErrorBase::initBorrowedMessage(char const*)|hg:hg.mozilla.org/mozilla-central:js/public/ErrorReport.h:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|137|0x1b
0|2|libxul.so|ExpandErrorArgumentsHelper<JSErrorReport>|hg:hg.mozilla.org/mozilla-central:js/public/ErrorReport.h:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|132|0xf
0|3|libxul.so|ExpandErrorArguments<char>|hg:hg.mozilla.org/mozilla-central:js/src/vm/ErrorReporting.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|491|0x5
0|4|libxul.so|js::ReportErrorNumberUTF8Array(JSContext*, js::IsWarning, JSErrorFormatString const* (*)(void*, unsigned int), void*, unsigned int, char const**)|hg:hg.mozilla.org/mozilla-central:js/src/vm/ErrorReporting.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|534|0x95
0|5|libxul.so|mozilla::binding_danger::TErrorResult<mozilla::binding_danger::JustAssertCleanupPolicy>::SetPendingExceptionWithMessage(JSContext*, char const*)|hg:hg.mozilla.org/mozilla-central:dom/bindings/BindingUtils.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|301|0x1b
0|6|libxul.so|mozilla::binding_danger::TErrorResult<mozilla::binding_danger::JustAssertCleanupPolicy>::MaybeSetPendingException(JSContext*, char const*)|hg:hg.mozilla.org/mozilla-central:dom/bindings/ErrorResult.h:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|285|0x5
0|7|libxul.so|mozilla::dom::Headers_Binding::set|s3:gecko-generated-sources:63fc27a7419818accf505a7d5fabad3200e611ea6133520310a1ad75c82897ecea221e14f26a7ba2c2b81db2a8dd3d5f088665200e110c0d6813278e2aea6962/dom/bindings/HeadersBinding.cpp:|733|0x12
0|8|libxul.so|bool mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::NormalThisPolicy, mozilla::dom::binding_detail::ThrowExceptions>(JSContext*, unsigned int, JS::Value*)|hg:hg.mozilla.org/mozilla-central:dom/bindings/BindingUtils.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|3205|0x21
0|9|libxul.so|CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&)|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|489|0x19
0|10|libxul.so|js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason)|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|581|0x12
0|11|libxul.so|InternalCall|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|644|0x10
0|12|libxul.so|Interpret|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|648|0x18
0|13|libxul.so|js::RunScript(JSContext*, js::RunState&)|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|422|0x152
0|14|libxul.so|js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason)|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|616|0xf
0|15|libxul.so|InternalCall|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|644|0x10
0|16|libxul.so|js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>, js::CallReason)|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|661|0x8
0|17|libxul.so|JS::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::HandleValueArray const&, JS::MutableHandle<JS::Value>)|hg:hg.mozilla.org/mozilla-central:js/src/jsapi.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|2798|0x1f
0|18|libxul.so|mozilla::dom::EventListener::HandleEvent(mozilla::dom::BindingCallContext&, JS::Handle<JS::Value>, mozilla::dom::Event&, mozilla::ErrorResult&)|s3:gecko-generated-sources:193e9a85814bae146326c2a291da1e87fa580c482e06e710f97daa3a025bad456a6c4102317b56373145ae30081dfb4e18c0a2449f7be19134cdc5c142912259/dom/bindings/EventListenerBinding.cpp:|54|0x5
0|19|libxul.so|mozilla::EventListenerManager::HandleEventSubType(mozilla::EventListenerManager::Listener*, mozilla::dom::Event*, mozilla::dom::EventTarget*)|s3:gecko-generated-sources:99837b3cdc69c5eb1234f9d2b3e771dcff734d56a022bedb1d00c0cf4ee6243fb5c91397a058f2ddab63bda8ed6b581ea1232a0229033866910c7289d24cbc2d/dist/include/mozilla/dom/EventListenerBinding.h:|66|0x19
0|20|libxul.so|mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event**, mozilla::dom::EventTarget*, nsEventStatus*, bool)|hg:hg.mozilla.org/mozilla-central:dom/events/EventListenerManager.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|1271|0x1c
0|21|libxul.so|mozilla::EventTargetChainItem::HandleEvent(mozilla::EventChainPostVisitor&, mozilla::ELMCreationDetector&)|hg:hg.mozilla.org/mozilla-central:dom/events/EventDispatcher.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|326|0x6b
0|22|libxul.so|mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&)|hg:hg.mozilla.org/mozilla-central:dom/events/EventDispatcher.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|558|0x12
0|23|libxul.so|mozilla::EventDispatcher::Dispatch(nsISupports*, nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event*, nsEventStatus*, mozilla::EventDispatchingCallback*, nsTArray<mozilla::dom::EventTarget*>*)|hg:hg.mozilla.org/mozilla-central:dom/events/EventDispatcher.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|1055|0x1a
0|24|libxul.so|nsDocumentViewer::LoadComplete(nsresult)|hg:hg.mozilla.org/mozilla-central:layout/base/nsDocumentViewer.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|1160|0x1a
0|25|libxul.so|nsDocShell::EndPageLoad(nsIWebProgress*, nsIChannel*, nsresult)|hg:hg.mozilla.org/mozilla-central:docshell/base/nsDocShell.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|5970|0x18
0|26|libxul.so|nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, nsresult)|hg:hg.mozilla.org/mozilla-central:docshell/base/nsDocShell.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|5753|0x1c
0|27|libxul.so|nsDocLoader::DoFireOnStateChange(nsIWebProgress*, nsIRequest*, int&, nsresult)|hg:hg.mozilla.org/mozilla-central:uriloader/base/nsDocLoader.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|1346|0x31
0|28|libxul.so|nsDocLoader::doStopDocumentLoad(nsIRequest*, nsresult)|hg:hg.mozilla.org/mozilla-central:uriloader/base/nsDocLoader.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|906|0x2a
0|29|libxul.so|nsDocLoader::DocLoaderIsEmpty(bool)|hg:hg.mozilla.org/mozilla-central:uriloader/base/nsDocLoader.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|726|0x15
0|30|libxul.so|nsDocLoader::OnStopRequest(nsIRequest*, nsresult)|hg:hg.mozilla.org/mozilla-central:uriloader/base/nsDocLoader.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|614|0x16
0|31|libxul.so|mozilla::net::nsLoadGroup::NotifyRemovalObservers(nsIRequest*, nsresult)|hg:hg.mozilla.org/mozilla-central:netwerk/base/nsLoadGroup.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|611|0x1a
0|32|libxul.so|mozilla::net::nsLoadGroup::RemoveRequest(nsIRequest*, nsISupports*, nsresult)|hg:hg.mozilla.org/mozilla-central:netwerk/base/nsLoadGroup.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|518|0xe
0|33|libxul.so|mozilla::dom::Document::DoUnblockOnload()|hg:hg.mozilla.org/mozilla-central:dom/base/Document.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|10765|0x4c
0|34|libxul.so|mozilla::dom::Document::UnblockOnload(bool)|hg:hg.mozilla.org/mozilla-central:dom/base/Document.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|10699|0x2a
0|35|libxul.so|mozilla::dom::Document::DispatchContentLoadedEvents()|hg:hg.mozilla.org/mozilla-central:dom/base/Document.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|7388|0xd
0|36|libxul.so|mozilla::detail::RunnableMethodImpl<mozilla::dom::Document*, void (mozilla::dom::Document::*)(), true, (mozilla::RunnableKind)0>::Run()|hg:hg.mozilla.org/mozilla-central:xpcom/threads/nsThreadUtils.h:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|1220|0x5
0|37|libxul.so|mozilla::SchedulerGroup::Runnable::Run()|hg:hg.mozilla.org/mozilla-central:xpcom/threads/SchedulerGroup.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|146|0x14
0|38|libxul.so|nsThread::ProcessNextEvent(bool, bool*)|hg:hg.mozilla.org/mozilla-central:xpcom/threads/nsThread.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|1200|0xe
0|39|libxul.so|NS_ProcessNextEvent(nsIThread*, bool)|hg:hg.mozilla.org/mozilla-central:xpcom/threads/nsThreadUtils.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|481|0x11
0|40|libxul.so|mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*)|hg:hg.mozilla.org/mozilla-central:ipc/glue/MessagePump.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|87|0xa
0|41|libxul.so|MessageLoop::RunInternal()|hg:hg.mozilla.org/mozilla-central:ipc/chromium/src/base/message_loop.cc:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|315|0x19
0|42|libxul.so|MessageLoop::Run()|hg:hg.mozilla.org/mozilla-central:ipc/chromium/src/base/message_loop.cc:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|290|0x8
0|43|libxul.so|nsBaseAppShell::Run()|hg:hg.mozilla.org/mozilla-central:widget/nsBaseAppShell.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|137|0xd
0|44|libxul.so|XRE_RunAppShell()|hg:hg.mozilla.org/mozilla-central:toolkit/xre/nsEmbedFunctions.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|909|0x6
0|45|libxul.so|mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*)|hg:hg.mozilla.org/mozilla-central:ipc/glue/MessagePump.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|237|0x5
0|46|libxul.so|MessageLoop::RunInternal()|hg:hg.mozilla.org/mozilla-central:ipc/chromium/src/base/message_loop.cc:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|315|0x19
0|47|libxul.so|MessageLoop::Run()|hg:hg.mozilla.org/mozilla-central:ipc/chromium/src/base/message_loop.cc:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|290|0x8
0|48|libxul.so|XRE_InitChildProcess(int, char**, XREChildData const*)|hg:hg.mozilla.org/mozilla-central:toolkit/xre/nsEmbedFunctions.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|740|0xc
0|49|firefox-bin|content_process_main(mozilla::Bootstrap*, int, char**)|hg:hg.mozilla.org/mozilla-central:ipc/contentproc/plugin-container.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|56|0x14
0|50|firefox-bin|main|hg:hg.mozilla.org/mozilla-central:browser/app/nsBrowserApp.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|303|0x13
0|51|libc.so.6||||0x21b97
0|52|firefox-bin|__cxa_throw_bad_array_new_length|hg:hg.mozilla.org/mozilla-central:build/unix/stdc++compat/stdc++compat.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|82|0x12
0|53|firefox-bin|_GLOBAL__sub_I_TimeStamp.cpp|hg:hg.mozilla.org/mozilla-central:mozglue/misc/TimeStamp.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|150|0x4b
0|54|||||0x7fff76757d50
0|55|ld-linux-x86-64.so.2||||0x10733
0|56|libdl.so.2||||0x202d80
0|57|libpthread.so.0||||0x219bb0
0|58|firefox-bin|_GLOBAL__sub_I_TimeStamp.cpp|hg:hg.mozilla.org/mozilla-central:mozglue/misc/TimeStamp.cpp:6663d3dc883b6ad0d0dfa9346f9ceabf2b2c7967|150|0x4b
0|59|||||0x7fff76757d50
0|60|firefox-bin|_start|||0x29
Flags: in-testsuite?
Component: DOM: Networking → JavaScript Engine

Probably caused by bug 1619112.

Component: JavaScript Engine → DOM: Bindings (WebIDL)
Regressed by: 1619112
Has Regression Range: --- → yes

8-bit JS strings that get formatted into the message should go through a Latin1 to UTF-8 conversion before being formatted into the message.

Attached file testcase.html —

The previously attached testcase failed to repro over HTTP which is required by bugmon. The attached testcase (and worker.js) fixes this issue.

Attachment #9139170 - Attachment is obsolete: true
Attached file worker.js —
Whiteboard: [bugmon:confirm] → [bugmon:bisected,confirmed]
Bugmon Analysis: Verified bug as reproducible on mozilla-central 20200420153711-6a0ecf432b78. The bug appears to have been introduced in the following build range: > Start: 8ab81c8e93adff2d4187aabf1ddcfcae8bfc4e16 (20200306201041) > End: fddaf6472c50b10ed9671f2effe2159964f8cfe5 (20200307093221) > Pushlog: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=8ab81c8e93adff2d4187aabf1ddcfcae8bfc4e16&tochange=fddaf6472c50b10ed9671f2effe2159964f8cfe5

Olli, ni-ing you here as you were a reviewer; would you mind taking a look at this one?

Flags: needinfo?(bugs)
Version: Trunk → 75 Branch

Similar crash as bug 1629390, and looks like :peterv is working on that.

Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(bugs)
Resolution: --- → DUPLICATE
Version: 75 Branch → Trunk
Keywords: bugmon
Whiteboard: [bugmon:bisected,confirmed]
Bugmon Analysis: Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: