Commit Graph

7857 Commits

Author SHA1 Message Date
Julian Seward
3c2f4aaaa5 Bug 1863120 - SharedMemory::FindFreeAddressSpace performs incorrect munmap on allocation failure. r=jld.
SharedMemory::FindFreeAddressSpace will bogusly try to do `munmap(MAP_FAILED, size)`
if the preceding `mmap` fails.  This patch guards the `munmap` with a failure check.

Differential Revision: https://phabricator.services.mozilla.com/D192799
2023-11-07 07:46:09 +00:00
Christian Holler (:decoder)
c0d3b745c4 Bug 1860108 - Add IPC_SingleMessage fuzzer. r=nika,truber
Differential Revision: https://phabricator.services.mozilla.com/D191468
2023-11-06 22:22:59 +00:00
Yannis Juglaret
b016efd2ef Bug 1831236 - Increase shutdown wait time for debug builds. r=jld
As we are seeing test failures that suggest that proper shutdown
sometimes requires extra time in debug builds, let's try to upgrade
kShutdownWaitMs from 8 to 20 seconds for those.

Differential Revision: https://phabricator.services.mozilla.com/D192694
2023-11-06 08:08:05 +00:00
Jed Davis
850869a8df Bug 1595453 - Allow serializing zero-length ByteBufs. r=nika
If someone tried to serialize a zero-size ByteBuf, it could add a
zero-length segment to the `BufferList` and cause an assertion failure
later when trying to send the message.  This patch makes it a no-op (and
frees the supplied buffer, because the BufferList becomes its owner).

We previously asserted against adding zero-*capacity* segments (likely
also zero size, but possibly not) with WriteBytesZeroCopy, but only on
debug builds, and it was likely happening on release builds despite
that.  That case is now allowed.

Also, error handling for `BufferList::WriteBytesZeroCopy` has been
improved.  (This doesn't affect `Pickle` because it's using infallible
allocation, and no other instances of `BufferList` seem to use
`WriteBytesZeroCopy` at this time.)

Differential Revision: https://phabricator.services.mozilla.com/D192531
2023-11-02 18:05:31 +00:00
Ray Kraesig
0263135c35 Bug 1861519 - [1/1] increase arbitrary timeout in test r=ipc-reviewers,nika
Despite having passed through test-verify cleanly, the crash test is
still sometimes failing due to a dump not being generated.

Increase it to one full second, to give the file dialog time to open. If
this doesn't suffice we'll have to either add another flavor of promise
in the test-only code, or disable the test entirely.

Differential Revision: https://phabricator.services.mozilla.com/D192101
2023-10-30 22:20:16 +00:00
Christian Holler (:decoder)
63b0a25896 Bug 1861997 - Add OnMessageError handler to IPC fuzzing. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D192240
2023-10-30 18:16:55 +00:00
Ray Kraesig
371b0d83fc Bug 1837079 - [8/10] Implement file-dialog utility-process-crash tests r=handyman,ipc-reviewers,mstange,gerard-majax,nika,profiler-reviewers,julienw
Implement a mochitest confirming the stability of Firefox when the
file-picker crashes (patterned loosely off the existing geolocation
crash tests).

Differential Revision: https://phabricator.services.mozilla.com/D184723
2023-10-26 18:21:30 +00:00
Ray Kraesig
e2771bde2c Bug 1837079 - [7/10] Open Windows file picker out-of-process r=gstoll,handyman,ipc-reviewers,nika,win-reviewers,mhowell
When opening a new Windows file dialog, open it out-of-process if
possible. Fall back to opening it in-process if that fails. (This
behavior is configurable with a pref.)

Differential Revision: https://phabricator.services.mozilla.com/D180343
2023-10-26 18:21:29 +00:00
Ray Kraesig
3c94ba2a4e Bug 1837079 - [6/10] Properly destroy actors and utility processes r=ipc-reviewers,nika
The IPC subsystem effectively owns IPC actors, and requires an explicit
call to `Close()` to destroy a toplevel actor: releasing the last RefPtr
doesn't cut it. Similarly, the UtilityProcessManager owns the utility
processes it creates, and one must explicitly call `DestroyProcess()`.

Handle both of these lifetime issues by using a custom meta-RefPtr for
WinFileDialogParent which will close the actor and kill the process upon
its final `Release()`.

