Commit Graph

799 Commits

Author SHA1 Message Date
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
Ehsan Akhgari
0b42833bd8 Bug 1370329 (part 3) - Add a Gecko Profiler label to patched_LdrLoadDll(). r=mstange.
This lets us easily identify the name of the DLL being loaded in a profile.

--HG--
extra : rebase_source : 9910910e573e5ddbad81fe1f9792a07807b074cb
2017-06-07 12:37:18 +10: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
Tom Ritter
8407066758 Bug 1365047 Turn on the Windows DLL Blocklist in MinGW r=aklotz
MozReview-Commit-ID: 3hF7iOdH89P

--HG--
extra : rebase_source : 95614960544ae55b983dbbd40e1036ff236204b3
2017-05-15 15:49:20 -05: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
Carl Corcoran
d984e671a7 Bug 1322554: Interpose kernel32!BaseThreadInitThunk to add verification of thread start addresses; r=aklotz,dmajor
MozReview-Commit-ID: 8Jm1PXyRrEr

--HG--
extra : rebase_source : 1145dfccaca72b58145f0100a4e313d1c9d685be
2017-05-24 11:56:40 +02: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
David Major
44b9e8090f Bug 1180561 - Cleanup - Remove the DLL blocklist's anonymous namespace. r=aklotz
It makes it really annoying to set breakpoints on patched_LdrLoadDll.
2017-05-18 16:05:32 -04:00
Carsten "Tomcat" Book
24c443a440 merge mozilla-inbound to mozilla-central a=merge 2017-05-18 14:19:18 +02:00
Iris Hsiao
0bbdca7c50 Merge mozilla-central to autoland
--HG--
rename : memory/mozjemalloc/jemalloc.c => memory/mozjemalloc/mozjemalloc.cpp
2017-05-18 14:15:19 +08: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
Jim Chen
8dd6064fc9 Bug 1360321 - 4e. Fix std::min type error; r=froydnj r=glandium
Specify the same type for std::min arguments to avoid the error.

MozReview-Commit-ID: C7yHu7c1s34
2017-05-17 13:06:22 -04:00
Jim Chen
7752e253ee Bug 1360321 - 4d. Define mmap ordering for AArch64; r=froydnj r=glandium
Specify mmap address ordering for AArch64 so we properly allocate buffer
pages.

MozReview-Commit-ID: 4vGztSsAaXm
2017-05-17 13:06:22 -04:00
Jim Chen
8057a25813 Bug 1360321 - 4c. Add Divert case for AArch64; r=froydnj r=glandium
Fill in AArch64 trampoline for Divert(). Even though we're not using
on-demand decompression anymore, I added the AArch64 cases for
completeness.

MozReview-Commit-ID: D91KhHiDo7S
2017-05-17 13:06:22 -04:00
Jim Chen
e1831b091f Bug 1360321 - 4b. Add relocation macros for AArch64; r=froydnj r=glandium
Add relocation macros for AArch64 in the custom linker.

MozReview-Commit-ID: 4TKtVJdq0is
2017-05-17 13:06:22 -04:00
Jim Chen
f5f1f202b1 Bug 1360321 - 4a. Fix printf macro mismatches in mozglue; r=froydnj r=glandium
Fix printf macro mismatches where, for example, `PRIxPTR` is defined for
`long` but the ELF `Addr` type is defined as `long long`.

MozReview-Commit-ID: 8hXY1MpHPjS
2017-05-17 13:06:22 -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
Mike Hommey
0400284f88 Bug 1365194 - Make extern "C" part of MOZ_MEMORY_API and MOZ_JEMALLOC_API. r=njn
This avoids many additions of `extern "C"` in C++ code and will avoid
having to do the same to mozjemalloc once built as C++.

--HG--
extra : rebase_source : af55696262f40a9dd16a19c29edcb9bb307d4957
2017-05-16 18:46:02 +09:00
Mike Hommey
1a9d4c6f33 Bug 1363992 - Remove support for system jemalloc. r=njn
--HG--
extra : rebase_source : 9141402b6f9e84c67afc14303633d328eb5b652c
2017-05-11 13:03:20 +09:00
Makoto Kato
529993e5f8 Bug 1360429 - Part 2. Detect __ARM_NEON macro for aarch64. r=glandium
aarch64's gcc and arm's gcc with -mfpu=neon defines __ARM_NEON for NEON, so we should detect it to support NEON code.

