Read-only Git mirror of the Mercurial gecko repositories at https://hg.mozilla.org. How to contribute: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
Перейти к файлу
Gabriele Svelto 06a240a0f3 Bug 1628399 - Make sure that the main process can't access a crash report before it's fully populated r=KrisWright
In bug 1614933 we changed the order in which the crash annotations are sent
from a crashed content process to the main process in order to prevent a
deadlock that would arise if the child process would block writing into the
pipe used to sent the annotations.

This unfortunately introduced a race that I had missed. Here's the sequence of
event when generating a crash in the child process:

1) The child process enters the exception handler
2) It requests a dump from the main process and wait
3) Once the dump is written, the child process wakes up again and writes out
   the crash annotations
4) The child process quits

One the main process side it looks like this:

1) The crash generation thread receives a request to generate a dump
2) The dump is written out, the crash generation thread notifies the content
   process that it can resume execution. During this step the finished
   minidump is recorded in the `OnChildProcessDumpRequested()` callback.
3) The crash generation thread reads the crash annotations sent by the content
   process and finalizes the crash report
4) The main process grabs the finalized crash report

The key issue here is that the main process in step 4 is woken up when the
content process dies. Notice how there's no synchronization between the crash
generation thread and the main thread in the main process: if the crash
generation thread takes too long reading the crash annotations the main thread
might see an incomplete or missing crash report; that's because the event that
wakes it up - the content process ending execution - can happen in parallel
with step 3.

This is an issue that was accidentally introduced in Windows by bug 1614933
but was already present in both Linux and macOS. It was just very unlikely to
happen.

This patch fixes the issue by splitting step 3 in the main process in two
different stages: in the main process we grab the generated minidump in
`OnChildProcessDumpRequested()`, Breakpad then unblocks the child process and
we read the annotations in `OnChildProcessDumpWritten()`. We grab the
`dumpMapLock` Mutex in the latter and release it in the former to ensure that
the main process will have to wait for the crash report to be finalized when
`TakeCrashedChildProcess()` is called. This might appear somewhat confusing
and even causes debug builds to spit a harmless warning (we don't want Mutexes
to be taken and released from different scopes if we can help it).

To implement the above behavior in Breakpad a new callback was introduced in
Windows, an existing one was used under macOS and an unused one was used under
Linux. This accounts for the different way in which minidumps are generated on
the three platforms.

