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

90 Коммитов

Автор SHA1 Сообщение Дата
Nika Layzell 711b38a835 Bug 1892652 - Part 2: Note if shmem allocation failed in message size too large crashes, r=ipc-reviewers,jld
In part 1, a fallback was added to allow message buffers which would be sent as
shmem to be sent inline if shmem allocation or mapping failed. This could
potentially lead to an increase in message size too large crashes, as these
messages are now being sent inline again.

This patch adds an extra crash annotaion such that failures of this kind can be
identified in socorro.

Depends on D209880

Differential Revision: https://phabricator.services.mozilla.com/D209881
2024-05-15 16:33:26 +00:00
Gabriele Svelto aa43fa218e Bug 1831092 - Use the new pull-based API for all crash annotations and remove the global annotations table r=jgilbert,necko-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,padenot,handyman,afranchuk,valentin,alwu,sotaro
This changes comes with several different refactorings all rolled into one,
unfotunately I couldn't find a way to pull them apart:
- First of all annotations now can either recorded (that is, we copy the value
  and have the crash reporting code own the copy) or registered. Several
  annotations are changed to use this functionality so that we don't need to
  update them as their value change.
- The code in the exception handler is modified to read the annotations from
  the mozannotation_client crate. This has the unfortunate side-effect that
  we need three different bits of code to serialize them: one for annotations
  read from a child process, one for reading annotations from the main process
  outside of the exception handler and one for reading annotations from the
  main process within the exception handler. As we move to fully
  out-of-process crash reporting the last two methods will go away.
- The mozannotation_client crate now doesn't record annotation types anymore.
  I realized as I was working on this that storing types at runtime has two
  issues: the first one is that buggy code might change the type of an
  annotation (that is record it under two different types at two different
  moments), the second issue is that types might become corrupt during a
  crash, so better enforce them at annotation-writing time. The end result is
  that the mozannotation_* crates now only store byte buffers, track the
  format the data is stored in (null-terminated string, fixed size buffer,
  etc...) but not the type of data each annotation is supposed to contain.
- Which brings us to the next change: concrete types for annotations are now
  enforced when they're written out. If an annotation doesn't match the
  expected type it's skipped. Storing an annotation with the wrong type will
  also trigger an assertion in debug builds.

Differential Revision: https://phabricator.services.mozilla.com/D195248
2024-03-04 10:24:43 +00:00
Jim Blandy ead739b02b Bug 1850865: Add helpers for stringifying protocol sides. r=ipc-reviewers,nika
Depends on D187167

Differential Revision: https://phabricator.services.mozilla.com/D187213
2023-09-05 18:09:30 +00:00
Nika Layzell 759d19c6b9 Bug 1807049 - Refactor MessageChannel shutdown states, r=ipc-reviewers,mccr8
This refactoring cleans up some dead code, and makes some semantic
changes to how the MessageChannel lifecycle is handled.

These changes ensure that messages which were sent by a peer before the
GOODBYE message will be delivered, without allowing messages sent after
the GOODBYE message (e.g. by a misbehaving process) to be delivered.

The lifecycle and shutdown states were simplified, and moved to be
entirely in MessageChannel, rather than split between MessageChannel and
MessageLink.

The dead-code ChannelTimeout error state was removed, along with the
corresponding CloseWithTimeout method.

The CloseWithError method was updated to behave more consistently with
the normal Close method, synchronously triggering a connection error,
and closing the MessageLink. This method is currently unused, but will
useful in the future for handling processing errors.

Differential Revision: https://phabricator.services.mozilla.com/D178382
2023-05-26 17:44:57 +00:00
Stanca Serban 0d97343733 Backed out 2 changesets (bug 1807049, bug 1828389) for mozilla::ThreadEventTarget::Dispatch xpcshell related crashes. CLOSED TREE
Backed out changeset bbd8b8bbf677 (bug 1828389)
Backed out changeset 03bd5f26f9af (bug 1807049)
2023-05-20 07:38:09 +03:00
Nika Layzell aa762bdda9 Bug 1807049 - Refactor MessageChannel shutdown states, r=ipc-reviewers,mccr8
This refactoring cleans up some dead code, and makes some semantic
changes to how the MessageChannel lifecycle is handled.

