Commit Graph

1582 Commits

Author SHA1 Message Date
Toshihito Kikuchi
f30b012bd4 Bug 1603974 - Part 6: Introduce Kernel32ExportsSolver. r=mhowell
This patch introduces `Kernel32ExportsSolver` which calculates RVAs of
kernel32's functions and transfers them to a target process, where the
transferred RVAs are resolved into function addresses.

Depends on D68346

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

--HG--
extra : moz-landing-system : lando
2020-04-07 14:39:51 +00:00
Toshihito Kikuchi
9fe11cf59a Bug 1603974 - Part 5: Introduce WindowsDllEntryPointInterceptor. r=mhowell
This patch introduces a new DLL interceptor `WindowsDllEntryPointInterceptor`
which applies a hook to a target function without backing up the original
function code.

Depends on D68345

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

--HG--
extra : moz-landing-system : lando
2020-04-07 14:39:54 +00:00
Toshihito Kikuchi
8219a28c40 Bug 1603974 - Part 4: Introduce MMPolicyInProcessEarlyStage. r=mhowell
This patch introduces a new policy `MMPolicyInProcessEarlyStage` which does
not consume any functions imported from kernel32.dll so that we can use it
in a process's early stage i.e. before IAT is resolved.

Depends on D68344

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

--HG--
extra : moz-landing-system : lando
2020-04-07 14:39:56 +00:00
Toshihito Kikuchi
55af68b7d2 Bug 1603974 - Part 3: Extract a patching operation from CreateTrampoline. r=mhowell
`WindowsDllDetourPatcher::CreateTrampoline` does not only create a trampoline
region but also applies a patch on an original function.  This patch extracts
the patching part as separate functions.

Depends on D68343

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

--HG--
extra : moz-landing-system : lando
2020-04-07 14:40:04 +00:00
Toshihito Kikuchi
b5969e8a0f Bug 1603974 - Part 2: Move PEHeaders from CheckBlockInfo to IsDllAllowed. r=mhowell
This patch moves the instantiation of `PEHeaders` from `CheckBlockInfo` to
`IsDllAllowed` so that `IsDllAllowed` can use an instance of `PEHeaders`.

Depends on D68342

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

--HG--
extra : moz-landing-system : lando
2020-04-07 14:40:07 +00:00
Toshihito Kikuchi
18f97f01b8 Bug 1603974 - Part 1: Implement nt::VirtualQuery consuming only ntdll.dll. r=mhowell
This patch introduces `nt::VirtualQuery` which consumes only ntdll's functions
to reduce dependency in `MMPolicy` on kernel32.dll.  With this, `MMPolicy` still
depends on kernel32.dll, that will be solved by a coming patch.

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

--HG--
extra : moz-landing-system : lando
2020-04-07 14:40:14 +00:00
Jon Coppeard
f105b2ae13 Bug 1627683 - Update TSAN suppression list following changes to give GC cells headers r=decoder
Similarly to changeset cfa64a6b5a87, a scope's enclosing scope is no longer updated by MovingTracer::onScopeEdge following the changes in bug 1625212. Update the suppression list accordingly.

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

--HG--
extra : moz-landing-system : lando
2020-04-07 12:22:07 +00:00
Simon Giesecke
e3d1db10d9 Bug 1626884 - Make RC non-copyable and declare operator= only in debug builds. r=froydnj
RC should be non-copyable. It already is non-copyable in the atomic variant,
but not in the non-atomic variant. This ensures that RefCounted is also
non-copyable, which prevents that classes deriving from RefCounted get
accidentally copied.

Also, RC's operator= should be defined only in debug builds. As already
described in a code comment, it's only used in debug builds (to assign the
dead value), and otherwise no modifications other than incrementing &
decrementing should be possible.

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

--HG--
extra : moz-landing-system : lando
2020-04-06 09:17:34 +00:00
Andrea Marchesini
9bea58365a Bug 1624146 - Cookie code refactoring - part 10 - CookieService under mozilla::net, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D67759

--HG--
rename : netwerk/cookie/nsCookieService.cpp => netwerk/cookie/CookieService.cpp
rename : netwerk/cookie/nsCookieService.h => netwerk/cookie/CookieService.h
extra : moz-landing-system : lando
2020-04-06 12:26:14 +00:00
Gerald Squelart
ca9fa3fe8f Bug 1627563 - Replace MOZ_MUST_USE with [[nodiscard]] in mozglue/baseprofiler. r=canaltinova
Also move MOZ_MUST_USE before function declarations' specifiers and return type. While clang and gcc's attribute((warn_unused_result)) can appear before, between, or after function specifiers and return types, the [[nodiscard]] attribute must precede the function specifiers.

