Граф коммитов

1362 Коммитов

Автор SHA1 Сообщение Дата
Norisz Fay fd1720100c Backed out 3 changesets (bug 1658072) as they are related to previously backed out changeset CLOSED TREE
Backed out changeset 199d3ecfe13c (bug 1658072)
Backed out changeset a942be3d053d (bug 1658072)
Backed out changeset e0e98ee85f98 (bug 1658072)
2022-08-11 02:01:04 +03:00
Norisz Fay 936d025f11 Backed out changeset aaff4b4fd82e (bug 1658072) for causing xpcshell failures on process_watcher_posix_sigchld.cc CLOSED TREE 2022-08-11 01:56:09 +03:00
Jed Davis 30a7fec563 Bug 1658072 - Cleanup: assert that libevent's signal handling code is never used. r=nika
Given that libevent's signal handling code is known to have race
conditions, and there are fundamental issues that make it hard to fix
upstream, and previous patches have removed our last usage of it, we
should assert that it's no longer used.

Differential Revision: https://phabricator.services.mozilla.com/D141312
2022-08-10 21:25:49 +00:00
Jed Davis 1dc9df1d11 Bug 1658072 - Cleanup: remove the signal handling glue in the IPC event loop. r=nika
Now that we're no longer using libevent's signal handling, we don't need
an OO wrapper for it.

Differential Revision: https://phabricator.services.mozilla.com/D141311
2022-08-10 21:25:49 +00:00
Jed Davis fd0bcff6e5 Bug 1658072 - Cleanup: remove the now-dead DidProcessCrash function. r=nika
The function DidProcessCrash is now dead code.  Before the ProcessWatcher
rewrite, its return value (i.e., whether the process crashed) was never
used, so effectively its only purpose was to make it harder to understand
where the waitpid calls were happening.

Differential Revision: https://phabricator.services.mozilla.com/D141310
2022-08-10 21:25:48 +00:00
Jed Davis 6aee29c7dd Bug 1658072 - Rewrite the Unix implementation of IPC process termination handling. r=nika
This patch rewrites the Unix backend of ProcessWatcher for two reasons:

1. To remove the use of libevent's signal handling, which has concurrency
   bugs that can't be easily fixed upstream (see Bugzilla for details)

2. To simplify the code in general; in particular, the new version has one
   place where the process and its exit status are consumed from the OS

The new implementation uses the same pipe-to-self technique as libevent
(and which we use elsewhere) to deal with async signal safety.  Unlike
the previous version, there is a single object which manages all
monitored child processes rather than one each.  (Previously, this
multiplexing was done inside libevent.)

Differential Revision: https://phabricator.services.mozilla.com/D141309
2022-08-10 21:01:32 +00:00
Nika Layzell d45df271ec Bug 1779792 - Part 2: Use an Endpoint to bind the initial actor in child processes, r=ipc-reviewers,necko-reviewers,media-playback-reviewers,mccr8,alwu
This type is also used in other places to start non-initial actors, and will
allow us to attach additional state more easily without needing to thread it
through every child process callsite manually.

Differential Revision: https://phabricator.services.mozilla.com/D153618
2022-08-10 14:55:22 +00:00
Mike Hommey d029bcdd7e Bug 1782988 - Avoid build bustage when building against glibc 2.36 or newer. r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D153716
2022-08-09 20:42:44 +00:00
Jed Davis 996eb87d1d Bug 1276388 - Use IPC process launching for Subprocess.jsm on Unix. r=kmag,nika,barret
Currently, Subprocess.jsm on Unix uses js-ctypes to call `posix_spawn`.
This has some issues, primarily that file descriptors are inherited by
the child process unless explicitly opted-out, which unfortunately a lot
of code doesn't do.  This patch changes it to use IPC process launching,
where fd inheritance is opt-in, by:

1. Extending `base::LaunchApp` to handle a few features that Subprocess
   needs (setting the process's working directory, specifying the full
   environment, and the macOS `disclaim` flag)

2. Adding a WebIDL method to `IOUtils` to expose that function to JS
   (currently Unix-only; Windows could also be supported but it would
   probably want to use a different IDL type for strings, given that the
   OS APIs use 16-bit code units).

