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

497 Коммитов

Автор SHA1 Сообщение Дата
Butkovits Atila 8b7a0827b5 Backed out 7 changesets (bug 1696531) for causing mochitest failures complaining about arguments.
Backed out changeset 52ba6bf74b55 (bug 1696531)
Backed out changeset c907d8324bcc (bug 1696531)
Backed out changeset 1f7ffffa368f (bug 1696531)
Backed out changeset 5002c2053444 (bug 1696531)
Backed out changeset 0b8c56f2f5c3 (bug 1696531)
Backed out changeset a8d8adae39b6 (bug 1696531)
Backed out changeset a7f9bd32a4c9 (bug 1696531)
2021-04-12 20:48:48 +03:00
Ben Hearsum df62fb3800 Bug 1696531: fix dmd.py and related tools to support python 3 r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D109731
2021-04-12 16:31:21 +00:00
Brindusan Cristian 2586a80626 Backed out changeset d47a138a3b50 (bug 1668903) for causing xpcshell failures. CLOSED TREE 2021-03-24 23:22:21 +02:00
Emilio Cobos Álvarez 9d7bb1aa62 Bug 1668903 - Port dmd.py to python3. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D98927
2021-03-24 20:45:56 +00:00
Mike Hommey 4e512a5e67 Bug 1699321 - Avoid DMD crashes on Windows debug builds. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D109425
2021-03-22 22:50:25 +00:00
Mike Hommey 4d8e18962b Bug 1699375 - Move WalkTheStack to mozglue. r=nika
A long standing issue is that MOZ_ASSERT and related don't print stack
traces in debug builds when they're directly or indirectly emitted from
non-libxul code. Moving WalkTheStack to mozglue alleviates the problem.

