Commit Graph

119 Commits

Author SHA1 Message Date
Aaron Klotz
b59f7ece0f Bug 1451524: Make interceptor shared VM policy compatible with changes from bug 1456054; r=handyman
--HG--
extra : rebase_source : 14d4eaedec28708978bac42495f3a1eed180ac48
2018-04-26 11:12:55 -06:00
Hiroyuki Ikezoe
30abf8cc5d Bug 1456672 - Add a brief note that we prefer to pass TimeStamp objects by value. r=heycam,kats DONTBUILD
MozReview-Commit-ID: 6EvYJvBv5DF

--HG--
extra : rebase_source : 054ca1491ebbdc4788f90bf9fc60da75130b9af8
2018-04-26 14:53:23 +09:00
Dorel Luca
7652908dea Backed out changeset 3802f86e1bd1 (bug 1364624) for shutdown hangs on reftests. a=backout 2018-04-26 00:27:45 +03:00
Aaron Klotz
ea4048c1e7 Bug 1456054: Verify that a redirected address is accessible and backed by an image; r=handyman 2018-04-23 15:07:54 -06:00
Aaron Klotz
ff279da3a5 Bug 1451524: Add a VM policy to the DLL interceptor that allows multiple instances to share a single trampoline space; r=handyman 2018-04-02 17:04:17 -06:00
Eric Rahm
b626618f7d Bug 1364624 - Switch from CRITICALSECTION to SRWLOCK. r=froydnj
--HG--
extra : rebase_source : 4acc959bb8ccc33f6d549b71bbd83b8f8d09b353
2018-04-23 10:45:20 -07:00
Aaron Klotz
5317435ec0 Bug 1432653: Refactor the DLL interceptor and parameterize its memory operations; r=handyman
MozReview-Commit-ID: EYxVsQ1kicy

--HG--
rename : xpcom/build/nsWindowsDllInterceptor.h => mozglue/misc/interceptor/PatcherBase.h
rename : xpcom/build/nsWindowsDllInterceptor.h => mozglue/misc/interceptor/PatcherDetour.h
rename : xpcom/build/nsWindowsDllInterceptor.h => mozglue/misc/interceptor/PatcherNopSpace.h
rename : xpcom/build/nsWindowsDllInterceptor.h => mozglue/misc/nsWindowsDllInterceptor.h
rename : toolkit/xre/test/win/TestDllInterceptor.cpp => mozglue/tests/interceptor/TestDllInterceptor.cpp
extra : amend_source : 84a7590b40a649f7321eb05feca4f9256ecc5d22
2018-04-09 13:37:52 -06:00
Nika Layzell
0d56c8977a Bug 1437167 - Part 2: Round submillisecond condition variable waits up to 1ms, r=froydnj 2018-04-10 17:49:47 -04:00
Nika Layzell
0c3ba13e4c Bug 1437167 - Part 1: Stop using PRIntervalTime as the argument to CondVar::Wait and Monitor::Wait, r=mstange, r=froydnj 2018-04-10 17:49:47 -04:00
Andrea Marchesini
0d9f03eaef Bug 1450959 - TimeStamp class doesn't need to be friend of StartupTimelineRecordExternal, r=glandium 2018-04-05 06:44:31 +02:00
Martin Stransky
79aef7f85b Bug 1348310 - Use CLOCK_MONOTONIC as a base for nsWindow::GetEventTimeStamp() on Wayland, r=karlt
We assume CLOCK_MONOTONIC as timebase for events on Wayland and use that to translates GDK event times to gecko timestamps.

MozReview-Commit-ID: LWd2KWTQeha

--HG--
extra : rebase_source : 1839d35989b9c29c60dd33d445db79afc75af9ab
2017-10-19 15:28:47 +02:00
Hiroyuki Ikezoe
12c6f62e78 Bug 1379564 - Make BaseTimeDuration::Forever() constexpr. r=birtles
MozReview-Commit-ID: DFse9SD1taP

--HG--
extra : rebase_source : a23d92c8b959c7f680b06c223e266ff1646813b0
2017-07-10 16:21:34 +09:00
Honza Bambas
581d528607 Bug 1406386 - Control how TimeStamp works on Windows via and envvar. r=froydnj 2017-10-06 09:16:00 -04:00
Nicholas Nethercote
a6fede36c2 Bug 1384814 - Remove critical address machinery from Mac implementation of MozStackWalk(). r=glandium.
It seemingly hasn't been needed since Mac OS 10.7. A diagnostic assertion that
has been in place for a while hasn't caught any uses of it.