These changes ensure that messages which were sent by a peer before the
GOODBYE message will be delivered, without allowing messages sent after
the GOODBYE message (e.g. by a misbehaving process) to be delivered.

The lifecycle and shutdown states were simplified, and moved to be
entirely in MessageChannel, rather than split between MessageChannel and
MessageLink.

The dead-code ChannelTimeout error state was removed, along with the
corresponding CloseWithTimeout method.

The CloseWithError method was updated to behave more consistently with
the normal Close method, synchronously triggering a connection error,
and closing the MessageLink. This method is currently unused, but will
useful in the future for handling processing errors.

Differential Revision: https://phabricator.services.mozilla.com/D178382
2023-05-19 19:21:08 +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
Randell Jesup c5917ed65a Bug 1207753: Basic thread-safety annotations to quiet errors until real annotations land r=nika
Differential Revision: https://phabricator.services.mozilla.com/D141062
2022-03-17 18:39:15 +00:00
Randell Jesup 04eee57501 Bug 1748759: ipc cleanup r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D135184
2022-02-10 22:01:17 +00:00
Nika Layzell 99a0665a8b Bug 1719577 - Part 7: Remove outdated comment, r=handyman
This comment refers to the old ProcessLink implementation, and was missed when
that implementation was removed.

Differential Revision: https://phabricator.services.mozilla.com/D119355
2021-07-23 19:14:58 +00:00
Nika Layzell 30d790aee6 Bug 1719577 - Part 4: Hold the monitor for more of `MessageChannel::Open`, r=handyman
This simplifies some of the reasoning about when to hold locks by holding it
when setting all monitor-guarded fields.

Differential Revision: https://phabricator.services.mozilla.com/D119352
2021-07-23 19:14:57 +00:00
Nika Layzell 80d5716044 Bug 1717728 - Hold MessageChannel's monitor when creating PortLink, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D118562
2021-07-12 20:36:20 +00:00
Nika Layzell 5cc51fa13f Bug 1713148 - Part 5: Remove ThreadLink, r=handyman
This removes the last form of unique link between two MessageChannels so that
all MessageChannels communicate using PortLink, as it is fairly straightforward
to use PortLink to communicate between two threads in-process.

Differential Revision: https://phabricator.services.mozilla.com/D116672
2021-06-22 18:17:25 +00:00
Nika Layzell 7dba3a39f8 Bug 1713148 - Part 4: Remove ProcessLink, r=handyman
After the changes in part 3, this type is now dead code and can be fully
removed.

Differential Revision: https://phabricator.services.mozilla.com/D116671
2021-06-22 18:17:25 +00:00
Nika Layzell 985adb750c Bug 1706374 - Part 11: Add NodeController component bridging IPC and Ports, r=handyman
The NodeController and NodeChannel types act as the backbone connecting the
existing IPC logic and driving the ports routing code. Individual NodeChannel
objects wrap and respond to messages from IPC::Channel, and the NodeController
orchestrates all messaging for a process.

The design of these types are inspired by the types with the same names from
Mojo but have been simplified and streamlined to only support features used by
Gecko.

Support for attaching ports or handles to messages hasn't been added yet, but
can be added in follow-up patches.

