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

827 Коммитов

Автор SHA1 Сообщение Дата
Brian Murray 9cd396d183 Bug 1380204: Improve error handling in XZStream.cpp r=glandium
Report init failure if uncompressed stream size is 0.
Check for overflows when casting.
Verify LZMA stream only has a single block.
Detailed error logging.
MozReview-Commit-ID: DZ4cWGxAzkw

--HG--
extra : rebase_source : da66646c78e7947ffcf2325ad5bd0de9205506bf
2017-07-11 17:45:07 -07:00
Carl Corcoran 5c4000df9d Bug 1361410: Don't hook BaseThreadInitThunk when WRusr.dll is loaded, mitigating a crash; r=dmajor
MozReview-Commit-ID: KqWq2bHT0CE

--HG--
extra : rebase_source : 54292be2efe4d50ec5806c1d066eb34ac97ecf14
2017-08-17 15:05:17 +02: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
Jim Chen e16afc583e Bug 1384828 - Use tid for UI thread detection; r=esawin
Use the UI thread's tid for checking if we're on the UI thread in Gecko.
This lets us get rid of `GeckoThread.registerUiThread`, in order to
avoid a race where we check for UI thread before `registerUiThread` is
called.

MozReview-Commit-ID: 11gAWgx4UZo
2017-08-03 13:06:16 -04: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 0591f401da Bug 1380103 Cast a DWORD (__attribute__((__stdcall__)) *)(void*) to a bare void* to fix a compiler error r=ccorcoran,dmajor
MozReview-Commit-ID: 88e6e2w5Gd1

--HG--
extra : rebase_source : 4011d6d4261c83517d54ea5c4bf08ba54a77fd0c
2017-07-11 14:26:35 -05:00
John Lin c62cf1bde1 Bug 1374556 - use Android-like signal handlers instead of SIG_DFL. r=glandium
For some reason the remote decoder process will crash on some x86/Android M devices when SIGSEGV is handled by SIG_DFL. To avoid this issue and continue suppressing crash dialog, capture the signals with Android like handlers and strip debuggerd related code.

MozReview-Commit-ID: 3diOGc3OInD

--HG--
extra : rebase_source : 42017c10d13c30880f80c81b0d7487bb0d05fd44
2017-07-10 14:44:50 +08:00
Sylvestre Ledru 4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02:00
Mike Hommey ed863255b4 Bug 1378592 - Remove MOZ_REPLACE_MALLOC_LINKAGE. r=froydnj
MOZ_REPLACE_MALLOC_LINKAGE was added back when there were problems with
getting weak references working properly for replace-malloc.

Versions of OSX < 10.6 needed flat namespace, but aren't supported
anymore.

Versions of Xcode < 4.5 required flat namespace + a dummy library in
order to produce proper weak references. There is virtually nobody still
building with such an ancient toolchain.

Keeping those around doesn't /really/ hurt, except recent versions of
Xcode don't expose dyldinfo in /usr/bin, used for the configure test.
Consequently, MOZ_REPLACE_MALLOC_LINKAGE ended up being set to use the
dummy library setup, which, by using flat namespace, now causes harm in
bug 1356701, causing bug 1378332.

--HG--
extra : rebase_source : e3edc1f2cf905943c33fafeb631f2f88fc87167e
2017-07-06 10:26:04 +09: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
David Major 8f2fab9547 Bug 1378442 - Move Win64 profiler hooks to profiler_start. r=mstange 2017-07-05 18:45:31 -04: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
Nicholas Nethercote 3e439bb4f8 Bug 1376638 - Minimize uses of prmem.h. r=glandium.
It's silly to use prmem.h within Firefox code given that in our configuration
its functions are just wrappers for malloc() et al. (Indeed, in some places we
mix PR_Malloc() with free(), or malloc() with PR_Free().)

This patch removes all uses, except for the places where we need to use
PR_Free() to free something allocated by another NSPR function; in those cases
I've added a comment explaining which function did the allocation.

--HG--
extra : rebase_source : 0f781bca68b5bf3c4c191e09e277dfc8becffa09
2017-06-30 19:05:41 -07:00
Eugen Sawin b3685a6ef3 Bug 1318247 - [1.0] Add custom refcounting of zips in ZipCollection to allow for thread-safe reuse of zips. r=glandium 2017-06-30 10:47:29 -07:00
Mike Hommey df3ab76c5a Bug 1375859 - Build zlib in libmozglue when the linker in enabled. r=mshal
The linker uses zlib. The linker is in mozglue, zlib is in libxul by
default. As a consequence, we made --with-system-zlib a requirement for
builds enabling the linker.

In the meanwhile, we added an option that makes zlib built in mozglue
for different needs, which, in fact, also allows to do that when the
linker is enabled.

So, allow to build without system zlib when the linker is enabled.

--HG--
extra : rebase_source : 873a87b17b306fc392018049e01cf794b63a6206
2017-06-28 03:57:36 +09:00
Mike Hommey 8022e9e91e Bug 1376704 - Remove szip support in the linker. r=snorp
Since bug 1307886, we don't actually use szip anymore, and don't even
have the option to package Fennec using it. We can thus remove the
support for loading them, as well as on demand linkage.

The latter might mean we can remove the segfault handler, but it's
unclear whether this is currently working around other issues with
registering signal handlers, so we'll leave that to a followup.

--HG--
extra : rebase_source : ec23cd4e78f259a70f6690adc8dfabb557e8f304
2017-06-28 15:47:31 +09: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
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