It's also not printing stack traces when emitted from C code (and for
some C third party libraries, we do redirect assert to MOZ_ASSERT),
which we solve by making the corresponding API available without C++
(which WalkTheStack being a static method of the nsTraceRefCnt class
didn't allow, or the use of a closure on Android).

This requires some adjustements to headers that indirectly assume that
Assertions.h includes ErrorList.h through nsError.h through nscore.h
through nsTraceRefcnt.h.

We also remove TestStackCrawl.cpp because it hasn't been built since
bug 158528, 19 years ago.

Differential Revision: https://phabricator.services.mozilla.com/D108913
2021-03-22 21:25:30 +00:00
Mike Hommey ec7f538e0c Bug 1698719 - Remove aSkipFrames argument to both FramePointerStackWalk and MozStackWalkThread. r=gsvelto,gerald
In the case of FramePointerStackwalk, the caller gives a pointer to the
top-most frame to walk from. There isn't really a reason to give a
number of frames to skip, as the right frame pointer could be given in
the first place if that was really necessary. And in practice, it's
hasn't been used so far.

In the case of MozStackWalkThread, the caller presumably doesn't know
what the thread the stack is being walked for is doing, and it would be
a guesswork to pass a valid number of frames to skip. In practice, it's
also not used.

The aSkipFrames is already a footgun on MozStackWalk (and we're going to
change that in bug 1515229), we don't need to keep a footgun on these
other stack walking methods.

Differential Revision: https://phabricator.services.mozilla.com/D108563
2021-03-17 00:21:39 +00:00
Mike Hommey 9c0fcac97c Bug 1690167 - Change VsprintfLiteral/SprintfLiteral to rely on PrintfTarget. r=nika,Gankra,firefox-build-system-reviewers,mhentges
Instead of snprintf.

Because some standalone code uses those functions directly or indirectly,
and PrintfTarget lives in mozglue, they now need to depend on mozglue
instead of mfbt. Except logalloc/replay, which cherry-picks what it
uses, and the updater, for which we keep using vsnprintf.

Differential Revision: https://phabricator.services.mozilla.com/D103730
2021-03-10 23:52:40 +00:00
Marco Castelluccio 50efad8d07 Bug 1695331 - Disable memory/replace/logalloc/replay in ccov fuzzing builds. r=calixte DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D106777
2021-03-01 15:41:15 +00:00
Marco Castelluccio ca6a10dd3e Bug 1693786 - Run memory/replace/logalloc/replay on ccov builds since it no longer fails. r=glandium DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D105748
2021-02-26 08:18:24 +00:00
Andreea Pavel 64289058b6 Backed out 5 changesets (bug 1690167) for failing xpcshell at bootstrapSvc.js on a CLOSED TREE
Backed out changeset d28c0f11743f (bug 1690167)
Backed out changeset 3b2bebed9128 (bug 1690167)
Backed out changeset 7e925e90a251 (bug 1690167)
Backed out changeset f85934a2b7ad (bug 1690167)
Backed out changeset 6d83474e81bb (bug 1690167)
2021-02-17 07:10:58 +02:00
Mike Hommey 622b111f9e Bug 1690167 - Change VsprintfLiteral/SprintfLiteral to rely on PrintfTarget. r=nika,Gankra,firefox-build-system-reviewers,mhentges
Instead of snprintf.

Because some standalone code uses those functions directly or indirectly,
and PrintfTarget lives in mozglue, they now need to depend on mozglue
instead of mfbt. Except logalloc/replay, which cherry-picks what it
uses.

Differential Revision: https://phabricator.services.mozilla.com/D103730
2021-02-16 21:20:04 +00:00
Mihai Alexandru Michis 9154148880 Backed out 4 changesets (bug 1690167) for causing cppunit failures in TestIntegerPrintfMacros.
CLOSED TREE

Backed out changeset 27dee66eba83 (bug 1690167)
Backed out changeset cfffb092a39f (bug 1690167)
Backed out changeset 87b2a2a66fd9 (bug 1690167)
Backed out changeset cac4879f50b4 (bug 1690167)
2021-02-13 00:07:00 +02:00
Mike Hommey 47675f5460 Bug 1690167 - Change VsprintfLiteral/SprintfLiteral to rely on PrintfTarget. r=nika,Gankra,firefox-build-system-reviewers,mhentges
Instead of snprintf.

Because some standalone code uses those functions directly or indirectly,
and PrintfTarget lives in mozglue, they now need to depend on mozglue
instead of mfbt. Except logalloc/replay, which cherry-picks what it
uses.

Differential Revision: https://phabricator.services.mozilla.com/D103730
2021-02-12 20:21:50 +00:00
David Major dc2575e011 Bug 1677726 - Disable LTO for SmokeDMD.cpp r=andi
Sheriff note: We should keep this regardless of whether bug 1675600 sticks.

The comment above SmokeDMD's `RunTests()` says "This test relies on the compiler not doing various optimizations ... So we compile it with -O0 (or equivalent)".

That suggests that LTO should also be disallowed.

Differential Revision: https://phabricator.services.mozilla.com/D97336
2020-11-18 16:08:31 +00:00
David Major 6e260b8d5a Bug 1677893 - CONFIG["CXX_TYPE"] is not a thing r=firefox-build-system-reviewers,andi,mhentges
Due to lack of `CXX_TYPE`, clang-cl builds were accidentally taking the `else` branch where the `-O0` was ignored/unrecognized. This went unnoticed for a long time until it busted the landing of bug 1677726.

While here, fix the intent of SmokeDMD: `-Og-` is a silent no-op in clang-cl, so it's not actually disabling anything.

Differential Revision: https://phabricator.services.mozilla.com/D97387
2020-11-18 16:01:23 +00:00
Bogdan Tara 5a09a3c8ce Backed out changeset 1305b74f1c0b (bug 1677726) for SmokeDMD.obj related bustage CLOSED TREE
DONTBUILD
2020-11-18 02:49:01 +02:00
David Major e631afd3ae Bug 1677726 - Disable LTO for SmokeDMD.cpp r=andi
Sheriff note: We should keep this regardless of whether bug 1675600 sticks.

The comment above SmokeDMD's `RunTests()` says "This test relies on the compiler not doing various optimizations ... So we compile it with -O0 (or equivalent)".

That suggests that LTO should also be disallowed.

Differential Revision: https://phabricator.services.mozilla.com/D97336
2020-11-17 16:56:18 +00:00
Sylvestre Ledru 9bfd4073b2 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D95434
2020-11-04 18:46:00 +00:00
Ricky Stewart 02a7b4ebdf Bug 1654103: Standardize on Black for Python code in `mozilla-central`.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Bogdan Tara da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart c0cea3b0fa Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Mike Hommey 6d9ed07aa6 Bug 1672867 - Silence warning about aligned_alloc only being available on macOS 10.15 or newer. r=firefox-build-system-reviewers,mhentges
This warning turns into an error on automation, and is only due to the
fact that newer SDKs have a declaration for it with a version guard, but
we're actually using our own definition of the function, so whether it's
available in older versions of macOS is irrelevant.

Differential Revision: https://phabricator.services.mozilla.com/D94512
2020-10-22 23:16:23 +00:00
Dorel Luca 1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart 50762dacab Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
Petr Sumbera fd342d7126 Bug 1671623 - don't overloaded log10 r=pbone
Differential Revision: https://phabricator.services.mozilla.com/D93762
2020-10-19 06:42:45 +00:00
Paul Bone e09c34ec99 Bug 1656155 - pt 7. Add slop histograms r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D88705
2020-10-08 22:35:59 +00:00
Paul Bone de7f32735e Bug 1656155 - pt 6. Add slop information to Replay.cpp r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D88403
2020-10-08 22:44:38 +00:00
Paul Bone 6655819c99 Bug 1656155 - pt 5. Add bin-stats to the memory replay tool r=glandium
Add more format specifiers to FdPrintf: %, s and add width and precision
specifiers.

Differential Revision: https://phabricator.services.mozilla.com/D87829
2020-10-08 22:44:00 +00:00
Paul Bone 46597c49d2 Bug 1656155 - pt 2. Provide bin usage stats in jemalloc_stats r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D85726
2020-10-08 22:42:45 +00:00
Gerald Squelart 782cf5d3ad Bug 1657033 - Use Span<const char> in JSONWriter - r=froydnj
In most situations, JSONWriter users already know string lengths (either directly, or through `nsCString` and friends), so we should keep this information through JSONWriter and not recompute it again.
This also allows using JSONWriter with sub-strings (e.g., from a bigger buffer), without having to create null-terminated strings.

Public JSONWriter functions have overloads that accept literal strings.

Differential Revision: https://phabricator.services.mozilla.com/D86192
2020-09-14 02:33:20 +00:00
Sylvestre Ledru 9c192aa9ca Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88713
2020-08-31 09:23:02 +00:00
Mihai Alexandru Michis 261d01524b Backed out changeset d0f173a90792 (bug 1519636) for causing bustages.
CLOSED TREE
2020-08-31 10:14:58 +03:00
Sylvestre Ledru 939dd426e6 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88713
2020-08-31 06:51:21 +00:00
Paul Bone d4a42076ec Bug 1661884 - Update link to DMD docs r=njn
Differential Revision: https://phabricator.services.mozilla.com/D88706
2020-08-31 01:23:59 +00:00
Nathan Froyd 92a3a92555 Bug 1658424 - add support for grabbing fp on arm64 macOS in DMD; r=mccr8
This code just cribs from the profiler's code and has not been tested.

Differential Revision: https://phabricator.services.mozilla.com/D86647
2020-08-11 14:09:28 +00:00
Mike Hommey 748bff0a39 Bug 1658434 - Replace replace_malloc.mk with a mozbuild file. r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D86639
2020-08-11 00:05:38 +00:00
Mike Hommey 69fef46cab Bug 1651079 - Add necessary LOCAL_INCLUDES for StackWalk.cpp in memory/replace/logalloc/replay. r=rstewart
This requires a workaround for the use of __wrap_dladdr, which can't be
used in logalloc-replay. The workaround involves making __wrap_dladdr
expand to dladdr, but that makes the definition ElfLinker.h conflict
with the one in the Android system headers, so we change it to match,
and adjust ElfLinker.cpp accordingly.

And while here, fix the condition in mozglue/misc to match the condition
around including Linker.h in StackWalk.cpp itself.

Differential Revision: https://phabricator.services.mozilla.com/D82648
2020-07-08 21:37:24 +00:00
Sylvestre Ledru 68e6f06c65 Bug 1649071 - Replace the DISALLOW_COPY_AND_ASSIGN & DISALLOW_EVIL_CONSTRUCTORS macros with = delete; r=froydnj
Generated with:
./mach static-analysis check --checks="-*, modernize-replace-disallow-copy-and-assign-macro" --fix -j 10 <file>
and
./mach clang-format -p <file>
(as clang-apply-replacement doesn't reformat the change)

(with ~/.mozbuild/clang-tools/clang-tidy/bin/clang-tidy pointing to clang-tidy 11)

Differential Revision: https://phabricator.services.mozilla.com/D81489
2020-06-29 14:37:56 +00:00
Chris Fronk af8a02cc9d Bug 1512991 - Add JsonWriteFunc::Write to take string length. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D72560
2020-05-08 16:24:31 +00:00
Ricky Stewart fd72a5d35e Bug 1633016 - Remove a bunch of references to PYTHON(2) in Makefiles r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D72479
2020-05-05 19:53:22 +00:00
Bogdan Tara f137fa0613 Backed out 6 changesets (bug 1632916, bug 1599658, bug 1633037, bug 1633039, bug 1633016, bug 1632920) for SA bustages CLOSED TREE
Backed out changeset 332ce0963b4e (bug 1633039)
Backed out changeset a9904cbc40d9 (bug 1633037)
Backed out changeset d06b0ec349f8 (bug 1599658)
Backed out changeset 8fd300cad80f (bug 1633016)
Backed out changeset f8820941c703 (bug 1632916)
Backed out changeset ac9c2c8746ed (bug 1632920)
2020-05-02 01:49:29 +03:00
Ricky Stewart bb4e86d85a Bug 1633016 - Remove a bunch of references to PYTHON(2) in Makefiles r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D72479
2020-04-30 15:25:22 +00:00
Cosmin Sabou 53c2d5ebb9 Backed out 2 changesets (bug 1628527) for causing wpt failures and a spike in bug 1622119. CLOSED TREE
Backed out changeset d9dfb6439761 (bug 1628527)
Backed out changeset 8235287622a8 (bug 1628527)
2020-04-21 23:12:09 +03:00
Nicholas Nethercote 88cd51aa6d Bug 1628527 - Introduce explicit initialization and finalization of `fix-stacks`. r=erahm,perftest-reviewers,sparky,gbrown
Currently AWSY-with-DMD doesn't work on Windows. This is because `fix-stacks`
is initialized lazily, and by the time the initialization happens some file
descriptors for files are open, and that leads to some major Python2-on-Windows
sadness as described in the big comment in the commit.

To fix the problem, this commit adds an `init` function to `fix_stacks.py` so
that `fix-stacks` can be initialized eagerly, hopefully before any file
descriptors for files are open.

For `dmd.py`, other than fixing the AWSY problems, this has little effect,
because `fix-stacks` is always initialized.

For `utils.py`, which is used to process the output of most tests, this has a
more noticeable effect: the `fix-stacks` process is always spawned, rather than
being spawned only when needed. If no stack traces appear in the test output,
this means that `fix-stacks` is spawned unnecessarily. But it's cheap to spawn;
the expensive part only happens when stack traces start getting fixed. So I
think this change in behaviour is acceptable.

Furthermore, the commit adds a `finish` function to `fix_stacks.py`, so that
the `fix-stacks` process can be explicitly shut down. This has never been done
for processes spawned for any of the stack fixing scripts. It's never caused
problems on Linux/Mac, but it seems to be necessary on Windows to avoid
similar "this file is locked" problems with the test_dmd.js test.

The commit also renames some things to more standard Python style, e.g.
`json_mode` instead of `jsonMode`.

Finally, Android tests use `utils.py` from the repository but `fix_stacks.py`
from the Android host utils. Because the two scripts must be updated in tandem,
this commit also updates the Android host utils to a version that contains the
updated `fix_stacks.py`. Thanks to aerickson for packaging up the new Android
host utils and providing the change to the `hostutils.manifest` file.

Differential Revision: https://phabricator.services.mozilla.com/D69478
2020-04-20 22:43:25 +00:00
pbz e118843a3a Bug 1615588 - Updated prompt tests. r=marionette-reviewers,johannh,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D66450
2020-04-16 14:44:56 +00:00
Nicholas Nethercote 8139b4051e Bug 1619840 - Remove `fix_{linux,macosx}_stack.py` and `fix_stack_using_bpsyms.py`. r=erahm
This commit removes `test_fix_stack_using_bpsyms.py`. That test can't easily be
modified to work with `fix_stacks.py` because it relies on internal
implementation details of `fix_stack_using_bpsym.py`. The unit testing done in
the `fix-stacks` repo provides test coverage that is as good or better.

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

--HG--
extra : moz-landing-system : lando
2020-04-08 06:55:54 +00:00
Csoregi Natalia 954b969608 Backed out 5 changesets (bug 1615588) for browser-chrome failures e.g. browser_beforeunload_duplicate_dialogs.js. CLOSED TREE
Backed out changeset 751cca7566a8 (bug 1615588)
Backed out changeset 474aca043834 (bug 1615588)
Backed out changeset 7839b95ef76c (bug 1615588)
Backed out changeset 32bb87f48b13 (bug 1615588)
Backed out changeset 264e642042b1 (bug 1615588)

--HG--
extra : rebase_source : 41ed149c97382bc1cf823abc56811b382cae0207
2020-04-10 21:19:15 +03:00
pbz b296ec16c4 Bug 1615588 - Updated prompt tests. r=marionette-reviewers,johannh,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D66450

--HG--
extra : moz-landing-system : lando
2020-04-10 16:45:36 +00:00
Bogdan Tara 7d56f86092 Backed out changeset 916894e8b8fc (bug 1626272) for frequent test_dmd.js failures CLOSED TREE 2020-04-07 03:52:49 +03:00
Nicholas Nethercote ba62a51069 Bug 1626272 - Make `fix-stacks` initialization eager. r=erahm
Currently AWSY-with-DMD doesn't work on Windows. This is because `fix-stacks`
is initialized lazily, and by the time the initialization happens some file
descriptors for files are open, and that leads to some major Python2-on-Windows
sadness as described in the big comment in the commit.

To fix the problem, this commit adds an `init` function to `fix_stacks.py` so
that `fix-stacks` can be initialized eagerly, hopefully before any file
descriptors for files are open.

For `dmd.py`, other than fixing the AWSY problems, this has little effect,
because `fix-stacks` is always initialized.

For `utils.py`, which is used to process the output of most tests, this has a
more noticeable effect: the `fix-stacks` process is always spawned, rather than
being spawned only when needed. If no stack traces appear in the test output,
this means that `fix-stacks` is spawned unnecessarily. But it's cheap to spawn;
the expensive part only happens when stack traces start getting fixed. So I
think this change in behaviour is acceptable.

The commit also renames some things to more standard Python style, e.g.
`json_mode` instead of `jsonMode`.

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

--HG--
extra : moz-landing-system : lando
2020-04-06 19:49:54 +00:00
Sylvestre Ledru 0aa6f03cf3 Bug 1519636 - Reformat recent changes to the Google coding style r=jgilbert
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2020-04-05 13:34:58 +00:00
Nicholas Nethercote 522595339d Bug 1626272 - Reduce indentation in fixStackTraces. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D69477

--HG--
extra : moz-landing-system : lando
2020-04-03 20:59:01 +00:00
Nicholas Nethercote 0d565690c2 Bug 1574390 - Implement guard pages in PHC. r=glandium
Each allocation page is now bracketed by a guard page, and allocations are put
at the end of their page so that bounds violations trigger a crash.

Various operations (realloc(), free(), malloc_usable_size()) now require that
the pointer they are given points to the start of an allocation.

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

--HG--
rename : toolkit/crashreporter/test/unit_ipc/test_content_phc2.js => toolkit/crashreporter/test/unit_ipc/test_content_phc3.js
extra : moz-landing-system : lando
2020-03-27 00:14:53 +00:00
Nicholas Nethercote cd87fd19f8 Bug 1574390 - Change terminology from "pages" to "alloc pages". r=glandium
This is in preparation for the introduction of "guard pages", which are
interleaved with alloc pages. The specific renamings are:

- kMaxPageAllocs --> kNumAllocPages
- PagePtr --> AllocPagePtr
- PageState --> AllocPageState
- PageInfo --> AllocPageInfo
- mPages --> mAllocPages
- AssertPageInUse --> AssertAllocPageInUse

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

--HG--
extra : moz-landing-system : lando
2020-03-25 23:48:39 +00:00
Sylvestre Ledru 734f79b541 Bug 1624237 - Run misc-unused-using-decls - Remove useless declarations r=andi
$ ./mach static-analysis check --checks="-*, misc-unused-using-decls" --fix <path>

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

--HG--
extra : moz-landing-system : lando
2020-03-23 13:15:33 +00:00
Andrew McCreight 17d03423b0 Bug 1623508 - Print out original argument on error in block_analyzer. r=njn
If we don't find the block, just print out the original argument,
instead of the version converted to an integer. Python gets mad when
you try to concatenate an int and a string.

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

--HG--
extra : moz-landing-system : lando
2020-03-19 00:21:34 +00:00
Nicholas Nethercote 9a11249061 Bug 1621468 - Stop using `fix_stack_using_bpsyms.py` in `dmd.py`. r=gsvelto
This uses `fix-stacks`'s new Breakpad symbols support from
https://github.com/mozilla/fix-stacks/pull/16.

The patch also updates some comments in `dmd.py` to account for some very
slight changes in `fix-stacks`'s output.

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

--HG--
extra : moz-landing-system : lando
2020-03-16 01:15:27 +00:00
Mark Banner 15cfe23b88 Bug 1620542 - Automatically fix ESLint errors in .eslintrc.js files. r=mossop
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2020-03-07 10:09:44 +00:00
Nicholas Nethercote e275a8b6cb Bug 1620151 - Improve the imprecise stack matching used for `test_dmd.js`. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D65454

--HG--
extra : moz-landing-system : lando
2020-03-05 21:40:52 +00:00
Nicholas Nethercote c22c891c55 Bug 1604095 - Add `fix_stacks.py`, which uses `fix-stacks`, and use it in DMD. r=gsvelto
On Linux and Mac, this makes `dmd.py` *much* faster when it is first run on a
DMD data file.

On Windows, this makes DMD actually usable locally. Previously the stacks
weren't fixed and so were rubbish.

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

--HG--
extra : moz-landing-system : lando
2020-03-05 00:24:23 +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
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
Masatoshi Kimura 11a443c5ea Bug 1615896 - Stop using CreateFileA in memory/replace/logalloc/. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D63023

--HG--
extra : moz-landing-system : lando
2020-02-20 08:05:25 +00:00
Nicholas Nethercote 7e767dd845 Bug 1614875 - Tweak constants to prevent saturation and improve the hit rate. r=glandium
With the old constants the page alloc slots would fill up quickly and the hit
rate would quickly drop below 20%.

With the new constants the alloc slots don't fill up so quickly and the hit
rate remains at or near 100% for a lot longer. Also, page allocs are recycled
more slowly, which should increase the likelihood of UAFs being detected
correctly.

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

--HG--
extra : moz-landing-system : lando
2020-02-13 08:37:42 +00:00
Nicholas Nethercote 04df451726 Bug 1614875 - Gather more stats in PHC. r=glandium
Specifically, the number of page allocs in use, and the page alloc hit rate.

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

--HG--
extra : moz-landing-system : lando
2020-02-13 08:37:40 +00:00
Emilio Cobos Álvarez 256c124f94 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
This was done by:

This was done by applying:

```
diff --git a/python/mozbuild/mozbuild/code-analysis/mach_commands.py b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
index 789affde7bbf..fe33c4c7d4d1 100644
--- a/python/mozbuild/mozbuild/code-analysis/mach_commands.py
+++ b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
@@ -2007,7 +2007,7 @@ class StaticAnalysis(MachCommandBase):
         from subprocess import Popen, PIPE, check_output, CalledProcessError

         diff_process = Popen(self._get_clang_format_diff_command(commit), stdout=PIPE)
-        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format]
+        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format, '-sort-includes']

         if not output_file:
             args.append("-i")
```

Then running `./mach clang-format -c <commit-hash>`

Then undoing that patch.

Then running check_spidermonkey_style.py --fixup

Then running `./mach clang-format`

I had to fix four things:

 * I needed to move <utility> back down in GuardObjects.h because I was hitting
   obscure problems with our system include wrappers like this:

0:03.94 /usr/include/stdlib.h:550:14: error: exception specification in declaration does not match previous declaration
0:03.94 extern void *realloc (void *__ptr, size_t __size)
0:03.94              ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/malloc_decls.h:53:1: note: previous declaration is here
0:03.94 MALLOC_DECL(realloc, void*, void*, size_t)
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozilla/mozalloc.h:22:32: note: expanded from macro 'MALLOC_DECL'
0:03.94     MOZ_MEMORY_API return_type name##_impl(__VA_ARGS__);
0:03.94                                ^
0:03.94 <scratch space>:178:1: note: expanded from here
0:03.94 realloc_impl
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozmemory_wrap.h:142:41: note: expanded from macro 'realloc_impl'
0:03.94 #define realloc_impl mozmem_malloc_impl(realloc)

   Which I really didn't feel like digging into.

 * I had to restore the order of TrustOverrideUtils.h and related files in nss
   because the .inc files depend on TrustOverrideUtils.h being included earlier.

 * I had to add a missing include to RollingNumber.h

 * Also had to partially restore include order in JsepSessionImpl.cpp to avoid
   some -WError issues due to some static inline functions being defined in a
   header but not used in the rest of the compilation unit.

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

--HG--
extra : moz-landing-system : lando
2020-01-20 16:19:48 +00:00
Emilio Cobos Álvarez aa3a695712 Bug 1609996 - Remove mozilla/Move.h. r=froydnj
rg -l 'mozilla/Move.h' | xargs sed -i 's/#include "mozilla\/Move.h"/#include <utility>/g'

Further manual fixups and cleanups to the include order incoming.

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

--HG--
extra : moz-landing-system : lando
2020-01-20 16:18:20 +00:00
Brian Hackett f74708b30a Bug 1598951 Part 2 - Don't record random numbers in jemalloc, r=glandium.
Depends on D58437

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

--HG--
extra : moz-landing-system : lando
2020-01-10 05:26:10 +00:00
Simon Giesecke 97827bec40 Bug 1601590 - Undef _FORTIFY_SOURCE to fix build with --warnings-on-errors. r=glandium
This is required on some systems such as Fedora to allow
building with -O0 together with --warnings-as-errors due to
a check in /usr/include/features.h

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

--HG--
extra : moz-landing-system : lando
2019-12-12 01:59:13 +00:00
Nicholas Nethercote 928e9e1d00 Bug 1594598 - Use uint8_t* to avoid a bunch of casts. r=glandium
Currently the PHC code uses char* and uintptr_t in various address
computations. This patch changes it to use uint8_t* instead, which is clearer
than char* and avoids the need for various casts.

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

--HG--
extra : moz-landing-system : lando
2019-11-06 23:56:48 +00:00
Nicholas Nethercote 3f17b826e9 Bug 1594598 - Improve some PHC comments. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D43838

--HG--
extra : moz-landing-system : lando
2019-11-06 23:56:48 +00:00
Nicholas Nethercote fb493c1481 Bug 1594598 - Tweak the control flow in MaybePageAlloc()'s loop. r=glandium
This reduces the indentation level by one for most of the loop body.

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

--HG--
extra : moz-landing-system : lando
2019-11-06 23:52:31 +00:00
Nicholas Nethercote 956102ca29 Bug 1594598 - Fix some broken PHC_LOGGING code. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D42267

--HG--
extra : moz-landing-system : lando
2019-11-06 23:52:15 +00:00
Nicholas Nethercote adb9edf389 Bug 1574388 - Implement PHC on Mac. r=gsvelto,glandium
But it is not yet enabled; bug 1576515 will do that.

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

--HG--
extra : moz-landing-system : lando
2019-08-25 23:16:05 +00:00
Sylvestre Ledru 645f2d5773 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-08-13 07:15:25 +00:00
Mike Hommey c159931fbc Bug 1571505 - Properly add dbghelp where needed. r=nalexander
While here, properly export StackWalk.h when building with
--enable-project=memory.

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

--HG--
extra : moz-landing-system : lando
2019-08-06 18:14:12 +00:00
Cameron McCormack d075470483 Bug 1053379 - Simplify CodeAddressService so non-DMD users can rely on defaults. r=njn
None of the StringTable implementations were freeing their strdup'd
strings, either.

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

--HG--
extra : moz-landing-system : lando
2019-08-06 21:58:12 +00:00
Nicholas Nethercote e38691d6e6 Bug 1569862 - Implement PHC on Windows. r=glandium
The most important part is the `GetPHCAddrInfo()` function in
`exception_handler.cc`, which extracts a crash address from an
`EXCEPTION_POINTERS` object.

The commit also changes the code so that it works if MozStackWalk() returns an
empty stack trace. This happens in practice on Windows on automation sometimes,
I'm not sure why.

The rest of the commit is just plumbing and the smoothing over of minor
platform differences.

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

--HG--
extra : moz-landing-system : lando
2019-08-02 00:33:04 +00:00
Nicholas Nethercote 38dbbfcffc Bug 1523276 - Implement PHC, a probabilistic heap checker. r=glandium,gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D25021

--HG--
extra : rebase_source : 86e94499f746b18a596130341692c6a9992d4867
2019-07-03 09:26:11 +10:00
Victor Porof feaa92296b Bug 1561435 - Format memory/, a=automatic-formatting
# ignore-this-changeset

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

--HG--
extra : source : ae1388f34f73a8628d46d49ca0de9577a20bf650
2019-07-05 10:51:11 +02:00
Nick Thomas 1048178580 Bug 1559975 - enable py2 and py3 linting in memory r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D35251

--HG--
extra : moz-landing-system : lando
2019-06-28 18:53:28 +00:00
Nicholas Nethercote 653456467a Bug 1533240 - Replace DMD's custom TLS code with use of mozilla/ThreadLocal.h. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D22448

--HG--
extra : moz-landing-system : lando
2019-03-22 20:07:30 +00:00
Edwin Gao b0ed46de2e Bug 1536250 - disable test_dmd.js r=jmaher
Disable this test which intermittently fails in xpcshell.

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

--HG--
extra : moz-landing-system : lando
2019-03-19 01:12:08 +00:00
Gurzau Raul 0f47ac1ab9 Backed out changeset 46f6705f9c0c (bug 1533240) for xpcshell failures at /test/test_dmd.js on a CLOSED TREE. 2019-03-14 07:03:38 +02:00
Nicholas Nethercote f3a720ae86 Bug 1533240 - Replace DMD's custom TLS code with use of mozilla/ThreadLocal.h. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D22448

--HG--
extra : moz-landing-system : lando
2019-03-14 01:05:15 +00:00
Ryan Hunt bc6f68363a Bug 1523969 part 16 - Move method definition inline comments to new line in 'memory/'. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D21117

--HG--
extra : rebase_source : 73bb987caf0e10f7168610a3d6d3b993afeb7dd3
2019-02-25 16:10:15 -06:00
Nicholas Nethercote e01d4bc8cc Bug 1531027 - Add an explicit copy constructor to StackTrace. r=ehsan
This only copies the first `mLength` elements in `mPcs`.

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

--HG--
extra : rebase_source : 91601501056fe7ea5b011adeca59033568fbde4a
2019-02-28 11:00:14 +11:00
Nicholas Nethercote 3494926e55 Bug 1531029 - Fix incorrect `sizeof` expression. r=ehsan
This doesn't change behaviour because `sizeof(uintptr_t)` equals
`sizeof(uintptr_t*)`, but it's good to make things more obviously correct.

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

--HG--
extra : rebase_source : 4df36d1d1e85a671c297e6e761b44b7da5b85343
2019-02-28 11:05:34 +11:00
Ehsan Akhgari 1ca16ce872 Bug 1531027 - Make InfallibleAllocPolicy::new_ accept its argument as a reference; r=njn
Differential Revision: https://phabricator.services.mozilla.com/D21486

--HG--
extra : moz-landing-system : lando
2019-02-28 06:41:09 +00:00
Mike Hommey 9ca5062588 Bug 1530562 - Set SmokeDMD compiler flags depending on compiler type rather than target OS. r=mshal
Differential Revision: https://phabricator.services.mozilla.com/D21161

--HG--
extra : moz-landing-system : lando
2019-02-26 22:06:37 +00:00
Nicholas Nethercote 06e15020fe Bug 1529452 - Fix a silly bug. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D20772

--HG--
extra : moz-landing-system : lando
2019-02-22 10:52:03 +00:00
Nicholas Nethercote 4e8b423a96 Bug 1529452 - Avoid a multiplication that could overflow. r=glandium
Also add a comment about another multiplication.

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

--HG--
extra : moz-landing-system : lando
2019-02-21 04:28:15 +00:00
Masatoshi Kimura e59e3b3e20 Bug 1528651 - Fix some trivial warnings and re-enable warnings-as-errors on Windows in some directories. r=dmajor
--HG--
extra : source : 5ee9efeda9e67f6af0521be85266703763cc4c50
2019-02-19 20:42:11 +09:00
Myk Melez 25349d2601 Bug 1518283 - prohibit blank lines at the beginning and end of blocks (eslint padded-blocks) r=mossop,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D17526

--HG--
extra : moz-landing-system : lando
2019-01-30 17:26:25 +00:00
Kris Maglione e930b89c34 Bug 1514594: Part 3 - Change ChromeUtils.import API.
***
Bug 1514594: Part 3a - Change ChromeUtils.import to return an exports object; not pollute global. r=mccr8

This changes the behavior of ChromeUtils.import() to return an exports object,
rather than a module global, in all cases except when `null` is passed as a
second argument, and changes the default behavior not to pollute the global
scope with the module's exports. Thus, the following code written for the old
model:

  ChromeUtils.import("resource://gre/modules/Services.jsm");

is approximately the same as the following, in the new model:

  var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");

Since the two behaviors are mutually incompatible, this patch will land with a
scripted rewrite to update all existing callers to use the new model rather
than the old.
***
Bug 1514594: Part 3b - Mass rewrite all JS code to use the new ChromeUtils.import API. rs=Gijs

This was done using the followng script:

https://bitbucket.org/kmaglione/m-c-rewrites/src/tip/processors/cu-import-exports.jsm
***
Bug 1514594: Part 3c - Update ESLint plugin for ChromeUtils.import API changes. r=Standard8

Differential Revision: https://phabricator.services.mozilla.com/D16747
***
Bug 1514594: Part 3d - Remove/fix hundreds of duplicate imports from sync tests. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16748
***
Bug 1514594: Part 3e - Remove no-op ChromeUtils.import() calls. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16749
***
Bug 1514594: Part 3f.1 - Cleanup various test corner cases after mass rewrite. r=Gijs
***
Bug 1514594: Part 3f.2 - Cleanup various non-test corner cases after mass rewrite. r=Gijs

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

--HG--
extra : rebase_source : 359574ee3064c90f33bf36c2ebe3159a24cc8895
extra : histedit_source : b93c8f42808b1599f9122d7842d2c0b3e656a594%2C64a3a4e3359dc889e2ab2b49461bab9e27fc10a7
2019-01-17 10:18:31 -08:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Andrew McCreight 4f8e71a1ca Bug 1519224 - Fix stack frame printing in block_analyzer.py. r=erahm
Also, add a new allocator function.

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

--HG--
extra : moz-landing-system : lando
2019-01-14 18:41:35 +00: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