And removed a few unneded `#include "mozilla/Attributes.h"`.

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

--HG--
extra : moz-landing-system : lando
2020-04-06 10:04:38 +00:00
Jon Coppeard
2fa68eed9c Bug 1625212 - Update TSAN supression list now a Shape's base shape is not marked directly r=sfink
Previously this ended up with MovingTracer doing the update itself, but now the pointer is stored in a CellHeader it's done through an overload of TraceEdge.

The TSAN stack doesn't appear to have the class for the unsafeSetPtr method that actually does the update so rather than make this apply to all uses of this method I added a supression for the next function up in the stack.

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

--HG--
extra : moz-landing-system : lando
2020-04-06 10:43:34 +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
Toshihito Kikuchi
b7dfd23416 Bug 1625452 - No need to pass an offset to CountPrefixBytes. r=handyman
When our detour processes instructions, we pass `ReadOnlyTargetFunction` to
`CountPrefixBytes` to determine whether a lock prefix exists or not.
In that case, we don't need to pass both `ReadOnlyTargetFunction` and an offset
as a parameter because `ReadOnlyTargetFunction` has an offset as a member.

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

--HG--
extra : moz-landing-system : lando
2020-04-04 10:31:32 +00:00
Eric Rahm
12ca859e67 Bug 1626456 - Remove stray nsAutoPtr.h includes. r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D69127

--HG--
extra : moz-landing-system : lando
2020-04-03 21:05:46 +00:00
Gabriele Svelto
5c3d7d4ed9 Bug 1624336 - Block old versions of COMODO Firewall to prevent them from crashing Firefox r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D68188

--HG--
extra : moz-landing-system : lando
2020-04-02 20:47:30 +00:00
Gerald Squelart
d4709d16f3 Bug 1625856 - ProfileBufferChunkManagerWithLocalLimit - r=canaltinova
`ProfileBufferChunkManagerWithLocalLimit` is a chunk manager that enforces a
memory limit in each process.

It is meant to mimic the main way `BlocksRingBuffer` works, so that we can more
easily switch to the new buffer storage without introducing the extra complexity
of inter-process memory coordination yet.

`ProfileBufferChunkManagerWithLocalLimit` will still offer a benefit over
`BlocksRingBuffer`, in that it won't allocate the maximum buffer size
immediately -- speeding the initialization, and hopefully even reducing the
total Firefox memory consumption in short-lived processes.

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

--HG--
extra : moz-landing-system : lando
2020-04-02 03:09:36 +00:00
Dorel Luca
8d8dda7ae9 Backed out 2 changesets (bug 1595596) for build bustage in build/src/mozglue/misc/MmapFaultHandler.cpp. CLOSED TREE
Backed out changeset 34c018c96749 (bug 1595596)
Backed out changeset 1e21eefd5fce (bug 1595596)

--HG--
rename : mozglue/misc/MmapFaultHandler.cpp => modules/libjar/MmapFaultHandler.cpp
rename : mozglue/misc/MmapFaultHandler.h => modules/libjar/MmapFaultHandler.h
2020-03-31 02:07:33 +03:00
Doug Thayer
13ecdfb5c8 Bug 1595596 - Use MMAP_FAULT_HANDLER in StartupCache r=aklotz
Please double check that I am using this correctly. I believe we are
seeing the crash in the linked bug because we are not handling hardware
faults when reading from the memory mapped file. This patch just wraps
all accesses in the MMAP_FAULT_HANDLER_ macros.

Depends on D53042

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

--HG--
rename : modules/libjar/MmapFaultHandler.cpp => mozglue/misc/MmapFaultHandler.cpp
rename : modules/libjar/MmapFaultHandler.h => mozglue/misc/MmapFaultHandler.h
extra : moz-landing-system : lando
2020-03-27 21:00:47 +00:00
Gerald Squelart
de1f096fd6 Bug 1624257 - ProfileBufferChunkManagerSingle - r=canaltinova
Chunk manager dealing with only one chunk at a time.

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

