Open Bug 1833897 Opened 3 years ago Updated 1 year ago

Assertion failure: aLength <= kMax (string is too large), at /xpcom/string/nsTStringRepr.h:86

Categories

(Core :: DOM: Core & HTML, defect)

x86_64
Linux
defect

Tracking

()

People

(Reporter: jkratzer, Unassigned)

References

(Blocks 1 open bug)

Details

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

Attachments

(1 file)

4.07 KB, application/octet-stream
Details

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

Testcase can be reproduced using the following commands:

$ pip install fuzzfetch grizzly-framework
$ python -m fuzzfetch --build 625c1ea4c73b --asan --fuzzing -n firefox
$ python -m grizzly.replay ./firefox/firefox testcase.zip
Assertion failure: aLength <= kMax (string is too large), at /xpcom/string/nsTStringRepr.h:86

    =================================================================
    ==380299==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000001 (pc 0x7f40ed98d454 bp 0x7f4051aa1150 sp 0x7f4051aa1120 T14)
    ==380299==The signal is caused by a WRITE memory access.
    ==380299==Hint: address points to the zero page.
        #0 0x7f40ed98d454 in nsTStringLengthStorage /xpcom/string/nsTStringRepr.h:86:5
        #1 0x7f40ed98d454 in nsTSubstring<char>::Adopt(char*, unsigned long) /xpcom/string/nsTSubstring.cpp:630:20
        #2 0x7f40f1782f4d in mozilla::dom::BodyConsumer::ContinueConsumeBody(nsresult, unsigned int, unsigned char*, bool) /dom/base/BodyConsumer.cpp:721:12
        #3 0x7f40f17b1379 in mozilla::dom::(anonymous namespace)::ContinueConsumeBodyRunnable::WorkerRun(JSContext*, mozilla::dom::WorkerPrivate*) /dom/base/BodyConsumer.cpp:85:20
        #4 0x7f40f83baf44 in mozilla::dom::WorkerRunnable::Run() /dom/workers/WorkerRunnable.cpp:377:12
        #5 0x7f40edc8210b in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1233:16
        #6 0x7f40edc8f314 in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:479:10
        #7 0x7f40f839b801 in mozilla::dom::WorkerPrivate::DoRunLoop(JSContext*) /dom/workers/WorkerPrivate.cpp:3284:7
        #8 0x7f40f8366a99 in mozilla::dom::workerinternals::(anonymous namespace)::WorkerThreadPrimaryRunnable::Run() /dom/workers/RuntimeService.cpp:2149:42
        #9 0x7f40edc8210b in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1233:16
        #10 0x7f40edc8f314 in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:479:10
        #11 0x7f40ef887e41 in mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:300:20
        #12 0x7f40ef6b091a in RunInternal /ipc/chromium/src/base/message_loop.cc:369:10
        #13 0x7f40ef6b091a in RunHandler /ipc/chromium/src/base/message_loop.cc:362:3
        #14 0x7f40ef6b091a in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:344:3
        #15 0x7f40edc783a2 in nsThread::ThreadFunc(void*) /xpcom/threads/nsThread.cpp:391:10
        #16 0x7f4114ae8b5f in _pt_root /nsprpub/pr/src/pthreads/ptthread.c:201:5
        #17 0x7f4114894b42 in start_thread nptl/pthread_create.c:442:8
        #18 0x7f41149269ff  misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
    
    AddressSanitizer can not provide additional info.
    SUMMARY: AddressSanitizer: SEGV /xpcom/string/nsTStringRepr.h:86:5 in nsTStringLengthStorage
    Thread T14 created by T0 (Isolated Servic) here:
        #0 0x562c959cf82a in pthread_create /builds/worker/fetches/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:208:3
        #1 0x7f4114ad72c4 in _PR_CreateThread /nsprpub/pr/src/pthreads/ptthread.c:458:14
        #2 0x7f4114ac4ebe in PR_CreateThread /nsprpub/pr/src/pthreads/ptthread.c:533:12
        #3 0x7f40edc7c16c in nsThread::Init(nsTSubstring<char> const&) /xpcom/threads/nsThread.cpp:633:18
        #4 0x7f40f83ce1da in mozilla::dom::WorkerThread::Create(mozilla::dom::WorkerThreadFriendKey const&) /dom/workers/WorkerThread.cpp:102:7
        #5 0x7f40f832d2f7 in mozilla::dom::workerinternals::RuntimeService::ScheduleWorker(mozilla::dom::WorkerPrivate&) /dom/workers/RuntimeService.cpp:1331:37
        #6 0x7f40f832b72f in mozilla::dom::workerinternals::RuntimeService::RegisterWorker(mozilla::dom::WorkerPrivate&) /dom/workers/RuntimeService.cpp:1213:19
        #7 0x7f40f8393c1d in mozilla::dom::WorkerPrivate::Constructor(JSContext*, nsTSubstring<char16_t> const&, bool, mozilla::dom::WorkerKind, mozilla::dom::RequestCredentials, mozilla::dom::WorkerType, nsTSubstring<char16_t> const&, nsTSubstring<char> const&, mozilla::dom::WorkerLoadInfo*, mozilla::ErrorResult&, nsTString<char16_t>, std::function<void (bool)>&&, std::function<void ()>&&) /dom/workers/WorkerPrivate.cpp:2653:24
        #8 0x7f40f83e3e84 in mozilla::dom::RemoteWorkerChild::ExecWorkerOnMainThread(mozilla::dom::RemoteWorkerData&&) /dom/workers/remoteworkers/RemoteWorkerChild.cpp:342:41
        #9 0x7f40f8423247 in operator() /dom/workers/remoteworkers/RemoteWorkerChild.cpp:193:29
        #10 0x7f40f8423247 in mozilla::detail::RunnableFunction<mozilla::dom::RemoteWorkerChild::ExecWorker(mozilla::dom::RemoteWorkerData const&)::$_0>::Run() /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:548:5
        #11 0x7f40edc35830 in mozilla::SchedulerGroup::Runnable::Run() /xpcom/threads/SchedulerGroup.cpp:114:20
        #12 0x7f40edc504da in mozilla::RunnableTask::Run() /xpcom/threads/TaskController.cpp:555:16
        #13 0x7f40edc4122a in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:879:26
        #14 0x7f40edc3e127 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:702:15
        #15 0x7f40edc3ea0f in mozilla::TaskController::ProcessPendingMTTask(bool) /xpcom/threads/TaskController.cpp:491:36
        #16 0x7f40edc55c01 in operator() /xpcom/threads/TaskController.cpp:218:37
        #17 0x7f40edc55c01 in mozilla::detail::RunnableFunction<mozilla::TaskController::TaskController()::$_0>::Run() /xpcom/threads/nsThreadUtils.h:548:5
        #18 0x7f40edc8187b in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1239:16
        #19 0x7f40edc8f314 in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:479:10
        #20 0x7f40ef88661e in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:85:21
        #21 0x7f40ef6b091a in RunInternal /ipc/chromium/src/base/message_loop.cc:369:10
        #22 0x7f40ef6b091a in RunHandler /ipc/chromium/src/base/message_loop.cc:362:3
        #23 0x7f40ef6b091a in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:344:3
        #24 0x7f40f8fd9359 in nsBaseAppShell::Run() /widget/nsBaseAppShell.cpp:148:27
        #25 0x7f40fef9abb8 in XRE_RunAppShell() /toolkit/xre/nsEmbedFunctions.cpp:738:20
        #26 0x7f40ef6b091a in RunInternal /ipc/chromium/src/base/message_loop.cc:369:10
        #27 0x7f40ef6b091a in RunHandler /ipc/chromium/src/base/message_loop.cc:362:3
        #28 0x7f40ef6b091a in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:344:3
        #29 0x7f40fef9a27e in XRE_InitChildProcess(int, char**, XREChildData const*) /toolkit/xre/nsEmbedFunctions.cpp:673:34
        #30 0x562c95a2573e in content_process_main /browser/app/../../ipc/contentproc/plugin-container.cpp:57:28
        #31 0x562c95a2573e in main /browser/app/nsBrowserApp.cpp:375:18
        #32 0x7f4114829d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    
    ==380299==ABORTING
Attached file Testcase

Verified bug as reproducible on mozilla-central 20230518213154-3a125a6b7c3a.
Unable to bisect testcase (Testcase reproduces on start build!):

Start: 6092ad95d1178aaa55787cffeab84ad4b5be17f5 (20220520093126)
End: 625c1ea4c73b8f777dfd07a6524db0b4b8994d1a (20230511131014)
BuildFlags: BuildFlags(asan=True, tsan=False, debug=False, fuzzing=True, coverage=False, valgrind=False, no_opt=False, fuzzilli=False, nyx=False)

Whiteboard: [bugmon:confirm] → [bugmon:bisected,confirmed]
Severity: -- → S3

Unable to reproduce bug 1833897 using build mozilla-central 20231208094241-3152110c63b5. Without a baseline, bugmon is unable to analyze this bug.
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.

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

Attachment

General

Created:
Updated:
Size: