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

236 Коммитов

Автор SHA1 Сообщение Дата
Cameron McCormack eedb6aebd4 Bug 1538081 - Part 3: Add operator<<(ostream&) definitions for a few common types. r=froydnj,gerald
Depends on D25023

Differential Revision: https://phabricator.services.mozilla.com/D25024

--HG--
extra : moz-landing-system : lando
2019-03-30 04:26:26 +00:00
Ryan Hunt 1954ab0781 Bug 1523969 part 18 - Move method definition inline comments to new line in mozglue. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D21119

--HG--
extra : rebase_source : 5f5f0457fc136bc9e3c8edb315e4b7e6275ec3c2
2019-02-25 16:10:53 -06:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Jim Chen d92debaff7 Bug 1480834 - 3. Fix linker compile errors under x86-64; r=glandium
The linker has x86-64 support but currently fails to compile. This patch
fixes these compile errors to make it build under x86-64.

Differential Revision: https://phabricator.services.mozilla.com/D4481
2018-09-13 12:09:25 -04:00
Jim Chen f61f04949b Bug 1451891 - Fix race conditions in __wrap_dlerror; r=glandium
__wrap_dlerror uses a single pointer for all threads, which means one
thread could get the dlerror result from another thread. Normally this
wouldn't cause crashes. However, because dlerror results come from a
per-thread buffer, if a thread exits and our saved dlerror result came
from that thread, the saved pointer could then refer to invalid memory.

The proper way to fix this is to use TLS and have a per-thread pointer
for __wrap_dlerror. However, instead of using up a TLS slot, this patch
keeps the single pointer for custom messages, and fallback to per-thread
dlerror call for system messages. While the race condition still exists,
I think the risk is acceptable. Even when races occur, they should no
longer cause crashes.

MozReview-Commit-ID: 4hGksidjiVz

--HG--
extra : rebase_source : 373000686c426b81ffd7cee88264e89b7a733957
2018-07-25 13:59:30 -04:00
Andrew Halberstadt 9435736ade Bug 1471620 - Skip python-tests locally that don't run with python 3 in CI r=davehunt
This will make sure that when running |mach python-test --python 3| locally,
we only run the tests that also run in CI with python 3 (and therefore pass
presumably).

MozReview-Commit-ID: 3OBr9yLSlSq

--HG--
extra : rebase_source : 456340d0ecdddf1078f2b5b4ebb1eddf3813b26a
2018-06-27 11:10:02 -04:00
Jim Chen 9d10605784 Bug 1460989 - Hold system linker lock while modifying debug map. r=glandium, a=RyanVM
When we modify the debug map, we could be racing with the system linker,
either when we modify the entries or when we change page protection
flags. To fix the race, we need to take the system linker's internal
lock when we perform any kind of modification on the debug map.

One way to hold the system linker lock is to call dl_iterate_phdr, and
perform our actions inside the callback, which is invoked with the
lock being held. However, dl_iterate_phdr is only present on Android
5.0+, and even then, dl_iterate_phdr is only protected by the linker
lock on Android 6.0+.

This means that with this patch, we can only safely modify the debug map
on Android 6.0+, which I think is acceptable for an operation that only
benefits a debugger.

MozReview-Commit-ID: BowBEO8tu8Z

--HG--
extra : amend_source : 837631dfc2ef17b24ffe5778bcb70dc29b7dfc66
2018-06-15 04:24:10 -04:00
Ryan VanderMeulen 4aef6ab351 Backed out changeset a4465713555b (bug 1460989) for causing the Galaxy S8 crash rate to spike. 2018-06-06 21:07:48 -04:00
Sylvestre Ledru 89e4661534 Bug 1464869 - Fix flake8/pep8 issue by hand in mozglue/ r=glandium
MozReview-Commit-ID: 4U31tUZPm8U

--HG--
extra : rebase_source : 5b9fdb66a482e89e3d70fd5e8fd9a86c055f7044
2018-05-25 21:28:12 -07:00
Jim Chen 32c922179c Bug 1460989 - Check page protection flags again after mprotect(); r=glandium
We are apparently still crashing even after mprotect() with write flag
returns successfully. This patch reads the flags again after mprotect()
returns, and hopefully the flags will tell the truth of whether the page
is truly writable or not after calling mprotect().

