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

948 Коммитов

Автор SHA1 Сообщение Дата
Aaron Klotz 1eec067d63 Bug 1437309: Delayload crypt32 and wintrust in mozglue; r=glandium 2018-02-12 12:17:36 -07:00
Alex Gaynor de20b74dc4 Bug 1407693 - Part 2 - when a child process crashes, write extra annotation data to a pre-opened file descriptor instead of creating a new file; r=gsvelto,rbarker
This removes the need for the content process to have permissions to create new
files on macOS, allowing more aggressive sandboxing.

MozReview-Commit-ID: 8agL5jwxDSL

--HG--
extra : rebase_source : 17ebcef3e9d24f3d4e7515e3fae95e65cef76a79
2017-11-27 14:37:34 -06:00
Aaron Klotz 1beac92cc2 Bug 1430857: Part 2 - Add cert annotations to Windows crash reports; r=mhowell
MozReview-Commit-ID: 270iURVhNRu

This patch builds upon the existing DLL services functionality:

1) We add code to obtain the name of the subject from the cert used to sign a
   binary (if present). This code is added inside mozglue because in the future
   we will be using this code from the DLL blocklist, which is also located
   there.
2) We add annotation functionality that registers itself for DLL load events
   and updates crash reporter annotations as new libraries are loaded. It also
   annotates any existing libraries that are also in memory at the time that the
   CertAnnotator is first instantiated. This all happens off main thread, with
   the exception of actually making the annotation when in a child process.

--HG--
extra : rebase_source : 2e3726d37356479aee81915caed04fe7af74c815
2018-01-30 15:08:03 -07:00
Aaron Klotz 0213e8a4b6 Bug 1430857: Part 1 - Refactor DllServices to make it possible to obtain them from anywhere in Gecko; r=jimm
MozReview-Commit-ID: GfWata0eCc5

--HG--
extra : rebase_source : f280fec92c867d0adbe7b82c0e829eeb10fce5a9
2018-01-30 14:23:10 -07:00
Dorel Luca 112cc1ff6b Backed out 3 changesets (bug 1430857) for breaking tests on Windows Code Coverage builds a=backout
Backed out changeset a992887a6060 (bug 1430857)
Backed out changeset cc9b0ac5f66b (bug 1430857)
Backed out changeset 4bdd6d82f993 (bug 1430857)
2018-02-07 15:02:58 +02:00
Aaron Klotz e398eaca79 Bug 1430857: Part 2 - Add cert annotations to Windows crash reports; r=mhowell
MozReview-Commit-ID: 270iURVhNRu

This patch builds upon the existing DLL services functionality:

1) We add code to obtain the name of the subject from the cert used to sign a
   binary (if present). This code is added inside mozglue because in the future
   we will be using this code from the DLL blocklist, which is also located
   there.
2) We add annotation functionality that registers itself for DLL load events
   and updates crash reporter annotations as new libraries are loaded. It also
   annotates any existing libraries that are also in memory at the time that the
   CertAnnotator is first instantiated. This all happens off main thread, with
   the exception of actually making the annotation when in a child process.

--HG--
extra : rebase_source : f86c1a6fd2a44f21a71e7a7418267b3b0d5feeec
2018-01-30 15:08:03 -07:00
Aaron Klotz 200eb77750 Bug 1430857: Part 1 - Refactor DllServices to make it possible to obtain them from anywhere in Gecko; r=jimm
MozReview-Commit-ID: GfWata0eCc5

--HG--
extra : rebase_source : 3a5b4a6f0412311f0b9080a2b3b3a31e45d15b75
2018-01-30 14:23:10 -07:00
Gurzau Raul c104d865cc Backed out 2 changesets (bug 1430857) for build bustage on a CLOSED TREE
Backed out changeset b12ea04f9c5a (bug 1430857)
Backed out changeset 6b88557d1e50 (bug 1430857)
2018-02-06 23:27:33 +02:00
Aaron Klotz 5f9a96be9c Bug 1430857: Part 2 - Add cert annotations to Windows crash reports; r=mhowell
MozReview-Commit-ID: 270iURVhNRu

This patch builds upon the existing DLL services functionality:

1) We add code to obtain the name of the subject from the cert used to sign a
   binary (if present). This code is added inside mozglue because in the future
   we will be using this code from the DLL blocklist, which is also located
   there.
2) We add annotation functionality that registers itself for DLL load events
   and updates crash reporter annotations as new libraries are loaded. It also
   annotates any existing libraries that are also in memory at the time that the
   CertAnnotator is first instantiated. This all happens off main thread, with
   the exception of actually making the annotation when in a child process.

--HG--
extra : rebase_source : e032ee8c4cf71e5225b51797443764549f4bbe56
2018-01-30 15:08:03 -07:00
Aaron Klotz eb3453b4d6 Bug 1430857: Part 1 - Refactor DllServices to make it possible to obtain them from anywhere in Gecko; r=jimm
MozReview-Commit-ID: GfWata0eCc5

--HG--
extra : rebase_source : d8d2ec74e7f452cb1e8b5430f4445f3b0fc9181a
2018-01-30 14:23:10 -07:00
Tom Ritter 6d070e11bd Bug 1235982 Add CFG to firefox.exe and mozglue, and a mochitest to ensure a crash r=glandium,mconley
MozReview-Commit-ID: EYKgDyGtw8m

--HG--
extra : rebase_source : 76166d4fca452674d0a442778290e40106ce339c
2018-01-25 12:15:40 -06:00
Jim Chen 1f4f8416df Bug 1428182 - 3. Only include <linux/elf.h> for non-unified headers; r=glandium
Unified headers have a complete <elf.h> so we should include that
instead of <linux/elf.h>.

MozReview-Commit-ID: DkQv2vk1Q62

--HG--
extra : rebase_source : 7cd9eb04532c14b1dd0dc8747448b89d16e4f118
2018-01-30 14:08:22 -05:00
Cosmin Sabou c6a0d55423 Backed out 11 changesets (bug 1428182) for build bustages on pixman-inlines.h:29:10 on a CLOSED TREE
Backed out changeset 84c767de6202 (bug 1428182)
Backed out changeset 429433caa78c (bug 1428182)
Backed out changeset c576e9d1f68f (bug 1428182)
Backed out changeset 092662eab5eb (bug 1428182)
Backed out changeset 4dd7eaff3ab5 (bug 1428182)
Backed out changeset fbbb0745b139 (bug 1428182)
Backed out changeset 1d1278b289b7 (bug 1428182)
Backed out changeset 55891ffb3768 (bug 1428182)
Backed out changeset 4655e1b1b237 (bug 1428182)
Backed out changeset 377eada51b3c (bug 1428182)
Backed out changeset 17c0e373d921 (bug 1428182)

--HG--
rename : ipc/chromium/src/third_party/libevent/patches/android-api-level.patch => ipc/chromium/src/third_party/libevent/patches/android-arc4random-buf.patch
2018-01-30 01:22:33 +02:00
Jim Chen 3e76d4e233 Bug 1428182 - 3. Only include <linux/elf.h> for non-unified headers; r=glandium
Unified headers have a complete <elf.h> so we should include that
instead of <linux/elf.h>.

MozReview-Commit-ID: DkQv2vk1Q62

--HG--
extra : rebase_source : 43b3fa15042246d2c3ec37a3ca904822b0f68d0c
2018-01-29 17:38:13 -05:00
Mike Hommey d76723e154 Bug 1433273 - Remove mozglue/linker/dladdr.h. r=froydnj
It was added in bug 683127 as a forced include for nspr, and
accidentally became unused after bug 1230117, but it turns out that all
versions of Android we care about nowadays (and probably back then) now
support dladdr.

--HG--
extra : rebase_source : 024244627c215de2d35e2f4595b7612eb1723996
2018-01-26 06:21:30 +09:00
Mike Hommey 5e48214af2 Bug 1414506 - Use system dl_iterate_phdr for system loaded libraries when we can. r=froydnj
When looping through the debugger helper links during our
dl_iterate_phdr implementation, we effectively race with other threads
dlclose()ing libraries while we're working.

We do have a (rather involved) check in place to ensure that elf headers
are readable. But it turns out in practice, some dlclose() do happen
between the check and the actual read of the elf headers.

Unfortunately, we can't lock the system linker while we're looping, so a
better approach is to only loop through the libraries we loaded, and
rely on the system dl_iterate_phdr to iterate over the (remaining)
system libraries.

Unfortunately (again), Android versions < 5.0 don't have a system
dl_iterate_phdr, so we have to rely on the old iterator when it's not
present.

--HG--
extra : rebase_source : 3fd07589ed1939411ef72f481b7c72f761d53701
2018-01-23 15:59:18 +09:00
Mike Hommey 76f5fcdbab Bug 1414506 - Move dl_phdr_info filling and callback invocation to a separate class. r=froydnj
We're going to introduce two code paths that need to fill dl_phdr_info
from different iterators, so first move the code to a separate class,
that both code paths will be able to call.

--HG--
extra : rebase_source : a50663ad8d15d4f7a28d7138824003df5edd7f1c
2018-01-23 15:50:38 +09:00
Mike Hommey 2d8f41393f Bug 1414506 - Drive-by: Remove MOZ_CONCAT definition from mozglue/linker/Logging.h. r=froydnj
The same exists in mozilla/MacroArgs.h, avoiding a macro redefined warning
when building on non-Android.

--HG--
extra : rebase_source : 6e3502ddf9deb96b29e3663f5867f852a2912401
2018-01-19 20:12:04 +09:00
Mike Hommey 73673fc86e Bug 1414506 - Drive-by: Add missing <cstring> include to XZStream.cpp. r=froydnj
--HG--
extra : rebase_source : 25942242d9e2cb1ccc1e18f06635218dfc894637
2018-01-19 20:08:08 +09:00
Philip Chimento 6b52ba7b8d Bug 1176787 - Always link mozglue into the shared library when building standalone. r=glandium
Regardless of which platform we are building on.

--HG--
extra : rebase_source : b10b6b7127e8ed86e9c19f4cba9d54fd2f02f99f
2018-01-15 13:57:03 -08:00
Aaron Klotz 35b1027e2c Bug 1423999: Improved UIA detection that eliminates handle duplication; r=Jamie
MozReview-Commit-ID: 5CqjkyDoPs8

--HG--
extra : amend_source : 877a3d6cadab0645274c9542249fc35cfd682d41
2017-12-07 12:13:14 -07:00
Sylvestre Ledru 9bfe27d903 Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium
MozReview-Commit-ID: 7duJk2gSd4m

--HG--
extra : rebase_source : 7312fe276e561e8c034a5f6749774ae812727f9c
2017-12-07 22:09:15 +01:00
Aaron Klotz 0f6431e1f3 Bug 1422394: Add a mechanism to report dll loads to an observer; r=jimm
MozReview-Commit-ID: 1ocag6jTBVV
2017-12-04 18:08:17 -07:00
Brindusan Cristian 14add183dc Backed out 2 changesets (bug 1422394) for browser-chrome failure in test_headless_screenshot.html on Windows 7 debug non-e10s r=backout a=backout on a CLOSED TREE
Backed out changeset 8f233446cd06 (bug 1422394)
Backed out changeset 96940dc4db44 (bug 1422394)
2017-12-05 23:49:08 +02:00
Aaron Klotz 7abd7674c8 Bug 1422394: Follow-up: Add missing include to fix mingw bustage; r=bustage 2017-12-05 13:00:05 -07:00
Aaron Klotz 9da53d8e93 Bug 1422394: Add a mechanism to report dll loads to an observer; r=jimm
--HG--
extra : rebase_source : ddd40aa520447fea1bdccdbe8208bb3bfd26afe7
2017-12-04 18:08:17 -07:00
Christian Holler 586ce17728 Bug 1419371 - Set max_malloc_fill_size/max_free_fill_size for ASan. r=glandium
MozReview-Commit-ID: KPng6w8JsHI

--HG--
extra : rebase_source : fcf2aced83cdf73cccb6cf572ca7da3f6a76c515
2017-11-22 13:49:36 +01:00
Julien Cristau e8ea0fb58a Bug 1421991 - Add old versions of G DATA BankGuard .dll to Windows blocklist. r=jimm 2017-11-30 17:37:20 +01:00
Aaron Klotz 010af8a7d8 Bug 1420276: Backed out changeset 244c97bc16e3 since we don't want to ship this yet; r=backout
--HG--
extra : rebase_source : f7376192a23e85f8850ef5b250e35813ef72e0e3
2017-12-04 15:58:20 -07:00
Jim Chen 190f7edde5 Bug 1416940; r=snorp
MozReview-Commit-ID: 7izmybLFG6i
2017-11-28 23:07:52 -05:00
Aaron Klotz 04c107efd4 Bug 1420276: Add uiautomationcore.dll to blocklist; r=Jamie
MozReview-Commit-ID: AIYZfyKm20b

--HG--
extra : amend_source : d49b08f20f7aebb05ff40cd0bf13ccbad0a78c5f
2017-11-23 14:07:59 -07:00
Mike Hommey 32ecc64ada Bug 1420353 - Change how replace-malloc initializes, part 2. r=njn
Because one entry point is simpler than two, we make replace_init fulfil
both the roles of replace_init and replace_get_bridge.

Note this should be binary compatible with older replace-malloc
libraries, albeit not detecting their bridge (and with the
previous change, they do not register anyways). So loading older
replace-malloc libraries should do nothing, but not crash in awful ways.

--HG--
extra : rebase_source : aaf83e706ee34f45cfa75551a2f0998e5c5b8726
2017-11-24 16:02:05 +09:00
Mike Hommey 845f9c5d82 Bug 1420353 - Change how replace-malloc initializes, part 1. r=njn
The allocator API is a moving target, and every time we change it, the
surface for replace-malloc libraries grows. This causes some build
system problems, because of the tricks in replace_malloc.mk, which
require the full list of symbols.

Considering the above and the goal of moving some of the replace-malloc
libraries into mozglue, it becomes simpler to reduce the replace-malloc
exposure to the initialization functions.

So instead of the allocator poking into replace-malloc libraries for all
the functions, we expect their replace_init function to alter the table
of allocator functions it's passed to register its own functions.

This means replace-malloc implementations now need to copy the original
table, which is not a bad thing, as it allows function calls with one
level of indirection less. It also replace_init functions to not
actually register the replace-malloc functions in some cases, which will
be useful when linking some replace-malloc libraries into mozglue.

Note this is binary compatible with previously built replace-malloc
libraries, but because those libraries wouldn't update the function
table, they would stay disabled.

--HG--
extra : rebase_source : 2518f6ebe76b4c82359e98369de6a5a8c3ca9967
2017-11-22 17:24:29 +09:00
Chris Manchester 1877e49bc4 Bug 1411712 - Move symbol version script flags for arm in mozglue to moz.build. r=mshal
MozReview-Commit-ID: II250cfTmip

--HG--
extra : rebase_source : 70a8764e3bb646c54005fb25dc4343fdc201bade
2017-11-02 11:47:48 -07:00
Chris Manchester f8a3e49e93 Bug 1411712 - Make a new variable for LDFLAGS to be set by Makefile.in that aren't intended to be handled by other backends. r=mshal
These flags are only relevant on OS X, and will not be necessary soon, so this
commit moves them to a separate variable while we move the remainder of the
ldflags to mozbuild.

MozReview-Commit-ID: 1NDgz3HIYpT