--HG--
extra : rebase_source : 9834849eec9174267c7df8de7fd22840ffa36d8f
2017-10-03 13:53:14 +11:00
Masatoshi Kimura
e34560fbbc Bug 1391696 - Use GetTickCount64 without a GetProcAddress check in Timestamp_windows.cpp. r=froydnj
MozReview-Commit-ID: 7rkorGQKCOw

--HG--
extra : rebase_source : ff797855d7206e2efa9523591f6d57c8319ed984
2017-08-19 03:08:11 +09:00
Nathan Froyd
2fff1c679f Bug 1388807 - fix StackWalk.h documentation; r=keeler
We use C++ constructs in this file, we shouldn't advertise C
compatibility in the comments.
2017-08-11 15:15:31 -04:00
Eric Rahm
fe18bf0131 Bug 1386825 - Part 4: Remove remaining instances of MOZ_B2G. r=froydnj
MozReview-Commit-ID: 8r4eMwiZ4Vg
2017-08-08 14:41:09 -07:00
Nicholas Nethercote
406a9ed175 Bug 1384819 (part 3) - Remove the return value from the stack walker functions. r=glandium.
Just one caller (in DMD) actually looks at it, and that's in an unimportant way
-- if the return value was false, mLength would be zero anyway.

--HG--
extra : rebase_source : 0463ab3765744742a9e854964342d631095fa55f
2017-07-27 16:46:55 +10:00
Nicholas Nethercote
8a20eb82d2 Bug 1384819 (part 2) - Tweak FramePointerStackWalk() arguments. r=glandium.
This patch does he following.

- Avoids some unnecessary casting.

- Renames the |bp| parameter as |aBp|.

- Makes the no-op FramePointerStackWalk() signature match the real one.
  (Clearly it's dead code in all built configurations!)

--HG--
extra : rebase_source : 3fe606d1ff9b063294f4028ff884c20661ed9e0a
2017-07-27 16:46:33 +10:00
Nicholas Nethercote
08e54b7c13 Bug 1384819 (part 1) - Split MozStackWalk(). r=glandium.
MozStackWalk() is different on Windows to the other platforms. It has two extra
arguments, which can be used to walk the stack of a different thread.

This patch makes those differences clearer. Instead of having a single function
and forbidding those two arguments on non-Windows, it removes those arguments
from MozStackWalk, and splits off MozStackWalkThread() which retains them. This
also allows those arguments to have more appropriate types (HANDLE instead of
uintptr_t; CONTEXT* instead of than void*) and names (aContext instead of
aPlatformData).

The patch also removes unnecessary reinterpret_casts for the aClosure argument
at a couple of MozStackWalk() callsites.

--HG--
extra : rebase_source : 111ab7d6426d7be921facc2264f6db86c501d127
2017-07-27 12:46:47 +10:00
Nicholas Nethercote
7709e79b50 Bug 1384814 - Add a diagnostic assertion to detect any use of the critical address machinery. r=glandium.
It appears to be unused, but it would be good to have some real-world data to
confirm this. A diagnostic assertion is a better choice for this than a
telemetry problem because stack-walking is such a low-level operation.

--HG--
extra : rebase_source : 1ebb96c5cce1b4a1c7ed09182c095af1b44a0f31
2017-07-27 17:01:09 +10:00
Kartikaya Gupta
37b78eda1b Bug 1384233 - Update documentation for the %I format specifier in Printf.h. r=froydnj
MozReview-Commit-ID: 5bxCGKYrXFI

--HG--
extra : rebase_source : de32c96981abd05f72cd408d9489d2a83adcc1cb
2017-07-26 16:22:58 -04:00
Kartikaya Gupta
ba4b3b9101 Bug 1384233 - Remove SizePrintfMacros.h. r=froydnj
We have a minimum requirement of VS 2015 for Windows builds, which supports
the z length modifier for format specifiers. So we don't need SizePrintfMacros.h
any more, and can just use %zu and friends directly everywhere.

MozReview-Commit-ID: 6s78RvPFMzv

--HG--
extra : rebase_source : 009ea39eb4dac1c927aa03e4f97d8ab673de8a0e
2017-07-26 16:03:57 -04:00
Nicholas Nethercote
2a4f265a62 Bug 1381727 (part 2) - Remove SmprintfFree(). r=glandium.
It's just a complex wrapper for free(), or equivalent function. (In practice,
all the uses end up in free().)

--HG--
extra : rebase_source : 247ea8458aa57319bd1c8366115a9b4f39ed5a33
2017-07-25 09:09:25 +10:00
Sylvestre Ledru
7c0ae251cd Bug 1381253 - Remove redundant control flow declarations rs=ehsan
MozReview-Commit-ID: FFxP4aMCbOL

