Commit Graph

2303 Commits

Author SHA1 Message Date
Chris Martin
59f6230bef Bug 1701770 - Defer Windows DPI Awareness from load time to run time r=bobowen,aklotz
Currently, we set DPI awareness in the manifest files for firefox.exe.

Unfortunately, that causes DPI-related Win32k calls when user32.dll
is loaded.

This changes things to wait until we are sure we're not running in a
Win32k Lockdown Content Process before we attempt to initialize DPI scaling.

Differential Revision: https://phabricator.services.mozilla.com/D116433
2021-06-17 15:53:23 +00:00
Kris Wright
d669e4ca82 Bug 1683404 - Remove tsan suppressions for nsTimerImpl. r=Gankra
Try push shows that the issue is fixed with the above patch in the stack: https://treeherder.mozilla.org/jobs?repo=try&revision=a9e9135464b2750a8b6fd2a19408e3537b39dbe2

Differential Revision: https://phabricator.services.mozilla.com/D115776
2021-06-17 15:36:00 +00:00
Florian Quèze
dfeb53e219 Bug 1715257 - Remove Task Tracer code from the profiler, r=gerald,necko-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D117996
2021-06-17 09:33:00 +00:00
Iulian Moraru
b02492de66 Backed out changeset 617a466d0cce (bug 1715257) for causing build bustages. CLOSED TREE 2021-06-17 10:58:16 +03:00
Florian Quèze
7b4906a6bd Bug 1715257 - Remove Task Tracer code from the profiler, r=gerald,necko-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D117996
2021-06-17 06:12:10 +00:00
Noemi Erli
6fcc995a0a Backed out 2 changesets (bug 1701770) for causing failures in browser_checkdllblockliststate.js CLOSED TREE
Backed out changeset a6f46b0a30e9 (bug 1701770)
Backed out changeset 263591537722 (bug 1701770)
2021-06-15 04:09:49 +03:00
Chris Martin
d909ca765f Bug 1701770 - Defer Windows DPI Awareness from load time to run time r=bobowen,aklotz
Currently, we set DPI awareness in the manifest files for firefox.exe.

Unfortunately, that causes DPI-related Win32k calls when user32.dll
is loaded.

This changes things to wait until we are sure we're not running in a
Win32k Lockdown Content Process before we attempt to initialize DPI scaling.

Differential Revision: https://phabricator.services.mozilla.com/D116433
2021-06-14 20:55:33 +00:00
Toshihito Kikuchi
a0c3a4c847 Bug 1702717 - Skip blocklisting if the mappad region is not executable. r=mhowell
When a module is loaded with `LOAD_LIBRARY_AS_IMAGE_RESOURCE`, the mapped region
is `MEM_IMAGE`, but it's not executable.  We don't have to check the blocklist
in such a case.

Differential Revision: https://phabricator.services.mozilla.com/D117573
2021-06-11 22:45:46 +00:00
surajeet310
76bf30f3f0 Bug 1714688 - Removed 'if PY2' logic from mozglue r=mhentges
mozglue is no longer used with Python 2

Differential Revision: https://phabricator.services.mozilla.com/D117510
2021-06-11 20:37:44 +00:00
Alexandru Michis
c152381556 Backed out changeset 49f8a4acd649 (bug 1712674) for stack walking crashes on older Windows versions (bug 1715633).
CLOSED TREE
2021-06-10 11:39:30 +03:00
Gerald Squelart
ec93a05700 Bug 1712674 -- If RtlLookupFunctionEntry fails, attempt to unwind from BP - r=glandium
BP may contain the stack address where the caller's BP was pushed after the function call, in which case it's possible to carefully unwind from it.

This can get past JIT code, so there is no need to give up in this case.

mozglue was already linked with ntdll, but now that we use it directly (for `NtQueryInformationThread`), ntdll needed to be added to some other users of MozStackWalkThread.

Differential Revision: https://phabricator.services.mozilla.com/D115962
2021-06-09 00:28:03 +00:00
Gijs Kruitbosch
feb380e741 Bug 1711519 - remove tabbrowser non-proton code and gProton global browser window property, r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D116632
2021-06-03 11:41:55 +00:00
Dmitry Bezhetskov
3218df0314 Bug 1710358 - Fix compilation warnings for WASI. r=jandem.
kNsPerUs is unused and fputwc return's type is wint_t.