--HG--
extra : rebase_source : 6e9b5f5a5be5ff916db89a0b73896b9058eb040e
2017-11-02 11:47:47 -07: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
Nathan Froyd c04d322a0a Bug 1412405 - fix isnanf symbol lookup by using a LoadedElf for libm; r=glandium
We already dealt with issues around dlsym not resolving weak symbols
with libc in bug 1081034.  This fix applies the same workaround to libm,
which solves the isnanf issue.

The previous fix for looking up __isnanf is no longer needed.
2017-10-28 08:51:23 -04:00
Marco Castelluccio 1c0b2d34a1 Bug 1385542 - Blocklist pghook.dll as it causes crashes. r=jimm
--HG--
extra : rebase_source : e0a8b869388d5772697bf31e900b691534b93e63
2017-10-21 01:15:58 +01:00
Nathan Froyd 936aff29b5 Bug 1412405 - try harder to find a definition for isnanf in the custom linker; r=nalexander
The comment with the accompanying change explains things, but the short
version is that clang generates full calls to isnanf, which our
dlsym-based symbol lookup in the custom linker cannot handle correctly.
We therefore need to do extra work for isnanf to find the correct symbol.
2017-10-27 17:08:20 -04:00
Marco Castelluccio 9264f7616b Bug 1407337 - Block OpenSC < 0.16.0.0. r=jimm
--HG--
extra : rebase_source : 6f2f1d3f7e3219e4d78b36fef92613fb23b77218
extra : histedit_source : fbe1d04b2577caeb7380c505ed53047435194159
2017-10-11 11:45:44 +01:00
Bob Owen 75a8563510 Bug 1410073: Load user32.dll immediately after the DLL Blocklist is in place. r=aklotz
This is to reduce the chance of it being loaded on an injected thread.
2017-10-19 20:49:44 +01:00
Bob Owen 25f5a8b221 Bug 1372823 Part 5: Extend BaseThreadInitThunk thread start address verification to 64-bit. r=dmajor 2017-09-21 09:31:07 +01:00
Marco Castelluccio 0bdfded31a Bug 1360029 - Block Nahimic DLLs affected by a bug which causes Firefox to crash. r=jimm
--HG--
extra : rebase_source : 9d35825a8ce1ecb43f72b95ac7b27c33a834521f
2017-10-12 15:08:04 +01:00
Mike Hommey 9f2dd4775e Bug 1407468 - Replace multiple !JS_STANDALONE with MOZ_WIDGET_TOOLKIT. r=mshal
--HG--
extra : rebase_source : 4f9f9f583c3422ed0f8d1d65ea8e7575bd9baf2c
2017-10-05 14:50:01 +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
Sebastian Hengst 15ce5cb2db Backed out changeset 4dab43248f15 (bug 1372823) for crashing GTest on Windows 10 x64 debug. r=backout
MozReview-Commit-ID: 1u7TFtv6Mdv
2017-09-21 17:27:32 +02:00
Bob Owen 6e55dc3260 Bug 1372823: Extend BaseThreadInitThunk thread start address verification to 64-bit. r=dmajor 2017-09-21 09:31:07 +01:00
Mike Hommey 25eda66c1a Bug 1401116 - Remove jemalloc symbols from mozglue.def.in. r=njn
As long as symbols have the right declspec, the linker is going to
export them as expected. The main exception to when we actually need the
exported symbol to have a different name, which is the case for the
symbols normally exported by the CRT. So keep only those renamed symbols
in mozglue.def.in.

Keeping the jemalloc symbols in this file kind of implies that we need
every new API entry points to appear in there when it's not true. This
thus removes an unnecessary moving part when adding new allocator API
entry points.

--HG--
extra : rebase_source : 76faa659d62d46f3624fe3f1df0c09beb68e3549
2017-09-19 16:06:29 +09:00
Mike Hommey 2cb309a670 Bug 1401118 - Avoid having to modify replace-malloc.mk every time we add an allocator API entry point. r=froydnj
For obscure linkage reasons, we need all the replace-malloc symbols
being passed to the linker to tell it to allow them being undefined.

