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

99 Коммитов

Автор SHA1 Сообщение Дата
Gabriele Svelto 80f0c61cf5 Bug 1896650 - Remove sequence numbers from crash reports r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D210309
2024-05-21 19:58:18 +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
Gabriele Svelto a7d2695d2a Bug 1784039 - Remove the `isLikelyOOM` property from ipc:content-shutdown messages r=jld
Differential Revision: https://phabricator.services.mozilla.com/D154226
2022-09-13 07:01:57 +00:00
Gabriele Svelto b25541c86f Bug 1789421 - Generate crash reports for content process shutdown hangs only when we can confirm that the process did not shut down in time r=jstutte
Differential Revision: https://phabricator.services.mozilla.com/D156838
2022-09-12 19:05:24 +00:00
Butkovits Atila cfd3972560 Backed out changeset bff57b2e4b16 (bug 1789421) for causing build bustage. CLOSED TREE 2022-09-12 12:37:57 +03:00
Gabriele Svelto 8e3d3f6b58 Bug 1789421 - Generate crash reports for content process shutdown hangs only when we can confirm that the process did not shut down in time r=jstutte
Differential Revision: https://phabricator.services.mozilla.com/D156838
2022-09-12 08:57:16 +00:00
Alexandre Lissy a9b9bae961 Bug 1726804 - Refactor PROCESS_TYPE_* from nsICrashService r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D121389
2021-11-19 14:02:56 +00:00
Alexandre Lissy 60d10601bb Bug 1726804 - Refactor definition and usage of GECKO_PROCESS_TYPE() r=nika,firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D121388
2021-11-19 14:02:55 +00:00
Alexandru Michis 2cb5b32d02 Backed out 2 changesets (bug 1726804) for causing sm bustages in geckoprocesstypes.
CLOSED TREE

Backed out changeset bf7f73fd1921 (bug 1726804)
Backed out changeset c9936f7534cb (bug 1726804)
2021-11-19 11:40:59 +02:00
Alexandre Lissy 882ec7bc7a Bug 1726804 - Refactor PROCESS_TYPE_* from nsICrashService r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D121389
2021-11-19 08:33:43 +00:00
Alexandre Lissy b71c7b7255 Bug 1726804 - Refactor definition and usage of GECKO_PROCESS_TYPE() r=nika,firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D121388
2021-11-19 08:33:42 +00:00
Gabriele Svelto 65f2ae5b03 Bug 1723934 - Remove old and useless crash annotations r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D121709
2021-08-09 20:08:17 +00:00
Nika Layzell e983da120a Bug 1706375 - Support building ipc/glue in non-unified mode, r=ipc-reviewers,mccr8
This both helps IDE integration and will help avoid build issues which would've
otherwise cropped up when adding new files to the directory for bug 1706374.

Differential Revision: https://phabricator.services.mozilla.com/D112764
2021-04-22 14:32:03 +00:00
David Parks 6b176f5987 Bug 1682030 - Remove NPAPI plugin process from GeckoChildProcess r=jld,gsvelto
Eliminates the NPAPI plugin process type from the GeckoChildProcess enum as part of NPAPI removal.  In order to avoid altering enum values when updating the process list, the GECKO_PROCESS_TYPE macro has been updated to include the desired enum value.  We want to resist altering the values as they need to be consistent e.g. in telemetry reports.

We also remove plugins from adjacent spots that need to maintain consistency with GeckoChildProcess -- most notably the nsICrashService.