Differential Revision: https://phabricator.services.mozilla.com/D116578
2021-06-03 05:08:33 +00:00
Toshihito Kikuchi
f77b225313 Bug 1695817 - Part 1: Make nt::GetLeafName accept nsAString r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D109302
2021-05-28 22:35:57 +00:00
Alexandru Michis
8fbcd44dc4 Backed out 9 changesets (bug 1695817) for causing bc failures in content/aboutThirdParty.js
CLOSED TREE

Backed out changeset 6b7f451e911e (bug 1695817)
Backed out changeset ad3ea67b3d70 (bug 1695817)
Backed out changeset b4f971059f3f (bug 1695817)
Backed out changeset 9c9a928d4a70 (bug 1695817)
Backed out changeset 4a9bcb38fddf (bug 1695817)
Backed out changeset 48c0eed38628 (bug 1695817)
Backed out changeset 7583675dccb1 (bug 1695817)
Backed out changeset e3f2bed63c33 (bug 1695817)
Backed out changeset 1c45ba4fba61 (bug 1695817)
2021-05-28 21:53:41 +03:00
Toshihito Kikuchi
9672ed9057 Bug 1695817 - Part 1: Make nt::GetLeafName accept nsAString r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D109302
2021-05-28 15:32:29 +00:00
Butkovits Atila
3735a33d14 Backed out 9 changesets (bug 1695817) for causing build bustages. CLOSED TREE
Backed out changeset 49be1caf6501 (bug 1695817)
Backed out changeset 30f1382d6058 (bug 1695817)
Backed out changeset ab9fa7f3b633 (bug 1695817)
Backed out changeset b03b122438cc (bug 1695817)
Backed out changeset 812a6bbfbe0e (bug 1695817)
Backed out changeset 3551230a7522 (bug 1695817)
Backed out changeset c7354b48fbee (bug 1695817)
Backed out changeset 4860450c2e23 (bug 1695817)
Backed out changeset 29dee289f866 (bug 1695817)
2021-05-28 07:52:30 +03:00
Toshihito Kikuchi
ccf62d7b68 Bug 1695817 - Part 1: Make nt::GetLeafName accept nsAString r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D109302
2021-05-28 04:19:05 +00:00
Butkovits Atila
711401ea39 Backed out 9 changesets (bug 1695817) for causing failures at browser_all_files_referenced.js. CLOSED TREE
Backed out changeset df4086427aaf (bug 1695817)
Backed out changeset 119a24f8be08 (bug 1695817)
Backed out changeset fd277ae2a7b8 (bug 1695817)
Backed out changeset a2c86a645fa8 (bug 1695817)
Backed out changeset c73705233fc4 (bug 1695817)
Backed out changeset 0a80eea3c0fa (bug 1695817)
Backed out changeset 9af42c7a3ca7 (bug 1695817)
Backed out changeset a2d11a0849d5 (bug 1695817)
Backed out changeset ba3ddcc28cbf (bug 1695817)
2021-05-28 03:05:09 +03:00
Toshihito Kikuchi
82431c81c9 Bug 1695817 - Part 1: Make nt::GetLeafName accept nsAString r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D109302
2021-05-27 21:14:12 +00:00
Joel Maher
3ad9f06697 Bug 1710923 - migrate windows 7x32 debug tests to windows 10x32. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D115017
2021-05-24 20:06:43 +00:00
Agi Sferro
5e28045dd6 Bug 1701269 - Remove unused MinidumpAnalyzer. r=owlish
Differential Revision: https://phabricator.services.mozilla.com/D109919
2021-05-20 22:03:03 +00:00
Gerald Squelart
098790a8eb Bug 1703410 - Only change Windows timer resolution if PROFILER_ADJUST_TIMER_RESOLUTION is set - r=florian
On Windows, the profiler changes the timer resolution when the sampling interval is less than 10ms.
However this change affects all of Firefox, which can change other behaviors, sometimes causing confusion when refresh-rate issues magically disappear when the profiler is running.

So now by default the profiler will not change the timer resolution. This should rarely affect the profiler's effective sampling rate, unless all threads in a process are in a waiting state, in which case there is nothing new to sample anyway! The front-end is investigating ways to make sampling gaps more obvious, see https://github.com/firefox-devtools/profiler/issues/2962

If some power users really need the added sampling precision in some profiling sessions, the timer resolution change may be requested before running Firefox, by setting the environment variable "PROFILER_ADJUST_TIMER_RESOLUTION" to any value.