Differential Revision: https://phabricator.services.mozilla.com/D112775
2021-06-22 18:17:22 +00:00
Nika Layzell 9ae1129462 Bug 1706374 - Part 10: Remove unnecessary IToplevelProtocol::OnChannelConnected, r=handyman,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D116665
2021-06-22 18:17:21 +00:00
Butkovits Atila 83f57b5c69 Backed out 22 changesets (bug 1714226, bug 1706374, bug 1713148) for causing build bustages on MessageChannel.cpp. CLOSED TREE
Backed out changeset ea469eaa54ca (bug 1713148)
Backed out changeset fd8523d5126e (bug 1713148)
Backed out changeset f2e5309c914c (bug 1713148)
Backed out changeset 2da57973ed55 (bug 1713148)
Backed out changeset 677e1ee99bb2 (bug 1713148)
Backed out changeset b4c0619e79bf (bug 1706374)
Backed out changeset c02fa459e77d (bug 1706374)
Backed out changeset 72dc6537cf0b (bug 1706374)
Backed out changeset 48088463c656 (bug 1706374)
Backed out changeset b09ae4c3a94b (bug 1706374)
Backed out changeset 04422175004b (bug 1706374)
Backed out changeset 110b2384e7d1 (bug 1706374)
Backed out changeset ab2b086abbd4 (bug 1706374)
Backed out changeset ffde07f73249 (bug 1706374)
Backed out changeset c6303af17ff4 (bug 1706374)
Backed out changeset 02249671c2f9 (bug 1706374)
Backed out changeset a6a5d05b5636 (bug 1706374)
Backed out changeset e21b6defb805 (bug 1706374)
Backed out changeset c72c5be9ddb1 (bug 1706374)
Backed out changeset 23cd961575a6 (bug 1706374)
Backed out changeset b412d6e9e145 (bug 1706374)
Backed out changeset a8ec285d6472 (bug 1714226)
2021-06-22 04:03:56 +03:00
Nika Layzell 8e8aa56ee2 Bug 1713148 - Part 5: Remove ThreadLink, r=handyman
This removes the last form of unique link between two MessageChannels so that
all MessageChannels communicate using PortLink, as it is fairly straightforward
to use PortLink to communicate between two threads in-process.

Differential Revision: https://phabricator.services.mozilla.com/D116672
2021-06-21 21:53:13 +00:00
Nika Layzell 03646b0682 Bug 1713148 - Part 4: Remove ProcessLink, r=handyman
After the changes in part 3, this type is now dead code and can be fully
removed.

Differential Revision: https://phabricator.services.mozilla.com/D116671
2021-06-21 21:53:13 +00:00
Nika Layzell 6de2add6d7 Bug 1706374 - Part 11: Add NodeController component bridging IPC and Ports, r=handyman
The NodeController and NodeChannel types act as the backbone connecting the
existing IPC logic and driving the ports routing code. Individual NodeChannel
objects wrap and respond to messages from IPC::Channel, and the NodeController
orchestrates all messaging for a process.

The design of these types are inspired by the types with the same names from
Mojo but have been simplified and streamlined to only support features used by
Gecko.

Support for attaching ports or handles to messages hasn't been added yet, but
can be added in follow-up patches.

Differential Revision: https://phabricator.services.mozilla.com/D112775
2021-06-21 21:53:10 +00:00
Nika Layzell 4a956a2673 Bug 1706374 - Part 10: Remove unnecessary IToplevelProtocol::OnChannelConnected, r=handyman,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D116665
2021-06-21 21:53:10 +00:00
Jean-Yves Avenard b2cf09ec3e Bug 1634846 - P2. Make ipc's MessageChannel works with TaskQueue, r=nika
We no longer rely of having a message loop for the worker thread.

Differential Revision: https://phabricator.services.mozilla.com/D80655
2020-07-02 00:26:41 +00:00
Narcis Beleuzu 3700aab557 Backed out 7 changesets (bug 1634846, bug 1647628, bug 1649294, bug 1647112) for webgl-conf crashes. CLOSED TREE
Backed out changeset 4441d06e96c3 (bug 1647628)
Backed out changeset 4efaf32bc8f7 (bug 1647112)
Backed out changeset 2d24ad813039 (bug 1647112)
Backed out changeset fda262d73a13 (bug 1649294)
Backed out changeset 5863f9c5229f (bug 1634846)
Backed out changeset bca79526745d (bug 1634846)
Backed out changeset d539408a0048 (bug 1634846)
2020-06-30 09:50:00 +03:00
Jean-Yves Avenard 35101e741b Bug 1634846 - P2. Make ipc's MessageChannel works with TaskQueue, r=nika
We no longer rely of having a message loop for the worker thread.