Differential Revision: https://phabricator.services.mozilla.com/D108689
2021-04-06 19:28:20 +00:00
Csoregi Natalia d68661e2cc Backed out 24 changesets (bug 1682030) for bustage on ProcessHangMonitor.cpp and nsCOMPtr.h. CLOSED TREE
Backed out changeset 5b1644096477 (bug 1682030)
Backed out changeset 35ae60eea3c7 (bug 1682030)
Backed out changeset 3eca76a6d639 (bug 1682030)
Backed out changeset 259c45447ad9 (bug 1682030)
Backed out changeset de9222dc8c31 (bug 1682030)
Backed out changeset 2986c7e14349 (bug 1682030)
Backed out changeset 6af3410bdb93 (bug 1682030)
Backed out changeset 42b0621c2927 (bug 1682030)
Backed out changeset 366e3e371858 (bug 1682030)
Backed out changeset 9adb2865adea (bug 1682030)
Backed out changeset 6af6af3bc03a (bug 1682030)
Backed out changeset da94a91b35ae (bug 1682030)
Backed out changeset 9143da258d0e (bug 1682030)
Backed out changeset 5e20d06952ba (bug 1682030)
Backed out changeset 6253d7e1ce7d (bug 1682030)
Backed out changeset 0e06ddeea3e2 (bug 1682030)
Backed out changeset 9c58d57c9e44 (bug 1682030)
Backed out changeset e90edd89430e (bug 1682030)
Backed out changeset 5861b8166b10 (bug 1682030)
Backed out changeset b4b88cdc7993 (bug 1682030)
Backed out changeset b80054e9805c (bug 1682030)
Backed out changeset 580d857674c0 (bug 1682030)
Backed out changeset a9cdf93c2662 (bug 1682030)
Backed out changeset 9c9c8b4998e2 (bug 1682030)
2021-04-06 03:54:12 +03:00
David Parks 3f9c44a9ed Bug 1682030 - Remove NPAPI plugin process from GeckoChildProcess r=jld,gsvelto
Eliminates the NPAPI plugin process type from the GeckoChildProcess enum as part of NPAPI removal.  In order to avoid altering enum values when updating the process list, the GECKO_PROCESS_TYPE macro has been updated to include the desired enum value.  We want to resist altering the values as they need to be consistent e.g. in telemetry reports.

We also remove plugins from adjacent spots that need to maintain consistency with GeckoChildProcess -- most notably the nsICrashService.

Differential Revision: https://phabricator.services.mozilla.com/D108689
2021-04-05 23:48:43 +00:00
Simon Giesecke cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Gabriele Svelto 2bc88d71e0 Bug 1614933 - Gather content processes' crash annotations at exception time instead of using IPC; r=froydnj
Crash annotations in content processes are currently sent over IPC via
shared memory buffers. To pave the way for the Rust rewrite of the exception
handler we are removing this code and gathering all the crash annotations
within the content processes themselves. This patch causes annotations to be
stored in the global table of each content process. They are then streamed
out to the parent process by the exception handler together with the
exception-time annotations.

This has a number of benefits:

* we have one less channel to exchange data between content processes and
  the parent process
* we save memory because we don't need to allocate the shared memory buffers
* annotations are faster because we don't stream them all out every time one
  changes
* we won't truncate annotations anymore if we run out of space in the shared
  segment.
* we don't need delayed annotations anymore, so we can get rid of the
  associated machinery

As I refactored the code I tried to adjust all the obsolete comments,
consolidate shared code and remove the redundant steps that were sometimes
present. In many places we had two entire crash annotation tables we merged to
change just a couple; that comes from the fact that historically we loaded
them from disk. Now it doesn't matter anymore and we can just go ahead and
change the ones we care about.

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

--HG--
extra : moz-landing-system : lando
2020-04-08 06:55:40 +00:00
Brindusan Cristian 4646c1f41f Backed out 2 changesets (bug 1614933) for bc failures at browser_tabicon_after_bg_tab_crash.js.
Backed out changeset 59503d3a702f (bug 1614933)
Backed out changeset 578c8ba9598f (bug 1614933)
2020-03-22 17:30:07 +02:00
Gabriele Svelto 322404bebb Bug 1614933 - Gather content processes' crash annotations at exception time instead of using IPC; r=froydnj
Crash annotations in content processes are currently sent over IPC via
shared memory buffers. To pave the way for the Rust rewrite of the exception
handler we are removing this code and gathering all the crash annotations
within the content processes themselves. This patch causes annotations to be
stored in the global table of each content process. They are then streamed
out to the parent process by the exception handler together with the
exception-time annotations.