Differential Revision: https://phabricator.services.mozilla.com/D115451
2021-05-19 22:29:17 +00:00
Mike Hommey
e5c65130a4 Bug 1711838 - Avoid GCC warning about %s argument possibly being null. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D115450
2021-05-19 22:19:03 +00:00
Toshihito Kikuchi
d8fe2ac176 Bug 1702086 - Part4: Use PEHeaders::GetBounds instead of GetModuleInformation. r=gerald
`SharedLibraryInfo::GetInfoForSelf()` can use `PEHeaders::GetBounds` instead of
`GetModuleInformation` to get the start/end address of a module's mapped region
in the local process.  It's roughly 100x faster because `GetModuleInformation`
invokes two system calls `NtQueryInformationProcess` and `NtReadVirtualMemory`
while `nt::PEHeaders` does not.

Depends on D115254

Differential Revision: https://phabricator.services.mozilla.com/D115255
2021-05-19 18:01:49 +00:00
Toshihito Kikuchi
2755a48956 Bug 1702086 - Part3: Use PEHeaders::GetVersionInfo. r=gerald
This patch replaces two versions of `GetVersion` in Gecko profiler and
baseprofiler with `PEHeaders::GetVersionInfo`.

Depends on D115253

Differential Revision: https://phabricator.services.mozilla.com/D115254
2021-05-19 18:01:48 +00:00
Toshihito Kikuchi
4e1b4037be Bug 1702086 - Part2: Get PDB information from the new handle. r=gerald
This patch is the actual fix for Bug 1702086.  The problem of Bug 1702086 is that
`LoadLibraryExW` loaded the module onto an address different from the original
mapped addresss because it was unloaded after we started enumeration.  Calling
`GetPdbInfo` with the original address `module.lpBaseOfDll` caused a crash.

The proposed fix consists of three parts.

The first part is to get PDB information from `handleLock`, which is always valid
even if the original address was unloaded.  With this, we don't need a check
of `VirtualQuery`.

The second part is to add `LOAD_LIBRARY_AS_IMAGE_RESOURCE` along with
`LOAD_LIBRARY_AS_DATAFILE` to the call to `LoadLibraryEx`.  This is needed
to read information from the sections outside the PE headers because
RVA (= relative virtual address) is an address after relocation.
Without `LOAD_LIBRARY_AS_IMAGE_RESOURCE`, a module is mapped without relocation,
so `GetPdbInfo()` accesses wrong memory resulting in a crash.

The third part is to introduce `PEHeaders::GetPdbInfo`, replacing two versions
of `GetPdbInfo` in Gecko profiler and baseprofiler.

Depends on D115252

Differential Revision: https://phabricator.services.mozilla.com/D115253
2021-05-19 18:01:48 +00:00
Toshihito Kikuchi
d64610fed5 Bug 1702086 - Part1: Introduce EnumerateProcessModules. r=gerald
This patch introduces `EnumerateProcessModules` to enumerate all loaded modules
in the local process so that Gecko profiler and baseprofiler can use it.

Differential Revision: https://phabricator.services.mozilla.com/D115252
2021-05-19 18:01:47 +00:00
Gerald Squelart
8b96edfb80 Bug 1710757 - Fix baseprofiler native-frame output - r=florian
SprintfLiteral doesn't support "%#llx" anymore.
So this patch switches to an explicit "0x%llx" to output addresses as the symbolicator expects.

Differential Revision: https://phabricator.services.mozilla.com/D114914
2021-05-12 10:22:55 +00:00
Andi-Bogdan Postelnicu
eab549fd19 Bug 1519636 - Initial reformat of C/C++ code with clang-format version 12.0.0. r=sylvestre
clang-format version 12.0.0 (taskcluster-KEgO7qdgQ8uaewA6NkRnRA)

Differential Revision: https://phabricator.services.mozilla.com/D114211
2021-05-10 07:15:07 +00:00
Toshihito Kikuchi
3abb99c8e2 Bug 1706041 - Reset gDllServices when DllServices is destroyed. r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D113524
2021-05-07 19:11:48 +00:00
Florian Quèze
7a8983cc88 Bug 1705318 - substract the memory used by the profiler buffer when sampling the memory counter, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D114397
2021-05-07 09:32:11 +00:00
Gerald Squelart
e2d8ae5a08 Bug 1708350 - profiler_suspend_and_sample_thread can now sample the current thread - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D114115
2021-05-06 23:23:40 +00:00
Paul Adenot
c59e733060 Bug 1685503 - Use AwakeTimeStamp to count time for media telemetry. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D112797
2021-05-05 09:24:51 +00:00
Florian Quèze
3e63d9143b Bug 1635442 - Only initialize LUL when the StackWalk feature is requested on Linux, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D113693
2021-04-29 15:27:26 +00:00
Cosmin Sabou
799b5200ae Backed out changeset bc141a334421 (bug 1685503) for windows browser chrome failures on browser_tab_visibility_and_play_time.js CLOSED TREE 2021-04-29 18:35:43 +03:00
Paul Adenot
2f3c1253f9 Bug 1685503 - Use AwakeTimeStamp to count time for media telemetry. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D112797
2021-04-29 11:45:42 +00:00
Alexandru Michis
335b6f5f96 Backed out changeset 6bd7baadb78c (bug 1702086) for causing Bug 1607574.
CLOSED TREE
2021-04-28 23:23:01 +03:00
Mike Hommey
8bf0782758 Bug 1707834 - Avoid libmozgtk not being linked to libxul. r=firefox-build-system-reviewers,mhentges
When the linker defaults to --as-needed, libmozgtk ends up not linked
to libxul because libxul doesn't use anything from it.
We solve the problem by adding a symbol to mozgtk and have libxul use
it.