Differential Revision: https://phabricator.services.mozilla.com/D80655
2020-06-26 09:34:47 +00:00
Andrew McCreight 0442082a5e Bug 1090374 - Convert MessageChannel::mLink to a UniquePtr. r=froydnj
The change to MessageChannel::Clear() makes mLink get cleared before
we call ~ThreadLink. This causes a race because Clear() is not
holding the monitor. To work around this, I introduced a new method
PrepareToDestroy() that handles the ThreadLink splitting. Once the
ThreadLinks are split, MessageChannel can clear mLink without a
race.

An alternative approach would be to hold the monitor in Clear()
before mLink is cleared, but then we'd end up acquiring the lock
when we didn't need to in the case where mLink is a ProcessLink.

Differential Revision: https://phabricator.services.mozilla.com/D79185
2020-06-16 22:33:55 +00:00
Andrew McCreight 8eefcc3e76 Bug 1642631 - Make the message argument to Channel::Send() a UniquePtr. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D77876
2020-06-02 21:23:08 +00:00
Andrew McCreight 82c3c9a58a Bug 1642619 - Remove the unused MessageChannel::Echo(). r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D77804
2020-06-02 13:56:07 +00:00
Nathan Froyd 1c9fd5bc7c Bug 1635720 - add diagnostic asserts for outgoing IPC messages; r=jld,nika
We are seeing crashes on aarch64 Fenix devices that appear to be related
to zero-sized messages.  But we're seeing the crashes when we're trying
to send the messages on the IO thread, and not where we're dispatching
them from.  Add some asserts so we get errors closer to the source, and
add some asserts for other things that we believe to be true and would
be useful to know aren't actually true.

Differential Revision: https://phabricator.services.mozilla.com/D76496
2020-05-22 22:25:27 +00:00
Jan Varga d5b34cc887 Bug 1542884 - Close message channel on failure to connect to the pipe; r=jld
Differential Revision: https://phabricator.services.mozilla.com/D63874

--HG--
extra : moz-landing-system : lando
2020-03-02 23:14:15 +00:00
Nika Layzell c56289e054 Bug 1557739 - Be more consistent with IPC Transport APIs, r=jld
Differential Revision: https://phabricator.services.mozilla.com/D60285

--HG--
extra : moz-landing-system : lando
2020-02-06 22:41:56 +00:00
Simon Giesecke 42816d8112 Bug 1597211 - Do not cast IPC message size to signed int. r=jld
Differential Revision: https://phabricator.services.mozilla.com/D53793

--HG--
extra : moz-landing-system : lando
2019-11-21 01:26:08 +00:00
Nathan Froyd 7509b5e08a Bug 1577831 - remove `using namespace std;` from IPC glue code; r=jld
Just some minor prefixing needs to be done to enable this.

Differential Revision: https://phabricator.services.mozilla.com/D44220

--HG--
extra : moz-landing-system : lando
2019-08-31 00:00:12 +00:00
Sylvestre Ledru e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

Differential Revision: https://phabricator.services.mozilla.com/D28956

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +00:00
Tooru Fujisawa 7983faeb5d Bug 1511393 - Use c-basic-offset: 2 in Emacs mode line for C/C++ code. r=nbp 2018-12-01 04:52:05 +09:00
Benjamin Bouvier a7f1d173a0 Bug 1511383: Update vim modelines after clang-format; r=sylvestre
- modify line wrap up to 80 chars; (tw=80)
- modify size of tab to 2 chars everywhere; (sts=2, sw=2)

--HG--
extra : rebase_source : 7eedce0311b340c9a5a1265dc42d3121cc0f32a0
extra : amend_source : 9cb4ffdd5005f5c4c14172390dd00b04b2066cd7
2018-11-30 16:39:55 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Gabriele Svelto 15adf94f4d Bug 1348273 - Convert crash annotations into a machine-readable list of constants; r=ted.mielczarek,njn,dholbert,mak,cpearce,mcmanus,froydnj,Dexter,jrmuizel,jchen,jimm,bz,surkov
This introduces the machinery needed to generate crash annotations from a YAML
file. The relevant C++ functions are updated to take a typed enum. JavaScript
calls are unaffected but they will throw if the string argument does not
correspond to one of the known entries in the C++ enum. The existing whitelists
and blacklists of annotations are also generated from the YAML file and all
duplicate code related to them has been consolidated. Once written out to the
.extra file the annotations are converted in string form and are no different
than the existing ones.