--HG--
extra : amend_source : 3aec108430b11048f47ffe19d5da7ac5034770a9
2017-07-15 19:03:04 +02:00
Nicholas Nethercote
76360b4793 Bug 1382099 - Remove MOZ_WIDGET_GONK from mozglue/. r=glandium.
--HG--
extra : rebase_source : be872a2272b731523fdad5ee52ffcd40d87729c5
2017-07-19 18:38:54 +10:00
Tom Ritter
70e18ce213 Bug 1377605 Cast -1 to DWORD to correctly match the error return value given by SuspendThread r=aklotz
MozReview-Commit-ID: 5XHgkpQJQKY

--HG--
extra : rebase_source : 92d963e3415840eebbe47bf835ec6fb20489d908
2017-07-03 16:07:25 -05:00
Tom Ritter
2d28a5e8de Bug 1377607 Cast int to unsigned to silence an error about signed vs unsigned comparisons r=froydnj
MozReview-Commit-ID: Op3tiipqcr

--HG--
extra : rebase_source : 5a6e6cf7d13eb5fc83420f373f7c1c445012768b
2017-06-30 19:32:33 -05:00
Eric Rahm
480a72812d Bug 1371435 - Backed out changeset 5b6d169feb92. r=froydnj
CRITICAL_SECTIONs have useful debug info that we'd like to keep around at least
on nightly, rather than having diverging signatures on crash stats we'd like to
just keep a unified implementation. As we didn't see significant perf
improvements after landing we're going to just back this out.
2017-06-28 13:56:57 -07:00
Nicholas Nethercote
4b364cf3f3 Bug 1375299 (part 1) - Reduce usage of MOZ_GECKO_PROFILER. r=mstange.
This patch reduces the differences between builds where the profiler is enabled
and those where the profiler is disabled. It does this by removing numerous
MOZ_GECKO_PROFILER checks.

These changes have the following consequences.

- Various functions and classes are now defined in all builds, and so can be
  used unconditionally: profiler_add_marker(), profiler_set_js_context(),
  profiler_clear_js_context(), profiler_get_pseudo_stack(), AutoProfilerLabel.
  (They are effectively no-ops in non-profiler builds, of course.)

- The no-op versions of PROFILER_* are now gone. The remaining versions are
  almost no-ops when the profiler isn't built.

--HG--
extra : rebase_source : 8fb5e8757600210c2f77865694d25162f0b7698a
2017-06-22 06:26:16 +10:00
Honza Bambas
e5332cb32b Bug 1345939 - Protect TimeStamp::Now() from going backwards on hardware with non-stable TSC. r=nfroyd 2017-06-13 05:12:00 -04:00
David Major
af0b39fef9 Bug 1372375: Avoid locks in EnsureWalkThreadReady during the profiler's critical section. r=mstange
EnsureWalkThreadReady takes two locks, one in _beginthreadex and another in the DLL hook setup.

We can avoid the first by not calling EnsureWalkThreadReady if we're walking a suspended thread, since we won't be using a separate WalkThread anyway.

To avoid the hook locks, I gave in and decided to go back to setting up the hooks in DllBlocklist_Initialize as originally planned.
2017-06-13 18:30:48 -04:00
Nicholas Nethercote
aab625999f Bug 1370329 (part 2) - Add support for profiler labels in mozglue. r=mstange,glandium.
Profiler labels can't currently be used in mozglue, because the profiler's code
is in libxul, and mozglue cannot depend on libxul.

This patch addresses this by basically duplicating AutoProfilerLabel in
mozglue. libxul passes two callback functions to mozglue to do the actual
pushing/popping of labels.

It's an annoying amount of machinery, but it is unavoidable if we want to use
profiler labels within mozglue.

--HG--
extra : rebase_source : 4bcb6fb0f050bba42c23d92d01f9c56611f8518f
2017-06-07 12:36:26 +10:00
Masayuki Nakano
94170bb269 Bug 1370198 Back out the patch for bug 1369419 because the patch couldn't fix bug 1361132 and causes new crash bugs r=jimm
MozReview-Commit-ID: Eq7Dkk6Ghwc

--HG--
extra : rebase_source : edc2d10f4e0359152927830a269f74b75daf5883
2017-06-05 21:52:16 +09:00
Masayuki Nakano
d3789d2d6b Bug 1369419 GetMessage() and PeekMessage() shouldn't be used directly as far as possible r=jimm
In TSF mode, application should retrieve messages with ITfMessagePump::GetMessage() or ITfMessagePump::PeekMessage() since TSF/TIP may handle the message before or after the host application handles it.

This patch rewrites the API users with WinUtils::(Get|Peek)Message() which use ITfMessagePump if it's available.