In bug 1377445, we moved XShmQueryExtension to mozglue. While libxul
currently doesn't use the symbol (it's a workaround for system
libraries), we can move the function back to mozgtk and add a dummy
call.

Differential Revision: https://phabricator.services.mozilla.com/D113487
2021-04-27 21:44:22 +00:00
Andi-Bogdan Postelnicu
2508edc4c5 Bug 1519636 - Reformat recent changes to the Google coding style. r=necko-reviewers,geckoview-reviewers,agi
Updated with clang-format version 11.0.1 (taskcluster-GI8pmG3eQ_OSXfjFfr2yFw)

\# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D113294
2021-04-26 15:52:25 +00:00
Gerald Squelart
075a890c58 Bug 1706554 - Remove aFirstFramePC from no-op FramePointerStackWalk definition - r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D112900
2021-04-22 01:17:10 +00:00
Paul Adenot
61a126ec51 Bug 1685502 - Add a timestamp/duration class pair that only ticks when the computer is awake, on all platforms. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D101036
2021-04-20 17:24:24 +00:00
Mike Hommey
e1c4d88b46 Bug 1705727 - Disable tail call tests in TestStackWalk for code-coverage builds. r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D112689
2021-04-20 05:48:08 +00:00
Gerald Squelart
7258cd0454 Bug 1705998 - Remove Windows IA64 support from mozglue/misc/StackWalk.cpp - r=glandium
This was the only explicit mention of IA64 left in mozglue.

Differential Revision: https://phabricator.services.mozilla.com/D112546
2021-04-20 05:14:04 +00:00
Gerald Squelart
fe26e18c45 Bug 1705308 - Remove WalkStackData and clean up MozStackWalkThread - r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D112171
2021-04-20 04:37:05 +00:00
Gerald Squelart
e27676be0d Bug 1705308 - Move WalkStackMain64 code into MozStackWalkThread - r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D112170
2021-04-20 04:37:04 +00:00
Gerald Squelart
e7657403a3 Bug 1705308 - Invoke callback from WalkStackMain64 instead of going through expandable on-stack buffers - r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D112169
2021-04-20 04:37:04 +00:00
Gerald Squelart
4bf34ae6d1 Bug 1705307 - Use CONTEXTGenericAccessors in WalkStackMain64 to access main CONTEXT registers - r=glandium
Instead of lots of #ifdef's inside WalkStackMain64 to access CONTEXT registers with their platform-specific names, these registers are now accessible through generic accessors in the wrapper class.
This also helps with avoiding CONTEXT pointers (and the worry they could be null).

Differential Revision: https://phabricator.services.mozilla.com/D112168
2021-04-20 04:37:03 +00:00
Mike Hommey
79e8df83dd Bug 1377445 - Remove build dependencies on gtk+2. r=firefox-build-system-reviewers,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D111997
2021-04-20 01:57:03 +00:00
Toshihito Kikuchi
ebb9e9f364 Bug 1705278 - Remove DependentModules from UntrustedModulesProcessor.cpp. r=aklotz
Bug 1620118 added a new field `isDependent` in the third-party-module ping
which is calculated in `UntrustedModulesProcessor`.  However, bug 1684532
revealed it was not accurate because some third-party applications revert
the import table to the original state immediately after their module was
loaded.

Now that we have a logic to determine `isDependent` in `NtMapViewOfSection`
to automatically block a module injected through the import table, we can
pass that value to the ping and remove the original logic in `UntrustedModulesProcessor`.

Differential Revision: https://phabricator.services.mozilla.com/D112227
2021-04-16 19:35:55 +00:00