MozReview-Commit-ID: LRMTQLctuLV

--HG--
extra : rebase_source : 9e09eb9b67824c81dc45198acd6582584a5e1652
2017-04-28 13:27:10 +09:00
Julian Seward
83969e88eb Bug 1361258 - Add a jemalloc_thread_local_arena API with a binding for rust. r=glandium
The intent of the API is to allow threads to opt-in to use a separate
mozjemalloc arena.

This indroduces a dummy shell with no actual implementation.
2017-05-12 18:08:08 +09:00
Aaron Klotz
831876bb4f Bug 1363844: Add CHILD_PROCESSES_ONLY flag to Windows DLL blocklist; r=dmajor
MozReview-Commit-ID: f9ej2Hp0DF
2017-05-11 15:50:10 -06: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
Franziskus Kiefer
9fda03a207 Bug 1359333 - detect aes-ni support, r=froydnj
MozReview-Commit-ID: 4cCVIntG9bD

--HG--
extra : rebase_source : 4e6d7450fa06417c3ab29e6c104f433e43c72df6
2017-03-31 18:59:56 +02:00
Eugen Sawin
488dedcdc0 Bug 1361903 - [1.0] Move assertion to prevent accessing this after destruction. r=glandium 2017-05-09 15:30:05 +02: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
Marco Castelluccio
295cdafff7 Bug 1233556 - Block injection of nahimicmsiosd.dll, as it can cause crashes. r=bsmedberg
--HG--
extra : rebase_source : 8adb22c6ddc15e1f2a45b8e470774ef91efee753
2017-05-04 11:15:26 +02: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
philipp
f939196196 Bug 1333486 - Add idmcchandler5.dll/idmcchandler5_64.dll to the blocklist. r=marco 2017-04-28 08:44:00 -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
Wes Kocher
675c0065d0 Backed out changeset 31d1116ced93 (bug 1349444) for assertions on Windows a=backout
MozReview-Commit-ID: 4dOhE2GADv3
2017-04-25 15:52:10 -07:00
Wes Kocher
bb10f1e55f Backed out changeset 5b18b53232b8 (bug 1355559) for assertions on Windows
MozReview-Commit-ID: G2UXc5l6b2T
2017-04-25 15:51:33 -07:00
Wes Kocher
bf1d6ef1c2 Backed out changeset 8868bb11e7a8 (bug 1358251) for assertions on Windows
MozReview-Commit-ID: Laffk7TtWgP
2017-04-25 15:50:52 -07:00
David Major
23f65c763c Bug 1358251: EnsureSymInitialized doesn't need to EnsureWalkThreadReady. r=mstange 2017-04-25 16:10:14 -04:00
David Major
27bac27c90 Bug 1355559: Acquire the stack walk workaround lock in LdrResolveDelayLoadedAPI. r=mstange 2017-04-25 16:10:14 -04:00
David Major
5be9ebe23b Bug 1349444: Take the stack walk workaround lock in LdrUnloadDll. r=mstange
This will prevent the profiler from suspending a target thread while that thread holds the RtlLookupFunctionEntry lock, which the profiler itself also wants to use.
2017-04-25 16:10:14 -04:00
Eugen Sawin
c281414151 Bug 1358241 - [2.1] Add mutex locking around the library handles cache. r=jchen 2017-04-25 18:05:06 +02:00
Eugen Sawin
84b446b09c Bug 1358241 - [1.2] Make direct library reference counter atomic to avoid mutex locking issues. r=jchen 2017-04-25 18:05:06 +02:00
Tom Tromey
99f4608655 Bug 1334278 - change mozilla::Smprintf to return a UniquePtr; r=froydnj
Change mozilla::Smprintf and friends to return a UniquePtr, rather than
relying on manual memory management.  (Though after this patch there are
still a handful of spots needing SmprintfFree.)

MozReview-Commit-ID: COa4nzIX5qa

--HG--
extra : rebase_source : ab4a11b4d2e758099bd0794d5c25d799a7e42680
2017-03-03 08:17:27 -07:00
Carsten "Tomcat" Book
9c3f61e278 Backed out changeset b56224bf370d (bug 1365194) 2017-05-17 11:43:26 +02:00