This has a number of benefits:

* we have one less channel to exchange data between content processes and
  the parent process
* we save memory because we don't need to allocate the shared memory buffers
* annotations are faster because we don't stream them all out every time one
  changes
* we won't truncate annotations anymore if we run out of space in the shared
  segment.
* we don't need delayed annotations anymore, so we can get rid of the
  associated machinery

As I refactored the code I tried to adjust all the obsolete comments,
consolidate shared code and remove the redundant steps that were sometimes
present. In many places we had two entire crash annotation tables we merged to
change just a couple; that comes from the fact that historically we loaded
them from disk. Now it doesn't matter anymore and we can just go ahead and
change the ones we care about.

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

--HG--
extra : moz-landing-system : lando
2020-03-21 17:13:08 +00:00
David Teller a3a1057083 Bug 1589493 - Expose CrashReporterHost::isLikelyOOM();r=gsvelto
We'll use this method to expose additional information to the front-end for recovering from OOM.

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

--HG--
extra : moz-landing-system : lando
2020-03-03 10:24:39 +00:00
Bogdan Tara fb2b3d4e41 Backed out 2 changesets (bug 1614933) for busages complaining about IdleSchedulerChild.cpp CLOSED TREE
Backed out changeset ff92f800a74e (bug 1614933)
Backed out changeset 5cee8f603ae4 (bug 1614933)
2020-03-10 17:21:55 +02:00
Gabriele Svelto 9336e8143b Bug 1614933 - Gather content processes' crash annotations at exception time instead of using IPC; r=froydnj
Crash annotations in content processes are currently sent over IPC via
shared memory buffers. To pave the way for the Rust rewrite of the exception
handler we are removing this code and gathering all the crash annotations
within the content processes themselves. This patch causes annotations to be
stored in the global table of each content process. They are then streamed
out to the parent process by the exception handler together with the
exception-time annotations.

This has a number of benefits:

* we have one less channel to exchange data between content processes and
  the parent process
* we save memory because we don't need to allocate the shared memory buffers
* annotations are faster because we don't stream them all out every time one
  changes
* we won't truncate annotations anymore if we run out of space in the shared
  segment.
* we don't need delayed annotations anymore, so we can get rid of the
  associated machinery

As I refactored the code I tried to adjust all the obsolete comments,
consolidate shared code and remove the redundant steps that were sometimes
present. In many places we had two entire crash annotation tables we merged to
change just a couple; that comes from the fact that historically we loaded
them from disk. Now it doesn't matter anymore and we can just go ahead and
change the ones we care about.

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

--HG--
extra : moz-landing-system : lando
2020-03-10 14:59:22 +00:00
Mihai Alexandru Michis f049ee5a93 Backed out 4 changesets (bug 1589493) for causing failures in test_process_error_oom.xhtml
CLOSED TREE

Backed out changeset d914e968de2c (bug 1589493)
Backed out changeset 2c23fed6b2ff (bug 1589493)
Backed out changeset 416b95911b6d (bug 1589493)
Backed out changeset 47e745b389d0 (bug 1589493)
2020-03-03 12:21:11 +02:00
David Teller 77c6a232c2 Bug 1589493 - Expose CrashReporterHost::isLikelyOOM();r=gsvelto
We'll use this method to expose additional information to the front-end for recovering from OOM.

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