Differential Revision: https://phabricator.services.mozilla.com/D180345
2023-10-26 18:21:28 +00:00
Ray Kraesig
6c2facfc0c Bug 1837079 - [5/10] Create WinFileDialog IPDL protocol and implementation r=gstoll,handyman,ipc-reviewers,nika,win-reviewers,mhowell
Create and implement a new top-level IPC protocol, `PWinFileDialog`,
using the primitives from bug 1833450 and the new sandboxing type from
the previous commit.

Again, this commit does not actually create any instances of the new
protocol; that will come in a later commit in this patchset.

Differential Revision: https://phabricator.services.mozilla.com/D180342
2023-10-26 18:21:28 +00:00
Ray Kraesig
8cd437b72d Bug 1837079 - [4/10] Create WINDOWS_FILE_DIALOG utility process type r=gerard-majax,ipc-reviewers,fluent-reviewers,bobowen,handyman,nika
Create a new utility-process type for the sole use of out-of-process
instantiation of the Windows file dialog.

We do not sandbox this process type, as in certain test environments
sandboxing has been found to prevent the child process from interacting
with any other windows on the desktop -- including the parent process
window which it will need to assign as the parent of the file dialog.

Technically, no functional changes, as this commit adds no uses of this
type. (That will come later in the patchset.)

Differential Revision: https://phabricator.services.mozilla.com/D180341
2023-10-26 18:21:28 +00:00
Tom Marble
28edc0c671 Bug 1859905 - convert .ini manifests to .toml: batch 19 browser_*.ini r=jmaher,webdriver-reviewers,necko-reviewers,extension-reviewers,devtools-reviewers,anti-tracking-reviewers,valentin,robwu,pbz
Differential Revision: https://phabricator.services.mozilla.com/D191771
2023-10-25 21:47:25 +00:00
Natalia Csoregi
8a8efda530 Backed out changeset 1ca403a2c00e (bug 1859905) for causing failures on test_mochitest_integration.py CLOSED TREE 2023-10-25 22:26:24 +03:00
Tom Marble
9c93e7d5df Bug 1859905 - convert .ini manifests to .toml: batch 19 browser_*.ini r=jmaher,webdriver-reviewers,necko-reviewers,extension-reviewers,devtools-reviewers,anti-tracking-reviewers,valentin,robwu,pbz
Differential Revision: https://phabricator.services.mozilla.com/D191771
2023-10-25 17:12:24 +00:00
Mirko Brodesser
6dac9c2318 Bug 1839315: part 8) Store the fetchpriority value from Link header fields in the LinkHeader struct. r=manuel
Setting the value currently has no user-observable effect. It will be
used in a following part.