3. Replacing the part of Subprocess that invokes `posix_spawn` (and
   related functions) by calling that method; the rest of Subprocess's
   machinery to manage pipes and I/O is unchanged.  (The Windows backend
   is also unchanged; I'm not aware of any functional issues there.)
   This results in some dead code, which is removed.

Differential Revision: https://phabricator.services.mozilla.com/D152336
2022-08-09 17:32:22 +00:00
Fabrice Desré c50cb528fc Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-03 16:39:41 +00:00
Andreea Pavel 3ccd75af8d Backed out changeset b9d2965591b9 (bug 1761040) for landing with wrong author CLOSED TREE DONTBUILD 2022-08-03 18:55:00 +03:00
Andreea Pavel fdb7cb2ecd Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-03 15:27:43 +00:00
Chris Peterson c477304353 Bug 1782337 - Remove unused LineWatcher. r=ipc-reviewers,jld
Differential Revision: https://phabricator.services.mozilla.com/D153304
2022-08-02 04:58:07 +00:00
Andreea Pavel 89d63c91e6 Backed out changeset a907159a482f (bug 1761040) for causing build bustages on a CLOSED TREE 2022-08-02 04:59:08 +03:00
Fabrice Desré 0f4ac7ad97 Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-02 00:49:41 +00:00
Chris Peterson cdcbafc835 Bug 1776347 - ipc/chromium: Replace some DISALLOW_COPY_AND_ASSIGN macros with explicitly deleted constructors to fix C++20 build errors. r=ipc-reviewers,nika
gcc -std=c++20 (but not clang -std=c++20) complains about template class definitions that specify the template parameter on the class constructor. For example:

template <typename T>
class C {
  C(int x) {}
  // OK in clang and gcc for both -std=c++17 and -std=c++20.

  C<T>(int x, int y) {}
  // OK in clang for both -std=c++17 and -std=c++20.
  // OK in gcc -std=c++17 but a build error with -std=c++20.
};

The ipc/chromium build error because the `DISALLOW_COPY_AND_ASSIGN` macro expands to such a template class definition:

ipc/chromium/src/base/basictypes.h:53:12: error: expected unqualified-id before 'const'
      |   TypeName(const TypeName&) = delete
      |            ^~~~~
ipc/chromium/src/base/threading/thread_local.h:95:3: note: in expansion of macro 'DISALLOW_COPY_AND_ASSIGN'
      |   DISALLOW_COPY_AND_ASSIGN(ThreadLocalPointer<T>);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~

Google replaced chromium/base's DISALLOW_COPY_AND_ASSIGN macros with explicitly deleted constructors, so let's apply their upstream fix:

7319bbdb7d

Differential Revision: https://phabricator.services.mozilla.com/D150216
2022-06-28 04:17:30 +00:00
serge-sans-paille 896a2f9a5f Bug 1775148 - Cleanup ipc/ includes r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D149802
2022-06-23 15:49:57 +00:00
Jed Davis c807158580 Bug 1770905 - Allow GeckoMediaPlugin processes on Linux to be profiled if memfd_create is available. r=gcp,mstange,media-playback-reviewers,padenot
There are two parts to this patch; both affect only Linux:

1. The GMP sandbox policy is adjusted to allow certain syscalls used in
   shared memory creation (ftruncate and fallocate).  However, the file
   broker is not used; the process still has no access to files in /dev/shm.

2. The profiler is not initialized for GMP processes unless memfd_create
   is available (so the process can create shared memory to send
   profiling data back, without filesystem access), or the GMP sandbox
   is disabled (either at runtime or build time).

As of this patch, profiling GMP processes on Linux should succeed on
distros with kernel >=3.17 (Oct. 2014), but native stack frames won't
have symbols (and may be incorrectly unwound, not that it matters much
without symbols); see the bug for more info.  Pseudo-stack frames and
markers should work, however.

Differential Revision: https://phabricator.services.mozilla.com/D148470
2022-06-15 20:55:24 +00:00
Nika Layzell cefa79c10e Bug 1769593 - Part 1: Fail when serializing file handles in excess of MAX_DESCRIPTORS_PER_MESSAGE, r=jld
Differential Revision: https://phabricator.services.mozilla.com/D146501
2022-05-26 20:16:09 +00:00
Nika Layzell 36b38fb3c0 Bug 1767514 - Part 3: Retry sending fds if sendmsg fails, r=ipc-reviewers,jld
Before this change, we wouldn't re-try sending fds if the first attempt
to send them failed, meaning that some fds wouldn't arrive if there was
any error sending (e.g. because the send buffer was full, which
is more common on macOS).

This new approach ensures we don't record that we've sent the fds until
the message is marked as successful, and should avoid the macOS errors.

Depends on D145392

Differential Revision: https://phabricator.services.mozilla.com/D146621
2022-05-24 14:41:11 +00:00
Nika Layzell 39f1df8386 Bug 1767514 - Part 2: Increase the attached handle limit for IPC Messages, r=ipc-reviewers,jld
This is made possible by part 1, which made it possible to send more messages
using IPC::Channel. A limit is still in place, however it is now substantially
higher, hopefully making it effectively unlimited for practical purposes.

Differential Revision: https://phabricator.services.mozilla.com/D145392
2022-05-24 14:41:10 +00:00
Nika Layzell 2a7c5cf9a5 Bug 1767514 - Part 1: Decouple the IPC::Message max handle count and the number of FDs supported by IPC::Channel, r=ipc-reviewers,jld
This is done by splitting messages with large numbers of handles into multiple
`sendmsg` calls, each of which contains less than the maximum number of
transferred handles per-message, and stitching the message back together on the
receiving side. Most of the work on the receiving side was already handled by
the IPC::Channel code, so the work required was only to ensure we could split
the handle list up when sending.

Differential Revision: https://phabricator.services.mozilla.com/D145391
2022-05-24 14:41:10 +00:00
Nika Layzell ed88dc4370 Bug 1768476 - Part 1: Consistently pass IPC::Message around by UniquePtr, r=ipc-reviewers,mccr8
This makes passing around the type more consistent, and hopefully will make
changes to IPC::Message easier to work with in the future.

In addition, this should save us a few copies as we move the message type into
and out of UniquePtr, however I expect this won't make much of a difference.

Differential Revision: https://phabricator.services.mozilla.com/D145885
2022-05-10 21:37:25 +00:00
Noemi Erli 72d8a8554a Backed out 2 changesets (bug 1768476) for causing build bustages in ProtocolFuzzer.h
Backed out changeset c9cb03579c09 (bug 1768476)
Backed out changeset 6732ef394d0e (bug 1768476)
2022-05-10 23:39:29 +03:00
Nika Layzell edf2564dbc Bug 1768476 - Part 1: Consistently pass IPC::Message around by UniquePtr, r=ipc-reviewers,mccr8
This makes passing around the type more consistent, and hopefully will make
changes to IPC::Message easier to work with in the future.

In addition, this should save us a few copies as we move the message type into
and out of UniquePtr, however I expect this won't make much of a difference.

Differential Revision: https://phabricator.services.mozilla.com/D145885
2022-05-10 17:45:42 +00:00
Christian Holler 0ccdc33183 Bug 1756778 - Integrate top-level IPC fuzzing. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D139471
2022-05-05 15:39:24 +00:00
Mike Hommey 12df1ed1b6 Bug 1766561 - Use %lu for Windows Error types (DWORD). r=rkraesig,xpcom-reviewers,application-update-reviewers,mhowell,bobowen,necko-reviewers,keeler,media-playback-reviewers,bytesized,barret,alwu,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D144914
2022-05-03 20:49:07 +00:00
Mike Hommey b539884bcf Bug 1766561 - Adapt formatting to the difference in ProcessId type across platforms. r=nika,necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D144911
2022-05-03 20:49:04 +00:00
Ryan VanderMeulen 223d5620a4 Bug 1766848 - Update libevent to version 2.1.12. r=jld
Differential Revision: https://phabricator.services.mozilla.com/D144950
2022-05-03 01:29:13 +00:00
Mike Hommey e55237be4d Bug 1766377 - Fix sign-compare warnings related to Windows constants. r=rkraesig,gfx-reviewers,sotaro
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned long' and 'const long' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long, long>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/components/maintenanceservice/tests/gtest/ServiceStartInteractiveOnly.cpp(51,3): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long, long, nullptr>' requested here
  ASSERT_EQ(GetLastError(), ERROR_ACCESS_DENIED);
  ^
obj-build/dist/include/gtest/gtest.h(1871,31): note: expanded from macro 'ASSERT_EQ'
                              ^
obj-build/dist/include/gtest/gtest.h(1855,54): note: expanded from macro 'GTEST_ASSERT_EQ'
  ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned long' and 'const long' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long, long>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/library/gtest/TestUCRTDepends.cpp(52,5): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long, long, nullptr>' requested here
    EXPECT_EQ(GetLastError(), ERROR_FILE_NOT_FOUND);
    ^
obj-build/dist/include/gtest/gtest.h(1842,54): note: expanded from macro 'EXPECT_EQ'
  EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
ipc/chromium/src/base/thread_local_win.cc(18,14): error: comparison of integers of different signs: 'base::ThreadLocalPlatform::SlotType' (aka 'int') and 'DWORD' (aka 'unsigned long') [-Werror,-Wsign-compare]
  CHECK(slot != TLS_OUT_OF_INDEXES);
        ~~~~ ^  ~~~~~~~~~~~~~~~~~~

ipc/glue/WindowsMessageLoop.cpp(381,44): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]
        if (objId == OBJID_CLIENT || objId == MOZOBJID_UIAROOT) {
                                     ~~~~~ ^  ~~~~~~~~~~~~~~~~
ipc/glue/WindowsMessageLoop.cpp(381,19): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'LONG' (aka 'long') [-Werror,-Wsign-compare]
        if (objId == OBJID_CLIENT || objId == MOZOBJID_UIAROOT) {
            ~~~~~ ^  ~~~~~~~~~~~~
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned long' and 'const long' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long, long>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
xpcom/tests/windows/TestPoisonIOInterposer.cpp(108,5): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long, long, nullptr>' requested here
    EXPECT_EQ(::GetLastError(), ERROR_IO_PENDING);
    ^
obj-build/dist/include/gtest/gtest.h(1842,54): note: expanded from macro 'EXPECT_EQ'
  EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
gfx/thebes/gfxGDIFont.cpp(454,13): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'HRESULT' (aka 'long') [-Werror,-Wsign-compare]
    if (ret == E_PENDING) {
        ~~~ ^  ~~~~~~~~~
accessible/windows/msaa/Compatibility.cpp(120,21): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'HRESULT' (aka 'long') [-Werror,-Wsign-compare]
  if (exceptionCode == RPC_E_CANTCALLOUT_ININPUTSYNCCALL && NS_IsMainThread()) {
      ~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
widget/windows/WinIMEHandler.cpp(166,35): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'LONG' (aka 'long') [-Werror,-Wsign-compare]
      static_cast<DWORD>(aLParam) == OBJID_CARET) {
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~
widget/windows/nsWindow.cpp(541,37): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'LONG' (aka 'long') [-Werror,-Wsign-compare]
        static_cast<DWORD>(aLParam) != OBJID_CLIENT ||
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~

Differential Revision: https://phabricator.services.mozilla.com/D144692
2022-04-29 09:14:11 +00:00
Norisz Fay 6e06e2da92 Backed out 4 changesets (bug 1766377) for causing mochitest failures on HyperTextAccessible.cpp CLOSED TREE
Backed out changeset 6335511477a4 (bug 1766377)
Backed out changeset e8108d6fab9f (bug 1766377)
Backed out changeset 80d16d55c490 (bug 1766377)
Backed out changeset 1a6583d6e52e (bug 1766377)
2022-04-29 07:35:11 +03:00
Mike Hommey c7ad9c4633 Bug 1766377 - Fix sign-compare warnings related to Windows constants. r=rkraesig,gfx-reviewers,sotaro
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned long' and 'const long' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long, long>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/components/maintenanceservice/tests/gtest/ServiceStartInteractiveOnly.cpp(51,3): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long, long, nullptr>' requested here
  ASSERT_EQ(GetLastError(), ERROR_ACCESS_DENIED);
  ^
obj-build/dist/include/gtest/gtest.h(1871,31): note: expanded from macro 'ASSERT_EQ'
                              ^
obj-build/dist/include/gtest/gtest.h(1855,54): note: expanded from macro 'GTEST_ASSERT_EQ'
  ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned long' and 'const long' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long, long>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
toolkit/library/gtest/TestUCRTDepends.cpp(52,5): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long, long, nullptr>' requested here
    EXPECT_EQ(GetLastError(), ERROR_FILE_NOT_FOUND);
    ^
obj-build/dist/include/gtest/gtest.h(1842,54): note: expanded from macro 'EXPECT_EQ'
  EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
ipc/chromium/src/base/thread_local_win.cc(18,14): error: comparison of integers of different signs: 'base::ThreadLocalPlatform::SlotType' (aka 'int') and 'DWORD' (aka 'unsigned long') [-Werror,-Wsign-compare]
  CHECK(slot != TLS_OUT_OF_INDEXES);
        ~~~~ ^  ~~~~~~~~~~~~~~~~~~

ipc/glue/WindowsMessageLoop.cpp(381,44): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]
        if (objId == OBJID_CLIENT || objId == MOZOBJID_UIAROOT) {
                                     ~~~~~ ^  ~~~~~~~~~~~~~~~~
ipc/glue/WindowsMessageLoop.cpp(381,19): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'LONG' (aka 'long') [-Werror,-Wsign-compare]
        if (objId == OBJID_CLIENT || objId == MOZOBJID_UIAROOT) {
            ~~~~~ ^  ~~~~~~~~~~~~
obj-build/dist/include/gtest/gtest.h(1354,11): error: comparison of integers of different signs: 'const unsigned long' and 'const long' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
obj-build/dist/include/gtest/gtest.h(1373,12): note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long, long>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
xpcom/tests/windows/TestPoisonIOInterposer.cpp(108,5): note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long, long, nullptr>' requested here
    EXPECT_EQ(::GetLastError(), ERROR_IO_PENDING);
    ^
obj-build/dist/include/gtest/gtest.h(1842,54): note: expanded from macro 'EXPECT_EQ'
  EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
gfx/thebes/gfxGDIFont.cpp(454,13): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'HRESULT' (aka 'long') [-Werror,-Wsign-compare]
    if (ret == E_PENDING) {
        ~~~ ^  ~~~~~~~~~
accessible/windows/msaa/Compatibility.cpp(120,21): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'HRESULT' (aka 'long') [-Werror,-Wsign-compare]
  if (exceptionCode == RPC_E_CANTCALLOUT_ININPUTSYNCCALL && NS_IsMainThread()) {
      ~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
widget/windows/WinIMEHandler.cpp(166,35): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'LONG' (aka 'long') [-Werror,-Wsign-compare]
      static_cast<DWORD>(aLParam) == OBJID_CARET) {
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~
widget/windows/nsWindow.cpp(541,37): error: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'LONG' (aka 'long') [-Werror,-Wsign-compare]
        static_cast<DWORD>(aLParam) != OBJID_CLIENT ||
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~

Differential Revision: https://phabricator.services.mozilla.com/D144692
2022-04-29 00:43:31 +00:00
Mike Hommey fa9c3e047a Bug 1766377 - Fixup after ccb0fe2d2fcf
Differential Revision: https://phabricator.services.mozilla.com/D145046
2022-04-29 00:43:30 +00:00
Florian Queze 8783e2cbbb Bug 1766883 - Avoid marking IPC I/O threads asleep when GetQueuedCompletionStatus is called with a 0ms timeout, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D144994
2022-04-28 21:32:42 +00:00
Mike Hommey af7d5859d7 Bug 1766377 - Fix some sign-compare warnings by using ProcessId more consistently. r=nika,necko-reviewers,kershaw
dom/media/ipc/RDDProcessManager.cpp(320,21): error: comparison of integers of different signs: 'base::ProcessId' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]
      gpuProcessPid != -1 ? gpuProcessPid : base::GetCurrentProcId();
      ~~~~~~~~~~~~~ ^  ~~
dom/media/ipc/RDDProcessManager.cpp(332,21): error: comparison of integers of different signs: 'base::ProcessId' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]
  if (gpuProcessPid != -1) {
      ~~~~~~~~~~~~~ ^  ~~
gfx/layers/ipc/SharedSurfacesParent.cpp(360,38): error: comparison of integers of different signs: 'base::ProcessId' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]
    if (!gpm || gpm->GPUProcessPid() != -1) {
                ~~~~~~~~~~~~~~~~~~~~ ^  ~~
ipc/glue/MessageChannel.cpp(2145,13): error: comparison of integers of different signs: 'int32_t' (aka 'int') and 'const base::ProcessId' (aka 'const unsigned long') [-Werror,-Wsign-compare]
    if (pid != base::kInvalidProcessId &&
        ~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~

Differential Revision: https://phabricator.services.mozilla.com/D144688
2022-04-27 07:45:19 +00:00
Mike Hommey 3da3b13f2a Bug 1766359 - Fix unreachable-code-return warnings in Windows builds. r=emilio,mhowell,nika,rkraesig
dom/system/PathUtils.cpp(77,10): error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
  return false;
         ^~~~~
ipc/chromium/src/chrome/common/ipc_channel_win.cc(479,10): error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
  return true;
         ^~~~
mozglue/misc/PreXULSkeletonUI.cpp(1263,10): error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
  return 0;
         ^
mozglue/tests/TestPEExportSection.cpp(348,12): error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
    return 0;
           ^
security/manager/ssl/OSReauthenticator.cpp(428,10): error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
  return NS_OK;
         ^~~~~
toolkit/components/maintenanceservice/maintenanceservice.cpp(214,10): error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
  return 0;
         ^
widget/windows/WindowsUIUtils.cpp(383,10): error: 'return' will never be executed [-Werror,-Wunreachable-code-return]
  return false;
         ^~~~~

Differential Revision: https://phabricator.services.mozilla.com/D144661
2022-04-26 21:44:54 +00:00
Nika Layzell 7fbd8108a1 Bug 1761547 - Avoid the deadlock detector for mojo Port mutexes, r=ipc-reviewers,mccr8
Due to the way that ports are locked (occasionally in large groups in
address order) these mutexes seem to occasionally overwhelm the deadlock
detector with very long chains of lock dependencies, sometimes leading
to stack overflow issues.

As the imported code from chromium is already quite careful about
avoiding deadlocks with these locks, this patch switches them to use a
custom mutex which is not registered with the deadlock detector to avoid
these issues.

Differential Revision: https://phabricator.services.mozilla.com/D142130
2022-04-13 16:11:51 +00:00
Nika Layzell 5b2ada26c5 Bug 1738103 - Part 4: Add XPCOM support for shutdown tasks, r=necko-reviewers,KrisWright
Tasks registered with shutdown tasks are called when the target
nsISerialEventTarget is about to be destroyed.

Differential Revision: https://phabricator.services.mozilla.com/D129840
2022-03-23 22:22:04 +00:00
Nika Layzell 2637d4b88f Bug 1760357 - Part 5: Add basic annotations to the mojo ports code, r=jesup
Unfortunately the locking behaviour in ports around the Port type is a bit too
complex to easily express in a way which satisfies the thread safety analysis,
so it was not annotated.

Differential Revision: https://phabricator.services.mozilla.com/D141536
2022-03-22 14:59:42 +00:00
Nika Layzell 8b588479cd Bug 1760357 - Part 4: Add straightforward annotations to IPC types, r=jesup
Differential Revision: https://phabricator.services.mozilla.com/D141535
2022-03-22 14:59:41 +00:00
Cristian Tuns f22866f09c Backed out 5 changesets (bug 1760357) for causing build bustages on Monitor.h CLOSED TREE
Backed out changeset 799de364a32e (bug 1760357)
Backed out changeset 29957146468a (bug 1760357)
Backed out changeset e79cb8caca88 (bug 1760357)
Backed out changeset afba32f4da1d (bug 1760357)
Backed out changeset ddfc71cdf34e (bug 1760357)
2022-03-21 19:01:11 -04:00
Nika Layzell 1f39b2ba9e Bug 1760357 - Part 5: Add basic annotations to the mojo ports code, r=jesup
Unfortunately the locking behaviour in ports around the Port type is a bit too
complex to easily express in a way which satisfies the thread safety analysis,
so it was not annotated.

Differential Revision: https://phabricator.services.mozilla.com/D141536
2022-03-21 21:06:00 +00:00
Nika Layzell bb950835f5 Bug 1760357 - Part 4: Add straightforward annotations to IPC types, r=jesup
Differential Revision: https://phabricator.services.mozilla.com/D141535
2022-03-21 21:05:59 +00:00
Randell Jesup fcaf70841e Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli 2390d257e6 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup 4b033a5256 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 16:16:14 +00:00
Nazım Can Altınova 7471bb6338 Bug 1758099 - Add the origin tid of the IPC markers if the thread is not being profiled r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D141100
2022-03-16 14:27:36 +00:00
Butkovits Atila 927ad62c6a Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup 7d4b5fae04 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 12:01:14 +00:00
Gerald Squelart 5802980a6e Bug 1757596 - #include "mozilla/ProfilerThreadSleep.h" instead of GeckoProfiler.h where possible - r=florian
And in one case, #include "mozilla/ProfilerThreadState.h" where only `AUTO_PROFILER_THREAD_WAKE` is used.

Depends on D140172

Differential Revision: https://phabricator.services.mozilla.com/D140173
2022-03-08 10:32:44 +00:00