--HG--
extra : moz-landing-system : lando
2020-03-29 23:49:32 +00:00
Gerald Squelart
2e503c9a92 Bug 1624257 - ProfileBufferChunkManager - r=canaltinova
Base class for chunk managers.

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

--HG--
extra : moz-landing-system : lando
2020-03-29 23:25:35 +00:00
André Bargull
14ca007916 Bug 1625138 - Part 41: Remove no longer needed includes for mozilla/TypeTraits. r=froydnj
Also adds missing includes in some files, these were previously only transivitely
included through mozilla/TypeTraits.h.

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

--HG--
extra : moz-landing-system : lando
2020-03-28 16:00:09 +00:00
André Bargull
13bfe75b97 Bug 1625138 - Part 40: Replace remaining mozilla::IsSame with std::is_same. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68560

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:21 +00:00
André Bargull
cf0b1e89e9 Bug 1625138 - Part 30: Replace mozilla::RemoveCV with std::remove_cv. r=froydnj,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D68547

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:18 +00:00
André Bargull
a08be4177e Bug 1625138 - Part 17: Replace mozilla::Decay with std::decay. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68372

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:15 +00:00
André Bargull
ebec34a898 Bug 1625138 - Part 16: Replace mozilla::IsIntegral with std::is_integral. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68371

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:15 +00:00
André Bargull
13e9ad3137 Bug 1625138 - Part 14: Replace mozilla::IsSigned with std::is_signed. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68369

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:15 +00:00
André Bargull
1e4d8b891e Bug 1625138 - Part 4: Replace mozilla::MakeUnsigned with std::make_unsigned. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68358

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:12 +00:00
Christian Holler
c248943491 Bug 1620326 - Add a separate TSan suppression list for the updater. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D67125

--HG--
extra : moz-landing-system : lando
2020-03-26 21:19:24 +00:00
James Willcox
2ef4e466f8 Bug 1291377 - Don't use custom linker on Android 6.0+ r=glandium
We still need it for Android < 6.0 (API 23) because otherwise we don't
have a way to hook up mozalloc.

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

--HG--
extra : moz-landing-system : lando
2020-03-20 15:35:48 +00:00
Gerald Squelart
c80fa7258c Bug 1623228 - ProfileBufferChunk - r=canaltinova
A `ProfileBufferChunk` represents a single chunk of memory, with an optional
link to the next chunk.

In the new Fission-compatible profiler storage, chunks will be allocated by a
chunk manager, filled with data by the profiler, and then released back to the
chunk manager.
The chunk manager may decide to destroy or recycle old chunks based on memory
limits (per process, or for the entire Firefox app).

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

--HG--
extra : moz-landing-system : lando
2020-03-24 01:04:33 +00:00
Razvan Maries
f86965f8af Backed out changeset 1a28a2477439 (bug 1623228) for build bustages on ProfileBufferChunk.h. CLOSED TREE 2020-03-23 23:29:12 +02:00
Gerald Squelart
df0599ee6d Bug 1623228 - ProfileBufferChunk - r=canaltinova
A `ProfileBufferChunk` represents a single chunk of memory, with an optional
link to the next chunk.

In the new Fission-compatible profiler storage, chunks will be allocated by a
chunk manager, filled with data by the profiler, and then released back to the
chunk manager.
The chunk manager may decide to destroy or recycle old chunks based on memory
limits (per process, or for the entire Firefox app).

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

--HG--
extra : moz-landing-system : lando
2020-03-23 18:16:08 +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
Christian Holler
b503a043c8 Bug 1600895 - Add additional suppression for race variant. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D67732

--HG--
extra : moz-landing-system : lando
2020-03-23 10:30:03 +00:00
Bogdan Tara
05377fcd08 Backed out changeset fe0c22951e7c (bug 1291377) for mozglue related Android bustages CLOSED TREE 2020-03-20 16:39:42 +02:00
James Willcox
e2c25ee165 Bug 1291377 - Don't use custom linker on Android 6.0+ r=glandium
We still need it for Android < 6.0 (API 23) because otherwise we don't
have a way to hook up mozalloc.

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

--HG--
extra : moz-landing-system : lando
2020-03-20 14:20:48 +00:00
Gabriele Svelto
4d14cf5024 Bug 1621804 - Block the latest release of OpenSC which crashes Firefox nightly r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D67529