The static assertions could be strengthened by using `HAS_MEMBER`
(https://searchfox.org/mozilla-central/rev/e4afef5d3ff67781dc1377912344694f3cf3a226/dom/bindings/BindingUtils.h#826),
but it seems unlikely that one member is added and one removed in the
same patch. Therefore, the current static assertions are considered safe
enough.

Differential Revision: https://phabricator.services.mozilla.com/D191402
2023-10-24 07:37:47 +00:00
Jan Varga
775b1ee1be Bug 1856534 - Add crash annotations to BackgroundParentImpl::ProcessingError and BackgroundChildImpl::ProcessingError; r=nika
Differential Revision: https://phabricator.services.mozilla.com/D189903
2023-10-23 17:39:29 +00:00
Sylvestre Ledru
82db67a6be Bug 1860157 - Fix typos found by codespell 2.2.6 r=webdriver-reviewers,zeid,search-reviewers,perftest-reviewers,devtools-reviewers,releng-reviewers,gbrown,sparky,jteow
Differential Revision: https://phabricator.services.mozilla.com/D191480
2023-10-19 20:52:10 +00:00
Tim Huang
97022a04c1 Bug 1824222 - Add an OverriddenFingerprintingSettings attribute to nsILoadInfo. r=tjr,necko-reviewers,jesup
This patch adds a new attribute called OverriddenFingerprintingSettings to
nsILoadInfo. The field will be used to decide the granular fingerprinting
protection override of the corresponding channel.

The OverriddenFingerprintingSettings will only get populated if
there is one defined for the context of the channel. Otherwise, a value
of Nothing indicates no granular overrides are present for the channel..

Differential Revision: https://phabricator.services.mozilla.com/D185011
2023-10-17 22:02:27 +00:00
Sylvestre Ledru
1e776756dd Bug 1856795 - ride along: use = default; on some recently modified files r=emilio
More on:
https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html

Command:
L=$(hg export -r tip|grep +++|cut -d/ -f2-)
./mach static-analysis check --checks="-*, modernize-use-equals-default" --fix $L

Differential Revision: https://phabricator.services.mozilla.com/D191016
2023-10-15 15:29:03 +00:00
Sylvestre Ledru
d0f6c7fc66 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-15 15:29:02 +00:00
Cristina Horotan
6a90f5eded Backed out 2 changesets (bug 1856795) for causing build bustage at BasicEvents.h CLOSED TREE
Backed out changeset 1d98b028923a (bug 1856795)
Backed out changeset eae2ac93e17c (bug 1856795)
2023-10-14 21:42:14 +03:00
Sylvestre Ledru
c164bd9937 Bug 1856795 - ride along: use = default; on some recently modified files r=emilio
More on:
https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html

Command:
L=$(hg export -r tip|grep +++|cut -d/ -f2-)
./mach static-analysis check --checks="-*, modernize-use-equals-default" --fix $L

Differential Revision: https://phabricator.services.mozilla.com/D191016
2023-10-14 17:34:27 +00:00
Sylvestre Ledru
cc8a0ee742 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-14 17:34:26 +00:00
Tom Marble
0cb91fe33e Bug 1855300 - convert .ini manifests to .toml: batch 11 remaining **/mochitest.ini r=jmaher,geckoview-reviewers,extension-reviewers,valentin,credential-management-reviewers,cookie-reviewers,sgalich,m_kato,robwu
Differential Revision: https://phabricator.services.mozilla.com/D190515
2023-10-13 02:32:24 +00:00
Jan Varga
149bc7afa2 Bug 1855908 - Override PBackgroundParent::ProcessingError in BackgroundParentImpl; r=nika,ipc-reviewers
IPC_FAIL returned in PBackground based parent actors will now also kill invalid
child processes.

Differential Revision: https://phabricator.services.mozilla.com/D189623
2023-10-12 16:01:53 +00:00
Florian Quèze
ec1134bf2f Bug 1850647 - add an optional argument to py_action to record the target file name for most actions, r=glandium.
Differential Revision: https://phabricator.services.mozilla.com/D187306
2023-10-12 08:41:34 +00:00
Frederik Braun
7291dac470 Bug 1812192 - Store schemeless address bar loads in loadinfo and upgrade to https with fallback r=necko-reviewers,webidl,smaug,freddyb,kershaw
Depends on D179794

Differential Revision: https://phabricator.services.mozilla.com/D179795
2023-10-11 17:49:42 +00:00
Sandor Molnar
a9ab9f37a0 Backed out 8 changesets (bug 1850647, bug 1325181) for causing build bustages CLOSED TREE
Backed out changeset ab9d4ca38d83 (bug 1850647)
Backed out changeset 7465055478d9 (bug 1850647)
Backed out changeset 2008dd9ac32a (bug 1325181)
Backed out changeset c95204654c91 (bug 1850647)
Backed out changeset 0128ca1c9d18 (bug 1850647)
Backed out changeset e9277971c260 (bug 1850647)
Backed out changeset 6c15af4bc2c6 (bug 1850647)
Backed out changeset ce7ac5e23c1c (bug 1850647)
2023-10-11 12:25:58 +03:00
Florian Quèze
d40c2ed723 Bug 1850647 - add an optional argument to py_action to record the target file name for most actions, r=glandium.
Differential Revision: https://phabricator.services.mozilla.com/D187306
2023-10-11 05:54:13 +00:00
Cristian Tuns
5fabc0ee57 Backed out 6 changesets (bug 1812192) for causing browser_schemeless.js failures. CLOSED TREE
Backed out changeset 3d07a92324d0 (bug 1812192)
Backed out changeset 9c2a1ff6c90d (bug 1812192)
Backed out changeset fa6784f8b0f4 (bug 1812192)
Backed out changeset 0f39aba7e4d5 (bug 1812192)
Backed out changeset ef7219327a10 (bug 1812192)
Backed out changeset 9833b559342e (bug 1812192)
2023-10-10 10:02:25 -04:00
Emilio Cobos Álvarez
25c0d10932 Bug 1624819 - Remove TaskCategory and other quantum dom remnants. r=smaug,media-playback-reviewers,credential-management-reviewers,cookie-reviewers,places-reviewers,win-reviewers,valentin,mhowell,sgalich,alwu
Sorry this is not a particularly easy patch to review. But it should be
mostly straight-forward.

I kept Document::Dispatch mostly for convenience, but could be
cleaned-up too / changed by SchedulerGroup::Dispatch. Similarly maybe
that can just be NS_DispatchToMainThread if we add an NS_IsMainThread
check there or something (to preserve shutdown semantics).

Differential Revision: https://phabricator.services.mozilla.com/D190450
2023-10-10 08:51:12 +00:00
Frederik Braun
aed55ecb55 Bug 1812192 - Store schemeless address bar loads in loadinfo and upgrade to https with fallback r=necko-reviewers,webidl,smaug,freddyb,kershaw
Depends on D179794

Differential Revision: https://phabricator.services.mozilla.com/D179795
2023-10-10 08:43:00 +00:00
Alexandre Lissy
877d80b058 Bug 1856359 - Respect MOZ_CRASHREPORTER_SHUTDOWN for Utility process r=gsvelto,necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D189824
2023-10-04 15:42:48 +00:00
Jan Varga
15a964b8f8 Bug 1855138 - Add BackgroundParent::KillHardAsync method; r=nika,ipc-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D189482
2023-10-03 18:40:30 +00:00
Sylvestre Ledru
4c29c24344 Bug 1856530 - run file-whitespace on toml files r=linter-reviewers,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D189896
2023-10-03 09:22:18 +00:00
anonymous0000007
9aa4a47982 Bug 1812604 - time_t isn't 4 bytes on many BSDs r=RyanVM,gaston
Differential Revision: https://phabricator.services.mozilla.com/D177970
2023-10-02 16:13:37 +00:00
Joel Maher
99abb50b8d Bug 1853245 - Migrate .ini manifests to .toml (Batch 7.25). r=aryx,webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D189221
2023-09-26 17:40:01 +00:00
Paul Bone
0974c51617 Bug 1850887 - Remove GC_WAIT_FOR_IDLE_* telemetry r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D189081
2023-09-26 01:39:58 +00:00
Chris Peterson
221ae0ef66 Bug 1854881 - Fix non-unified build error in ipc/glue/ProtocolUtils.cpp. r=jstutte,andi
ipc/glue/ProtocolUtils.cpp:84:20: error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
  return IPCResult(false);

This error is a regression from bug 1778860.

Differential Revision: https://phabricator.services.mozilla.com/D189082
2023-09-26 00:41:29 +00:00
Landry Breuil
b56f46c4ab Bug 1854775: fix build on *BSD after bug 1851095 r=jld
Differential Revision: https://phabricator.services.mozilla.com/D189112
2023-09-25 23:46:48 +00:00
Jed Davis
df9fa90f41 Bug 1851095 - Step 2: Connect setproctitle to the fork server. r=nika
This adds a small function that concatenates the args (because not
only does the BSD `setproctitle` take a single string, but also the
Linux kernel code that implements `/proc/{pid}/cmdline` won't allow the
"arguments" to extend past their original length unless it's a single
string), and connects it to the fork server.

Differential Revision: https://phabricator.services.mozilla.com/D187635
2023-09-22 03:41:39 +00:00
Jed Davis
c48e55cb24 Bug 1851095 - Step 1: Modify process_title_linux to work in our context, and build it. r=nika,glandium
The major changes:

* Instead of importing `base::ReadFileToString`, which is used only to
  determine if a `/proc` pseudo-file contains more than a certain number
  of characters, we simply `read` enough to determine that information.

* Instead of importing `base::NoDestructor` and wrapping it around STL
  containers, we simply `strdup` the strings we need to copy out of
  the initial arg/env area.  (In theory this could set off LSan if the
  copied string later becomes unreachable, but in practice that doesn't
  seem to happen, and it's easily fixable if that changes.)

* Chromium copies only the environment strings and allows the argv
  strings to be overwritten; this may be safe for how they access the
  command line arguments but it may not be for us, so this patch changes
  it to copy all of the strings.

Differential Revision: https://phabricator.services.mozilla.com/D187634
2023-09-22 03:41:39 +00:00
Jed Davis
6bd46092cc Bug 1851095 - Step 0: Import set_process_title_linux.cc from Chromium. r=nika
This is `content/common/set_process_title_linux.cc` from Chromium git
revision 5df26a3c960c011f068cea1fa9bc5866aaaa8aa2.  This patch includes
only the file and doesn't attempt to build it or modify it to work with
our codebase; future patches will do that.

`about:license` already includes `ipc/chromium/` as a location that may
include code covered by the Chromium license, so this shouldn't need any
additional license acknowledgements.

Differential Revision: https://phabricator.services.mozilla.com/D187633
2023-09-22 03:41:38 +00:00
Lee Salzman
f793972d4c Bug 1553691 - Implement CrossProcessSemaphore on macOS using Mach semaphores. r=nika
Unnamed POSIX semaphores are not supported on macOS, nor is timed wait supported on
named POSIX semaphores. SysV semaphores have similar limitations.

Mach semaphores are one of the only clean ways to create unnamed, shareable semaphores
on macOS. As of bug 1734735, we now can transparently send the mach ports across to
other processes without much added code, overall making this implementation of Mach
semaphores fairly easy.

Differential Revision: https://phabricator.services.mozilla.com/D188429
2023-09-19 21:16:46 +00:00
Alexandre Lissy
67cbfc151a Bug 1853627 - Preload ole32.dll only on NS_FREE_PERMANENT_DATA r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D188608
2023-09-19 16:18:58 +00:00
Iulian Moraru
87c1675542 Backed out 10 changesets (bug 1837079) for causing build bustages on UtilityProcessManager.cpp. CLOSED TREE
Backed out changeset b36fd9deb165 (bug 1837079)
Backed out changeset 0253a50d16a9 (bug 1837079)
Backed out changeset 799ea189e748 (bug 1837079)
Backed out changeset 70eab0533b00 (bug 1837079)
Backed out changeset 488707a84723 (bug 1837079)
Backed out changeset d56484304ec3 (bug 1837079)
Backed out changeset 36d3afd881b4 (bug 1837079)
Backed out changeset 3f2fd4d7a511 (bug 1837079)
Backed out changeset 078b848cd09e (bug 1837079)
Backed out changeset 64390c163748 (bug 1837079)
2023-09-15 22:17:21 +03:00
Ray Kraesig
8dfb30cd32 Bug 1837079 - [8/10] Implement file-dialog utility-process-crash tests r=handyman,ipc-reviewers,mstange,gerard-majax,nika,profiler-reviewers
Implement a mochitest confirming the stability of Firefox when the
file-picker crashes (patterned loosely off the existing geolocation
crash tests).

Differential Revision: https://phabricator.services.mozilla.com/D184723
2023-09-15 18:10:01 +00:00
Ray Kraesig
647025e296 Bug 1837079 - [7/10] Open Windows file picker out-of-process r=gstoll,handyman,ipc-reviewers,nika
When opening a new Windows file dialog, open it out-of-process if
possible. Fall back to opening it in-process if that fails. (This
behavior is configurable with a pref.)

Differential Revision: https://phabricator.services.mozilla.com/D180343
2023-09-15 18:10:01 +00:00
Ray Kraesig
5631927f07 Bug 1837079 - [6/10] Properly destroy actors and utility processes r=ipc-reviewers,nika
The IPC subsystem effectively owns IPC actors, and requires an explicit
call to `Close()` to destroy a toplevel actor: releasing the last RefPtr
doesn't cut it. Similarly, the UtilityProcessManager owns the utility
processes it creates, and one must explicitly call `DestroyProcess()`.

Handle both of these lifetime issues by using a custom meta-RefPtr for
WinFileDialogParent which will close the actor and kill the process upon
its final `Release()`.

Differential Revision: https://phabricator.services.mozilla.com/D180345
2023-09-15 18:10:01 +00:00
Ray Kraesig
2e9d3b7548 Bug 1837079 - [5/10] Create WinFileDialog IPDL protocol and implementation r=gstoll,handyman,ipc-reviewers,nika
Create and implement a new top-level IPC protocol, `PWinFileDialog`,
using the primitives from bug 1833450 and the new sandboxing type from
the previous commit.

Again, this commit does not actually create any instances of the new
protocol; that will come in a later commit in this patchset.

Differential Revision: https://phabricator.services.mozilla.com/D180342
2023-09-15 18:10:01 +00:00