Differential Revision: https://phabricator.services.mozilla.com/D74496
2020-05-18 20:34:48 +00:00
.cargo Bug 1636068 - Update spirv-cross to 0.20.0 r=groves 2020-05-16 02:27:33 +00:00
.vscode
accessible Bug 1638703 - Flush layout explicitly in some a11y non-e10s tests. r=Jamie 2020-05-17 22:08:47 +00:00
browser Bug 1636207 - Follow-up: remove unnecessary browser_all_files_referenced.js whitelist entry. r=test-only. 2020-05-18 16:38:21 -04:00
build Bug 1638576 - Correct spelling of "deprecated" (follow-up to bug 1611160). r=sylvestre 2020-05-17 20:20:38 +00:00
caps Bug 1633710 - Move js uri.hostPort to principal r=ckerschb 2020-05-18 13:50:14 +00:00
chrome Bug 1536556 - Replace raw thrown Cr.ERRORs with Components.Exception. r=mossop,remote-protocol-reviewers,marionette-reviewers,whimboo,necko-reviewers,geckoview-reviewers,valentin,agi 2020-05-05 17:41:36 +00:00
config Bug 1638870 - add unicode/uniset.h to system headers; r=firefox-build-system-reviewers,rstewart 2020-05-18 20:20:21 +00:00
devtools Bug 1636798 - Check tabs instead of source when displaying pretty print icon r=davidwalsh 2020-05-18 19:13:58 +00:00
docs Bug 1636887 - how_to_contribute_firefox.rst : adding precisions to the windows dependencies setup explanations. r=sylvestre 2020-05-13 16:50:07 +00:00
docshell Backed out 6 changesets (bug 1002724) for failing in browser_fall_back_to_https.js CLOSED TREE 2020-05-18 19:22:19 +03:00
dom Bug 1629604 - Fixed phrase not found in visible <script> and added a test for visible <script>. r=emilio 2020-05-18 21:28:46 +00:00
editor Bug 1637856 - part 2: Get rid of `WSRunScanner::mNodeArray` r=m_kato 2020-05-18 06:46:00 +00:00
extensions Bug 1629274 - Fix Intermittent failure in test_permmanager_removeall.js, r=timhuang 2020-05-11 08:34:04 +00:00
gfx Bug 1638413 - Allow WebRender compositor to be used without DirectComposition on non-Windows. r=jrmuizel 2020-05-18 17:46:05 +00:00
gradle/wrapper
hal Bug 1637452: Part 2 - Fix JNI includes in hal/android; r=geckoview-reviewers,agi 2020-05-15 17:04:12 +00:00
image Backed out 2 changesets (bug 651482) for causing bitmap reftest failures. 2020-05-18 10:31:53 +03:00
intl Bug 1637452: Part 16 - Fix JNI includes in intl; r=zbraniecki 2020-05-15 17:06:15 +00:00
ipc Bug 1622166 - Change variadic functions from the old recursive way using Fold expressions r=gerald,jld 2020-05-14 16:31:17 +00:00
js Backed out 3 changesets (bug 1638460) for sm bustages at WarpCacheIRTranspiler.cpp. CLOSED TREE 2020-05-18 23:42:51 +03:00
layout Bug 1638020 - Avoid checking display port twice while computing RDL rebuild region r=tnikkel 2020-05-18 13:22:29 +00:00
media Bug 1637452: Part 13 - Fix JNI includes in media/webrtc; r=bwc 2020-05-15 17:05:28 +00:00
memory Bug 1553717 - Use Randomization on all arenas in non-Content Processes. r=glandium 2020-05-13 08:31:04 +00:00
mfbt Bug 1637599 - Rephrase documentation referring to copies of errors. r=froydnj 2020-05-13 15:44:31 +00:00
mobile Bug 1622500 - Implement cookieStoreId parameter for tabs.create. r=geckoview-reviewers,agi 2020-05-15 22:17:59 +00:00
modules Backed out 6 changesets (bug 1002724) for failing in browser_fall_back_to_https.js CLOSED TREE 2020-05-18 19:22:19 +03:00
mozglue Bug 1576728 - Block more versions of oly[64].dll and pdzipmenu[32|64].dll. r=gcp 2020-05-18 11:53:09 +00:00
netwerk Bug 1539819 - P5: Extract the logic of processing TRRService URI r=valentin 2020-05-18 20:18:15 +00:00
nsprpub
other-licenses Bug 1634535 - Move ply to third_party/python r=glandium 2020-05-05 16:02:02 +00:00
parser Bug 1620966 - Move DocShell.watchedByDevtools to BrowsingContext and rename it to watchedByDevTools. r=nika,jdescottes 2020-05-12 09:18:26 +00:00
python Bug 1638783 - Install Mercurial with pip3 rather than pip, which no longer exists on new Ubuntu/Debian versions r=froydnj 2020-05-18 20:10:19 +00:00
remote Bug 1599773 - [remote] Implement Page.frameDetached. r=remote-protocol-reviewers,maja_zf 2020-05-18 18:34:49 +00:00
security No Bug, mozilla-central repo-update HSTS HPKP - a=repo-update r=RyanVM 2020-05-18 14:04:41 +00:00
services Bug 1633641 - Provide a method to fetch an OAuth token and its key in a single operation. r=rfkelly 2020-05-18 01:13:46 +00:00
servo Bug 1636998 - Make ::-moz-focus-outer a no-op, and remove it on Nightly. r=jwatt 2020-05-18 10:54:16 +00:00
startupcache Bug 1614795 - use the background task queue for startupcache writes, r=dthayer,decoder 2020-04-15 20:43:44 +00:00
storage Bug 1626570 - Remove obsolete copy enabling machinery. r=froydnj 2020-05-11 08:23:03 +00:00
taskcluster Backed out 13 changesets (bug 1636637, bug 1623355, bug 1636635, bug 1617481) buid signing failures. CLOSED TREE 2020-05-18 21:37:31 +03:00
testing Backed out changeset e867d81f9019 (bug 1637953) for wrench bustages. CLOSED TREE 2020-05-19 00:26:26 +03:00
third_party Bug 1636068 - Update spirv-cross to 0.20.0 r=groves 2020-05-16 02:27:33 +00:00
toolkit Bug 1628399 - Make sure that the main process can't access a crash report before it's fully populated r=KrisWright 2020-05-18 20:34:48 +00:00
tools Bug 1612557 - part4 : use `Media` category for markers r=bryce,gerald,canaltinova 2020-05-16 19:58:25 +00:00
uriloader Bug 1618548 - Make `Link: rel=preload` response header work with preload-as-speculative-load, r=dragana 2020-05-18 17:33:57 +00:00
view Bug 1623992 - Automated rewrite from chrome://global/skin/ to chrome://global/skin/global.css in markup r=marionette-reviewers,perftest-reviewers,mossop,whimboo,sparky 2020-04-03 22:23:23 +00:00
widget Bug 1638905 - Enable WebRender on gen6 gt2 on Nightly. r=aosmond 2020-05-18 17:44:22 +00:00
xpcom Bug 1539819 - P3: Some adjustments to make TRRServiceChannel work on socket process r=dragana,necko-reviewers 2020-05-18 20:18:08 +00:00
xpfe/appshell Bug 1276537 part 2 - Remove nsIWidget::SetShowsFullScreenButton. r=spohl 2020-05-15 06:19:14 +00:00
.arcconfig
.babel-eslint.rc.js Bug 1622328 - add license info to all eslintrc files r=Standard8,webcompat-reviewers,miketaylr 2020-03-19 13:47:51 +00:00
.clang-format
.clang-format-ignore Bug 1635608 - Update OpenVR source code to use Unix line endings r=daoshengmu 2020-05-07 20:20:39 +00:00
.cron.yml Bug 1637231 - add applink tests r=acreskey 2020-05-14 13:01:59 +00:00
.eslintignore Bug 1628982 - Activate the condprofile on desktop + GV r=Bebe,perftest-reviewers,whimboo 2020-04-16 14:01:55 +00:00
.eslintrc.js Bug 1623245 - A new browser.storage.sync local storage implementation, pref'd off. r=rpl 2020-05-15 01:29:56 +00:00
.flake8 Bug 1622687 - toolkit/crashreporter/: Make it flake8 compliant r=gsvelto,rstewart 2020-04-16 14:40:31 +00:00
.gdbinit Bug 1627398 Part 5 - Support dumping frame trees in CSS pixels for gdb and lldb. r=heycam 2020-04-07 23:42:38 +00:00
.gdbinit_python
.git-blame-ignore-revs Bug 1633969 - Refresh .git-blame-ignore-revs. r=sylvestre 2020-04-30 16:38:19 +00:00
.gitattributes
.gitignore Bug 1635514 - Delete tup CI/configure stuff r=froydnj 2020-05-05 18:34:16 +00:00
.hg-annotate-ignore-revs Bug 1633969 - Add a changeset marked as "skip-blame" to .hg-annotate-ignore-revs. r=sylvestre 2020-04-30 16:37:44 +00:00
.hg-format-source
.hgignore Bug 1635514 - Delete tup CI/configure stuff r=froydnj 2020-05-05 18:34:16 +00:00
.hgtags No bug - tagging 5b8406a0446906d7228e5d745549b50a3496dc0f with FIREFOX_NIGHTLY_77_END a=release DONTBUILD CLOSED TREE 2020-05-04 14:53:30 +00:00
.lldbinit
.mailmap
.prettierignore
.prettierrc Bug 1620218 - Update Prettier to 1.18.2 and other ESLint modules to the latest versions. r=mossop 2020-03-08 21:45:23 +00:00
.taskcluster.yml Bug 1628832: [KaiOS] Factor out trust-domain in `.taskcluster.yml`; r=Callek 2020-05-14 18:47:47 +00:00
.trackerignore
.yamllint
.ycm_extra_conf.py Bug 1632497 - Make YouCompleteMe clangd completer work. r=jgraham 2020-04-28 10:08:00 +00:00
AUTHORS
CLOBBER Bug 1632434 - Part 7: Updating ICU requires a clobber. r=jwalden 2020-04-29 23:48:06 +00:00
Cargo.lock Bug 1638676 - Update Cargo.lock. r=eoger 2020-05-17 17:15:35 +00:00
Cargo.toml Bug 1636068 - Update spirv-cross to 0.20.0 r=groves 2020-05-16 02:27:33 +00:00
GNUmakefile
LEGAL
LICENSE
Makefile.in Bug 1599658 - Delete previous definition of py_action in Makefiles. Now py_action calls into Python 3 and py3_action doesn't exist. r=glandium 2020-05-05 20:04:30 +00:00
README.txt Bug 1617846 - Replace IRC with matrix.r=firefox-source-docs-reviewers,sylvestre 2020-02-25 11:39:53 +00:00
aclocal.m4 Bug 1638193 - Remove build system support for iOS. r=nalexander 2020-05-15 03:56:16 +00:00
build.gradle Bug 1633039 - Don't check for Python 2 in configure r=glandium 2020-05-05 16:02:02 +00:00
client.mk Bug 1633016 - Remove a bunch of references to PYTHON(2) in Makefiles r=glandium 2020-05-05 19:53:22 +00:00
client.py
configure.in Bug 1627163 - Switch python configure to python 3. r=firefox-build-system-reviewers,rstewart 2020-04-07 18:31:56 +00:00
configure.py Bug 1631633 - Generate config.status deterministically. r=rstewart 2020-04-21 21:32:30 +00:00
gradle.properties
gradlew
gradlew.bat
mach Bug 1579329 - Run `mach file-info` with Python 3 r=nalexander 2020-05-14 18:20:22 +00:00
moz.build Bug 1621095 - add reftest-qr to run focused webrender reftests on android phones. r=bc 2020-04-24 18:54:51 +00:00
moz.configure Bug 1635514 - Delete tup CI/configure stuff r=froydnj 2020-05-05 18:34:16 +00:00
mozilla-config.h.in
old-configure.in Bug 1638193 - Remove build system support for iOS. r=nalexander 2020-05-15 03:56:16 +00:00
package-lock.json Bug 1622717: When parsing an AST allow the chosen parser to override the default scope manager and visitor keys. r=Standard8 2020-03-23 12:58:28 +00:00
package.json Bug 1622717: When parsing an AST allow the chosen parser to override the default scope manager and visitor keys. r=Standard8 2020-03-23 12:58:28 +00:00
settings.gradle
substitute-local-geckoview.gradle
test.mozbuild

README.txt

An explanation of the Mozilla Source Code Directory Structure and links to
project pages with documentation can be found at:

    https://firefox-source-docs.mozilla.org/contributing/directory_structure.html

For information on how to build Mozilla from the source code and create the patch see:

    https://firefox-source-docs.mozilla.org/contributing/how_to_contribute_firefox.html

If you have a question about developing Mozilla, and can't find the solution
on https://developer.mozilla.org, you can try asking your question on Matrix at chat.mozilla.org in `Introduction` (https://chat.mozilla.org/#/room/#introduction:mozilla.org) channel.


Nightly development builds can be downloaded from:

    https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/
            - or -
    https://www.mozilla.org/firefox/channel/desktop/#nightly

Keep in mind that nightly builds, which are used by Mozilla developers for
testing, may be buggy.