All existing annotations have been included in the list (and some obsolete ones
have been removed) and all call sites have been updated including tests where
appropriate.

--HG--
extra : source : 4f6c43f2830701ec5552e08e3f1b06fe6d045860
2018-07-05 15:42:11 +02:00
Emilio Cobos Álvarez fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Chris Peterson 71422dcaa9 Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj
s/NS_PRECONDITION/MOZ_ASSERT/ and reindent

MozReview-Commit-ID: KuUsnVe2h8L

--HG--
extra : source : c14655ab3df2c9b1465dd8102b9d25683359a37b
2018-04-28 12:50:58 -07:00
Gabriele Svelto ef3b2f88cc Bug 1402519 - Remove MOZ_CRASHREPORTER directives from ipc; r=billm
MozReview-Commit-ID: 4mDW7cJqHDn

--HG--
extra : rebase_source : 17c51ed796733d4a512e1d6f47273318dcc26b11
2017-10-10 12:06:35 +02:00
shindli fb855aa7ba Backed out 16 changesets (bug 1402519) for conflicts during merge r=backout on a CLOSED TREE
Backed out changeset 07fcf163241a (bug 1402519)
Backed out changeset c6d2ad45d8e2 (bug 1402519)
Backed out changeset 8a3caca61294 (bug 1402519)
Backed out changeset 01425eae2c48 (bug 1402519)
Backed out changeset cf298d3815de (bug 1402519)
Backed out changeset e1964f4389cd (bug 1402519)
Backed out changeset f405337f3569 (bug 1402519)
Backed out changeset a76356fd3359 (bug 1402519)
Backed out changeset d3bb350d1c34 (bug 1402519)
Backed out changeset 9d3bfd9f932c (bug 1402519)
Backed out changeset e3dd6e5b073f (bug 1402519)
Backed out changeset e801b0c00134 (bug 1402519)
Backed out changeset 8a4139fa5dca (bug 1402519)
Backed out changeset 8d01c14ac1ca (bug 1402519)
Backed out changeset 24e0dcd01898 (bug 1402519)
Backed out changeset f8fdf450613f (bug 1402519)
2017-11-23 00:11:44 +02:00
Gabriele Svelto f0b9eb9ff9 Bug 1402519 - Remove MOZ_CRASHREPORTER directives from ipc; r=billm
MozReview-Commit-ID: 4mDW7cJqHDn

--HG--
extra : rebase_source : a13301f4faea301cd528179790f2430171f59a48
2017-10-10 12:06:35 +02:00
Bill McCloskey 638d315450 Bug 1388920 - Call OnChannelConnected handler in parent protocols (r=bkelly)
MozReview-Commit-ID: 8lmpPlmraSw
2017-08-10 14:31:13 -07:00
Bill McCloskey 848a0761c6 Bug 1340941 - Fix race if IPDL actors are created and then quickly destroyed (r=bevis)
MozReview-Commit-ID: FnjvWePo6Oo
2017-07-25 12:23:21 -07:00
Sylvestre Ledru 4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02:00
Bill McCloskey f115503a0b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
David Anderson aa1457713c Allow IPDL message sends to be deferred and re-sent as needed. (bug 1369529 part 2, r=billm)
--HG--
extra : rebase_source : 46d2af94da6b38e8c2fe70fd4566650d8cec8fe4
2017-06-21 13:40:18 -07:00
Carsten "Tomcat" Book 8a1350b5a6 Backed out changeset 4f6302a98ae4 (bug 1372405)
--HG--
extra : rebase_source : 41632f3158e88e692809731394a683d065a73dfb
2017-06-21 13:59:26 +02:00