--HG--
extra : moz-landing-system : lando
2020-03-03 08:34:24 +00:00
Oana Pop Rus 9f4dae4db5 Backed out 4 changesets (bug 1589493) for mochitest multiple failures in test_process_error_oom.xhtml on a CLOSED TREE
Backed out changeset 6ab5b9391f95 (bug 1589493)
Backed out changeset 4c3d736d0259 (bug 1589493)
Backed out changeset 8e5458038d38 (bug 1589493)
Backed out changeset 716e6cd5245f (bug 1589493)
2020-03-02 15:57:39 +02:00
David Teller a1a07fa35d Bug 1589493 - Expose CrashReporterHost::isLikelyOOM();r=gsvelto
We'll use this method to expose additional information to the front-end for recovering from OOM.

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

--HG--
extra : moz-landing-system : lando
2020-03-02 11:22:05 +00:00
Andrew McCreight 4babb2b5ab Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown
Patch by bhackett and jlaster. Also reviewed by mccr8.

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

--HG--
extra : moz-landing-system : lando
2020-02-27 17:39:15 +00:00
Daniel Varga 860a0279eb Backed out 4 changesets (bug 1589493) for causing mochitest failures at dom/ipc/tests/test_process_error.xhtml
CLOSED TREE

Backed out changeset 5b1b813bbdab (bug 1589493)
Backed out changeset aed44db455c4 (bug 1589493)
Backed out changeset 9f357dded30f (bug 1589493)
Backed out changeset 87c463f53ea9 (bug 1589493)

--HG--
extra : amend_source : 0b1fb8afac0d4cd7ee5680fb88fbd5ce5b99688f
2020-02-27 16:31:56 +02:00
David Teller 9a60cd3909 Bug 1589493 - Expose CrashReporterHost::isLikelyOOM();r=gsvelto
We'll use this method to expose additional information to the front-end for recovering from OOM.

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

--HG--
extra : moz-landing-system : lando
2020-02-27 11:05:07 +00:00
Daniel Varga 1e0ceaa672 Backed out 4 changesets (bug 1589493) for causing mochitest failure at dom/ipc/tests/test_process_error_oom.xhtml
CLOSED TREE

Backed out changeset 46183b72cf37 (bug 1589493)
Backed out changeset 3621ad792a38 (bug 1589493)
Backed out changeset 4c242e542545 (bug 1589493)
Backed out changeset f0ab64c7765b (bug 1589493)

--HG--
extra : rebase_source : 74643ea36f7fc0d90647bc79c939e36fdeb14839
2020-02-27 12:52:39 +02:00
David Teller da305dfc7d Bug 1589493 - Expose CrashReporterHost::isLikelyOOM();r=gsvelto
We'll use this method to expose additional information to the front-end for recovering from OOM.

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

--HG--
extra : moz-landing-system : lando
2020-02-26 16:16:10 +00:00
Ciure Andrei 00dd87f6f4 Backed out changeset d407a28318e6 (bug 1609815) for causing windows ming bustages CLOSED TREE
--HG--
extra : histedit_source : b2c748e31e0f6ba8fcf9960a336e0bbd361b07e6
2020-02-27 07:05:19 +02:00
Andrew McCreight b197e1f783 Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown
Patch by bhackett and jlaster. Also reviewed by mccr8.

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

--HG--
extra : moz-landing-system : lando
2020-02-27 04:43:48 +00:00
Coroiu Cristina 9d56d9389b Backed out 4 changesets (bug 1589493) for multiple failures and crashes on CrashReporterHost on a CLOSED TREE
Backed out changeset 59fc685edca2 (bug 1589493)
Backed out changeset 275b66a8c77a (bug 1589493)
Backed out changeset 23601d10e69d (bug 1589493)
Backed out changeset e8e7bc5c8a00 (bug 1589493)
2020-02-26 18:11:44 +02:00
David Teller c15218401c Bug 1589493 - Expose CrashReporterHost::isLikelyOOM();r=gsvelto
We'll use this method to expose additional information to the front-end for recovering from OOM.

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