That list actually duplicates what's in malloc_decls.h somehow, and
every time we add an entry point, we end up having to modify those two
files (and others, addressed in different bugs), which is suboptimal.

So we generate the list of those symbols from malloc_decls.h.

--HG--
extra : rebase_source : 50156c6dda5601a6437f94a753400ec4ed9c8343
2017-09-19 16:09:56 +09:00
Christian Holler 75d68dab36 Bug 1386304 - Add and integrate asan-reporter system add-on. r=froydnj
MozReview-Commit-ID: IwE2LzofLz0

--HG--
extra : rebase_source : 49d5f79b0774837aa52c02a120f7c16272be157e
2017-07-31 15:13:38 +02:00
Chris Manchester fab07bc443 Bug 1386876 - Replace all uses of NO_VISIBILITY_FLAGS with a template and remove NO_VISIBILITY_FLAGS. r=glandium
MozReview-Commit-ID: 194U1WMCAM0

--HG--
extra : rebase_source : 365b68b0a1772d238ae9b84966e53dcd1197fd85
2017-05-01 18:12:35 -07:00
Chris Manchester c0a229d4c3 Bug 1386876 - Replace all uses of DISABLE_STL_WRAPPING with a template, remove DISABLE_STL_WRAPPING. r=glandium
MozReview-Commit-ID: FMEtb5PY7iP

--HG--
extra : rebase_source : 3cdee7528846462c758e623d6bcd2e6e17dbabff
2017-09-11 11:33:26 -07:00
Julien Cristau ff7b765b29 Bug 1268470 - Part 3: Restrict klsihk64.dll block to versions < 14.0.457.0 r=jimm
MozReview-Commit-ID: CD7jpcGGr9s

--HG--
extra : rebase_source : 73030b371d05a9a4d46964f54ee12eb1419f1255
2017-09-11 11:58:12 +02:00
Julien Cristau 01dcd5f0dc Bug 1268470 - Part 2: Block klsihk64.dll on Windows 8 r=jimm
MozReview-Commit-ID: B2IrXnr46eP

--HG--
extra : rebase_source : 3c9d8c60faa28f272b36354ceacffba70de94de7
2017-09-08 12:00:56 +02:00
Julien Cristau 18f5425cc8 Bug 1268470 - Part 1: Add BLOCK_WIN8_ONLY flag to dll blocklist r=jimm
MozReview-Commit-ID: 8ZhqDv4YMOn

--HG--
extra : rebase_source : 1a0f708c97eebeca016a053cad820f1dcd0e0129
2017-09-08 11:59:13 +02:00
Wes Kocher eace83acfa Backed out changeset 0c2b838c91e4 (bug 1386304) for eslint failures in asan-reporter/bootstrap.js a=backout
MozReview-Commit-ID: KjA9iDDA2hp
2017-09-07 16:51:48 -07:00
Christian Holler 06f527a679 Bug 1386304 - Add and integrate asan-reporter system add-on. r=froydnj
MozReview-Commit-ID: IwE2LzofLz0

--HG--
extra : rebase_source : bd952047103a990d314667fc73a4cf570f9a2bde
2017-07-31 15:13:38 +02:00
Mike Hommey e77f51a721 Bug 1395776 - Fold replace-malloc into mozjemalloc. r=njn
Add the MPL 2.0 license header per bug 1395449.