MozReview-Commit-ID: LwHIgp7SxLH

--HG--
extra : rebase_source : aa5750af9812f9b107c29546cbee6f9eede6ebfa
2017-06-02 12:02:35 +09:00
David Major
89f6d51919 Bug 1180561 - Intercept msmpeg2vdec's JIT unwind callback on Win7 x64. r=aklotz
So we can avoid stack-walking their JIT code. They don't have unwind information so their callback just kills the process.
2017-05-18 16:15:29 -04:00
Eric Rahm
d85538bec8 Bug 1364624 - Switch from CRITICALSECTION to SRWLOCK. r=froydnj
MozReview-Commit-ID: 6JpGEQyUFz
2017-05-17 15:44:20 -07:00
David Major
ce4248324c Bug 1365415: No need to hook LdrResolveDelayLoadedAPI on Win7, it doesn't exist. r=mstange
--HG--
extra : rebase_source : 3ba5eee05ca2bf7e50e6c8fb1fd29a8e4ab32686
2017-05-17 15:26:13 -04:00
Tom Tromey
21816ce4f3 Bug 1334276 - add Printf unit tests; r=froydnj
Add unit tests for Printf.  Code coverage now at 90%.  Doing better is
difficult due to the large number of assertions and failure cases, and
because some remaining untested code implements behavior undefined by
the spec, for example "%0s".

MozReview-Commit-ID: FenOur7bOt2

--HG--
extra : rebase_source : 4a399743e87912d8a72a8607dd520e676785f52d
2017-05-08 13:49:48 -06:00
Tom Tromey
62fa1c54e6 Bug 1334276 - remove dead code from Printf.cpp; r=froydnj
This removes some "#if 0"s, and some related code that is also obviously
dead.

MozReview-Commit-ID: 1vEPohvdpw8

--HG--
extra : rebase_source : b7a1c08c422f0aae6538db03331773f31be33ac6
2017-05-08 11:05:27 -06:00
Tom Tromey
aa6e054b71 Bug 1334279 - mark vsprintf-likes with MOZ_FORMAT_PRINTF; r=froydnj
This annotates vsprintf-like functions with MOZ_FORMAT_PRINTF.  This may
provide some minimal checking of such calls (the GCC docs say that it
checks for the string for "consistency"); but in any case shouldn't
hurt.

MozReview-Commit-ID: HgnAK1LiorE

--HG--
extra : rebase_source : 9c8d715d6560f89078c26ba3934e52a2b5778b6a
2017-05-04 12:10:19 -06:00
David Major
b01d2b3925 Backed out changeset 0e572861c2dc for contributing to bug 1361901. 2017-05-04 15:58:12 -04:00
David Major
f4a3991d16 No bug - fix variable spelling. DONTBUILD
--HG--
extra : rebase_source : c46bd7e65d1bd36834e9376079b7cc914c026f01
2017-05-04 14:29:55 -04:00
David Major
144694720e Bug 1355559: Suppress stack walking in LdrResolveDelayLoadedAPI. r=mstange,aklotz 2017-05-03 23:26:47 -04:00
David Major
17f4d62f9b Bug 1349444: Suppress stack walking in LdrUnloadDll. r=mstange,aklotz,froydnj 2017-05-03 17:13:31 -04:00
David Major
eeaa91fc5c Bug 1359507: Replace the stack walk workaround lock with an atomic counter of suppressions. r=mstange,froydnj
This fixes a deadlock by removing one of the two sides of a mutual-wait.
2017-05-03 12:10:48 -04:00
David Major
e0e90b1235 Bug 1180561: Abort stack walking if we reach a frame inside msmpeg2vdec. r=njn 2017-05-02 09:28:17 -04:00
David Major
33bad54a1c Bug 1358251: EnsureSymInitialized doesn't need to EnsureWalkThreadReady. r=mstange
--HG--
extra : rebase_source : d81dabe40ff11bce3586df0edfaccd8fa9da1e28
2017-05-01 15:34:50 -04:00
Wes Kocher
c90904f9bf Merge inbound to central, a=merge CLOSED TREE
MozReview-Commit-ID: 9HQViJrDT6S
2017-04-26 17:30:31 -07:00
Nicholas Nethercote
bc1d6a21a2 Bug 1358320 - Make TimeStamp::ProcessCreation()'s outparam optional. r=gsvelto.
TimeStamp::ProcessCreations()'s aIsInconsistent outparam is ignored by the
majority of its caller. This patch makes it optional. Notably, this makes
ProcessCreation() easier to use in a constructor's initializer list.
2017-04-26 14:55:54 +10:00