--HG--
extra : moz-landing-system : lando
2020-02-25 18:16:33 +00:00
Noemi Erli b3a7ad66b1 Backed out 4 changesets (bug 1589493) for causing lint failure in test_process_error_oom.xhtml
Backed out changeset 9dbe0bdd321b (bug 1589493)
Backed out changeset 900ec6b447c9 (bug 1589493)
Backed out changeset 3f7c15d29416 (bug 1589493)
Backed out changeset c1bc7695e720 (bug 1589493)
2020-02-25 20:10:35 +02:00
David Teller 9d054bf057 Bug 1589493 - Expose CrashReporterHost::isLikelyOOM();r=gsvelto
We'll use this method to expose additional information to the front-end for recovering from OOM.

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

--HG--
extra : moz-landing-system : lando
2020-02-25 17:36:51 +00:00
Gabriele Svelto ca8ae39a56 Bug 1544147 - Ensure orphaned crashes are properly notified to the rest of the system r=froydnj
When a content or plug-in process crashes too early we haven't initialized the
CrashReporterHost for that process. This will cause the crash to be orphaned,
i.e. to miss most of its crash annotations. We added code to finalize those
crashes in bug 1282776 so that we wouldn't miss them entirely. This ensured
that crash reports would have both their .dmp and .extra files but the patch
failed to modify the code that notified various listeners about the crash
report's presence.

This changes always send the crash ID alongside the crash notifications, even
for orphaned crashes, so that listeners such as the content crash handler or
the test harnesses can always find the minidump and .extra file. Additionally
orphaned crashes are recorded in the CrashManager and in telemetry just like
normal crashes.

This also re-enables dom/ipc/tests/process_error.xul which failed frequently
because of this bug.

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

--HG--
extra : moz-landing-system : lando
2019-12-20 17:50:45 +00:00
Gabriele Svelto 69790bc62e Bug 1600545 - Remove useless inclusions of header files generated from IDL files in accessible/, browser/, caps/, chrome/, devtools/, docshell/, editor/, extensions/, gfx/, hal/, image/, intl/, ipc/, js/, layout/, and media/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

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

--HG--
extra : moz-landing-system : lando
2019-12-06 09:16:44 +00:00
Thinker Li 0fcab03d24 Bug 1470591 - Part 1: Add a new process type for ForkServer. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D46878

--HG--
extra : moz-landing-system : lando
2019-12-05 00:03:29 +00:00
Bogdan Tara 3732e1f17c Backed out 6 changesets (bug 1470591) for test_punycodeURIs & test_nsIProcess* crashes CLOSED TREE
Backed out changeset 3ca19f8f388e (bug 1470591)
Backed out changeset f80db6e63169 (bug 1470591)
Backed out changeset cbac2d7dfe42 (bug 1470591)
Backed out changeset daad4d736ec0 (bug 1470591)
Backed out changeset ca1b804d404a (bug 1470591)
Backed out changeset a10772f780f7 (bug 1470591)
2019-12-04 00:53:14 +02:00
Thinker Li 70ef2f4abf Bug 1470591 - Part 1: Add a new process type for ForkServer. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D46878

--HG--
extra : moz-landing-system : lando
2019-12-03 18:53:53 +00:00
Daniel Varga 00e1ca5f09 Backed out 4 changesets (bug 1589493) for linting failure at builds/worker/checkouts/gecko/dom/ipc/tests/test_process_error_oom.xhtml:12:11. On a CLOSED TREE
Backed out changeset fb609feb845a (bug 1589493)
Backed out changeset 0e09d02e484a (bug 1589493)
Backed out changeset 94aa25f22d44 (bug 1589493)
Backed out changeset 04adc4c18424 (bug 1589493)
2019-11-29 19:48:41 +02:00
David Teller 398ff1cb9b Bug 1589493 - Expose CrashReporterHost::isLikelyOOM();r=gsvelto
We'll use this method to expose additional information to the front-end for recovering from OOM.

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