--HG--
extra : rebase_source : c85544a178aba7e77b5b8031851b8e16b22a3848
2017-08-31 12:02:01 +09:00
Sebastian Hengst 43bc951ac7 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: ES9rKhiQo10
2017-09-01 10:38:51 +02:00
Nicholas Nethercote c419d5fa48 Bug 1389305 (attempt 2) - Add jemalloc_ptr_info() and moz_malloc_enclosing_size_of(). r=glandium.
--HG--
extra : rebase_source : 93a6cfcc916fb239581c2892f24b24c6fc65ac71
2017-09-01 11:52:23 +10:00
Sebastian Hengst 4310ea4600 Backed out changeset f232b5b1a0c7 (bug 1389305) for frequently failing GTest Jemalloc.PtrInfo on Linux opt. r=backout 2017-08-31 13:52:48 +02:00
Nicholas Nethercote 365285b831 Bug 1389305 - Add jemalloc_ptr_info() and moz_malloc_enclosing_size_of(). r=glandium.
jemalloc_ptr_info() gives info about any pointer, such as whether it's within a
live or free allocation, and if so, info about that allocation. It's useful for
debugging.

moz_malloc_enclosing_size_of() uses jemalloc_ptr_info() to measure the size of
an allocation from an interior pointer. It's useful for memory reporting,
especially for Rust code.

--HG--
extra : rebase_source : caa19cccf8c2d1f79cf004fe6a408775de5a7b22
2017-08-24 19:37:27 +10:00
Tom Ritter da549982c3 Bug 1394007 Fix a signedness comparison warning in WindowsDllBlocklist.cpp r=dmajor
MozReview-Commit-ID: 3qH0PU2gBur

--HG--
extra : rebase_source : 6f2b51367462604cf3b6c53ce8a82722d926970d
2017-08-30 00:43:46 -05:00
Tom Ritter 92ff663a31 Bug 1393498 Mark the stub_BaseThreadInitThunk as MOZ_NORETURN to silence a warning about a noreturn function not returning r=dmajor,froydnj
/home/worker/workspace/build/src/mozglue/build/WindowsDllBlocklist.cpp:816:1: error: 'noreturn' function does return [-Werror]

MozReview-Commit-ID: SYgPDW0sMV

--HG--
extra : rebase_source : 27b1dda404b3fc5fab95dd524677387bad921751
2017-08-24 22:49:09 -05:00
Ryan VanderMeulen 2ef4841fe2 Backed out changeset d44d3fae6125 (bug 1393498) for bustage on a CLOSED TREE. 2017-08-24 19:54:02 -04:00
Tom Ritter b76720e4d2 Bug 1393498 Mark the stub_BaseThreadInitThunk as MOZ_NORETURN to silence a warning about a noreturn function not returning r=dmajor
/home/worker/workspace/build/src/mozglue/build/WindowsDllBlocklist.cpp:816:1: error: 'noreturn' function does return [-Werror]

MozReview-Commit-ID: SYgPDW0sMV

--HG--
extra : rebase_source : 1039c3f8669093c9d77a3c30090c76457c8eb6e8
2017-08-24 16:28:32 -05:00
Wes Kocher c14002885a Backed out changeset 0df56be60d07 (bug 1393498) for windows build failures a=backout
MozReview-Commit-ID: 9LrZYhCPjRv
2017-08-24 12:14:31 -07:00
Tom Ritter 21351be91a Bug 1393498 Mark the stub_BaseThreadInitThunk as MOZ_NORETURN to silence a warning about a noreturn function not returning r=dmajor
/home/worker/workspace/build/src/mozglue/build/WindowsDllBlocklist.cpp:816:1: error: 'noreturn' function does return [-Werror]

MozReview-Commit-ID: SYgPDW0sMV

--HG--
extra : rebase_source : d932e84ff0729b1c5ccff6658ee81849eb27eef4
2017-08-24 09:32:04 -05:00
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
Mike Hommey 4aaef7b18a Bug 1395032 - Remove remainder of the VS CRT allocator mismatch hack. r=gps
Bug 1186064 removed most of it when we started requiring VS 2015u2, but
the "frex" function exported through mozglue.def.in was only used
through the MSVCRT being patched by fixcrt.py, which is not done anymore.
So the "frex" export is not used anymore, and so the "dumb_free_thunk"
function is not used anymore as well.

--HG--
extra : rebase_source : 879c469c317c8b6749410a4a476d6c951c9a1d0f
2017-08-30 14:06:13 +09: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