MozReview-Commit-ID: Jsg8vHKFEvJ

--HG--
extra : rebase_source : b028aa0d5cefd50302bfc2502292d9129d202e09
2018-05-30 11:47:07 -04:00
Mike Hommey b94cf61acd Bug 1459722 - Remove zxx_stream. r=froydnj
It was necessary back when we were doing decompression from a signal
handler, because we couldn't then have zlib call malloc, but we don't
do that anymore, so the whole wrapping is effectively unused.

With the wrapping gone, we manually initialize the zalloc, zfree and
opaque fields, as specified in the zlib documentation.

--HG--
extra : rebase_source : c4e84009e65f71f6c43362468c2934e04a8abda1
2018-05-10 11:45:23 +09:00
James Willcox 624417af1d Bug 1455662 - Guard against mprotect() failure when manipulating link map r=jchen
MozReview-Commit-ID: 7orhBmf4j5j
2018-04-25 15:06:55 -05:00
James Willcox cf502cd7d7 Bug 1450793 - Don't assume 4k page size r=glandium
MozReview-Commit-ID: DWSIUOFfKW5
2018-04-13 08:46:35 -05:00
James Willcox 0e79fd0b72 Bug 1447607 - Correctly init and update ElfLoader::Singleton::lastError r=glandium
MozReview-Commit-ID: r1bclXdt4V

--HG--
extra : rebase_source : c9f612def794a6edc5fa8dd99fc08d2df4ed1cf1
2018-03-30 09:57:43 -05:00
Nathan Froyd 1dba87fe96 Bug 1448029 - make constructors in the linker explicit; r=glandium
Attempting to stand up the static analysis for Android builds revealed
that we weren't being explicit enough.
2018-03-27 10:51:32 -04:00
Jim Chen 589e7e1a01 Bug 1391268 - 1. Add call to verify CRC; r=glandium
To reliably detect corrupt APK, this patch adds a GeckoLoader.verifyCRC
call to enable verification of CRC before extracting libs.

MozReview-Commit-ID: 5EpIfwREGIv
2018-02-14 16:56:54 -05: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
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
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
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
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
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
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
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
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
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
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
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
Eugen Sawin 4b956de40e Bug 1346042 - [1.0] Mutex-lock LibHandle direct reference management. r=glandium 2017-04-18 16:08:40 +02:00
Tom Tromey f6321565d2 Bug 1060419 - convert mozglue/linker to use the mfbt-provided printf format defines, r=froydnj
MozReview-Commit-ID: LW6eDUxWXrp

--HG--
extra : rebase_source : 1d06ec765b30201f6cfc427006fa56384a61b38b
2016-12-14 14:22:49 -07:00
Jim Chen 21dfb2d432 Bug 1337304. r=snorp
--HG--
extra : rebase_source : 7306160ece787ed98fb98ec1bcecbb0466d98093
2017-02-08 13:49:20 -05:00
Jan de Mooij cad14cbd6e Bug 1313351 followup - Also back out the ElfLoader changes from bug 1320905 on a CLOSED TREE. r=red
--HG--
extra : rebase_source : 5ce387a5d813752957733c46381ea85245bc8eda
2016-12-23 21:27:57 +01:00
Luke Wagner 549d7571b3 Bug 1320905 - Add js::RefCounted that uses js_delete (r=waldo) 2016-12-05 15:59:18 -08:00
Andrew Halberstadt 6adcf5b456 Bug 1317970 - Use manifestparser manifests for python unit tests, r=chmanchester
This deprecates PYTHON_UNIT_TESTS and replaces it with PYTHON_UNITTEST_MANIFESTS.
In the build system, this means python unittests will be treated the same as all
other test suites that use manifestparser. New manifests called 'python.ini' have
been created for all test directories containing python unittests.

MozReview-Commit-ID: IBHG7Thif2D

--HG--
extra : rebase_source : 11a92a2bc544d067946bbd774975140147458caa
2016-11-16 09:59:22 -05:00
Eugen Sawin 5196420c32 Bug 1283629 - [1.1] Check for cached library file availability before reusing it. r=glandium 2016-11-15 15:19:25 +01:00