--HG--
extra : moz-landing-system : lando
2019-11-29 14:42:55 +00:00
Coroiu Cristina 8aab818cb9 Backed out 4 changesets (bug 1589493) for chrome failures at dom/ipc/tests/test_process_error_oom.xu on a CLOSED TREE
Backed out changeset 9b97128e83d8 (bug 1589493)
Backed out changeset d2ed39839f83 (bug 1589493)
Backed out changeset cac468582924 (bug 1589493)
Backed out changeset 421b8d600806 (bug 1589493)
2019-11-28 18:01:54 +02:00
David Teller 55461f78a7 Bug 1589493 - Expose CrashReporterHost::isLikelyOOM();r=gsvelto
We'll use this method to expose additional information to the front-end for recovering from OOM.

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

--HG--
extra : moz-landing-system : lando
2019-11-28 14:12:23 +00:00
Gabriele Svelto beb62c4c31 Bug 1282776 - Finalize crash reports for child process crashes happening too early r=froydnj
This changes the way crash reports for child processes happening too early
during the child process' startup. Before bug 1547698 we wrote a partial
.extra file with those crashes that lacked the process type. The user would
not be notified of those crashes until she restarted Firefox and even when
submitted those crashes would be erroneously labeled as browser crashes.

After bug 1547698 we stopped writing .extra files entirely for those crashes
which left orphaned .dmp files among the pending crash reports.

This patch does three things to improve the situation:

* It writes a partial .extra file so that the crashes are detected at the next
  startup. So the user is still not notified directly of these crashes but she
  can report them later.
* It adds the process type to the .extra file so that the crash reporters are
  labelled correctly.
* It fixes a leak in the `pidToMinidump` hash-map. Since the crashes were
  not finalized the `ChildProcessData` strucutre associated with them would
  never be fred.

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

--HG--
extra : moz-landing-system : lando
2019-08-09 14:23:19 +00:00
Gabriele Svelto 76021a664b Bug 1555917 - Exception handler and crash reporter client cleanup r=froydnj
This patch includes multiple changes cleaning up various aspects of the crash
reporter client and exception handler:

* Some Unix-specific code was moved out from the base crashreporter client
  code and into the appropriate platform implementation
* Functions used to open files in the crashreporter client now accept C++
  `std::ios` flags instead of unreadable booleans
* Useless character conversion routines were removed from the
  minidump-analyzer
* Crash annotations are not serialized into a huge string anymore every time
  they change. They are all written out individually during an exception.
* `WriteEscapedMozCrashReason()` uses the exception-safe `my_strlen()` instead
  of plain `strlen()`
* The Windows-specific DLL-blocklist shutdown was removed from the Linux &
  macOS Breakpad callbacks
* The `CrashReporterHost`, `CrashReporterClient` and
  `CrashReporterMetadataShmem` classes now take `nsACString` references
  instead of `nsCString` ones since they never modify their contents

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

--HG--
extra : moz-landing-system : lando
2019-05-31 21:54:03 +00:00
Gabriele Svelto 9f9c7c8211 Bug 1547698 - Refactor the code that writes the .extra file for a content process crash or hang r=froydnj
Upon a content process crash or hang crash annotations were incrementally
written into the .extra file starting with the exception handler callback and
then in a number of different places before the file was ready for submission.
This had a number of downsides: since the annotations were directly added to
the file it was impossible to tell which ones were already written at a
certain point in time, additionally some were written twice or even thrice.
The code doing the writing would also behave differently depending on the
contents of the file, the parameters passed to it and the contents of global
variables.

This change overhauls the whole process by keeping the annotations into a
temporary per-crash annotation table which is filled with all the required
annotations before being written out in a single pass when they are ready.

The annotations are gathered from the main process annotation table, the
per-process one (held by the CrashReporterHost) and exception-time specific
ones.

The resulting annotations are slightly different than before the patch: first
of all there are no more duplicate entries in the .extra file and secondly all
content/plugin process hangs annotations are properly filtered, before
annotations that were main process-only would leak into them.

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

--HG--
extra : moz-landing-system : lando
2019-05-18 16:19:55 +00:00