--HG--
extra : moz-landing-system : lando
2020-03-19 22:36:51 +00:00
Gerald Squelart
7dd306dcd9 Bug 1623195 - Optimize ProfileBufferEntryWriter::Serializer<Variant> - r=canaltinova
The old code was using `std::index_sequence_for` to call templated functions for
*every* possible Variant alternative.
Instead, using `Variant::match()` with a generic lambda (that also takes the
current Variant index, thanks to bug 1621865) means we're only calling the
function corresponding to the current alternative.

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

--HG--
extra : moz-landing-system : lando
2020-03-18 10:23:10 +00:00
Chris Fronk
d5b004443b Bug 1143478 - Rename mozilla::Pair to CompactPair. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D64511

--HG--
rename : mfbt/Pair.h => mfbt/CompactPair.h
extra : moz-landing-system : lando
2020-03-17 12:42:12 +00:00
Christian Holler
4a52e23cc9 Bug 1608068 - Add temporary TSan suppression for GC issue. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D66641

--HG--
extra : moz-landing-system : lando
2020-03-13 14:31:36 +00:00
Markus Stange
292f87c1ef Bug 1557570 - Call baseprofiler::profiler_init() from the first mozglue function that runs. r=gerald
As far as I can tell there is no single entry-point into C++ code on Android.
Instead, GeckoThread and GeckoLibLoader call various functions to load libraries one-by-one.
We want to capture all that library loading in the profiler, so we need to kick off the base profiler at the beginning of whichever function is called first.

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

--HG--
extra : moz-landing-system : lando
2020-03-17 04:15:04 +00:00
Markus Stange
3349423265 Bug 1557570 - Build the base profiler on Android. r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D64998

--HG--
extra : moz-landing-system : lando
2020-03-17 03:27:35 +00:00
Markus Stange
de0a0463d6 Bug 1557570 - Make baseprofiler/core/shared-libraries-linux.cc compile on Android. r=glandium
Stop including "Linker.h" and always include <link.h> instead, which also comes with ElfW() and other things that this code needs.
Also fix up "!/" path detection code.

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

--HG--
extra : moz-landing-system : lando
2020-03-17 03:26:57 +00:00
Markus Stange
6d980e05bb Bug 1618979 - Use PrintToConsole for things that should always be printed. r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D64996

--HG--
extra : moz-landing-system : lando
2020-03-17 03:26:19 +00:00
Markus Stange
e3cd7fc71c Bug 1618979 - Tweak base profiler logging. r=gerald
This fixes the declaration of (BaseProfiler)LogTest. It also makes it so that the logs show up on Android.
In xpcom we have printf_stderr which does something similar and also handles Windows.

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

--HG--
extra : moz-landing-system : lando
2020-03-17 03:25:40 +00:00
Markus Stange
e54247708a Bug 1619362 - Sync up the two profiler feature lists again. r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D65012

--HG--
extra : moz-landing-system : lando
2020-03-17 03:25:02 +00:00
Markus Stange
f38f79b818 Bug 1619362 - Remove two unused variables. r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D64990

--HG--
extra : moz-landing-system : lando
2020-03-17 03:24:23 +00:00
Markus Stange
345b2ee888 Bug 1619362 - Parse MOZ_BASE_PROFILER_STARTUP_DURATION and _INTERVAL. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D64988

--HG--
extra : moz-landing-system : lando
2020-03-17 04:11:20 +00:00
Gerald Squelart
bc32add109 Bug 1622179 - Replace direct dependencies on BlocksRingBuffer with ProfileBufferEntryWriter's where possible - r=canaltinova
This removes most dependencies on BlocksRingBuffer, to ease the transition to
the upcoming Fission-friendly profile buffer, including:
- Length type,
- SumBytes(),
- Gecko extensions of serialization.

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

--HG--
rename : tools/profiler/public/BlocksRingBufferGeckoExtensions.h => tools/profiler/public/ProfileBufferEntrySerializationGeckoExtensions.h
extra : moz-landing-system : lando
2020-03-16 20:32:35 +00:00
Toshihito Kikuchi
9a2add9bb3 Bug 1560052 - Block Athena's PKCS11 module to avoid the crash. r=jmathies
Differential Revision: https://phabricator.services.mozilla.com/D65010

--HG--
extra : moz-landing-system : lando
2020-03-16 19:51:01 +00:00