Commit Graph

60 Commits

Author SHA1 Message Date
Chris Peterson
a4e8be50b4 Bug 1507049 - Rename MOZ_CRASH_UNSAFE_OOL MOZ_CRASH_UNSAFE. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D18515
2019-02-03 00:09:37 -08:00
Ehsan Akhgari
498e2df734 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset
2019-01-18 10:16:18 +01:00
Sylvestre Ledru
e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Ehsan Akhgari
b614d2046a Bug 1508472 - Part 5: Fifth batch of comment fix-ups in preparation for the tree reformat r=sylvestre
This is a best effort attempt at ensuring that the adverse impact of
reformatting the entire tree over the comments would be minimal. I've used a
combination of strategies including disabling of formatting, some manual
formatting and some changes to formatting to work around some clang-format
limitations.

Differential Revision: https://phabricator.services.mozilla.com/D13371
2018-11-29 10:30:46 +00:00
Gabriele Svelto
7e6f18cd29 Bug 1348273 - Convert crash annotations into a machine-readable list of constants; r=ted.mielczarek,njn,dholbert,mak,cpearce,mcmanus,froydnj,Dexter,jrmuizel,jchen,jimm,bz,surkov
This introduces the machinery needed to generate crash annotations from a YAML
file. The relevant C++ functions are updated to take a typed enum. JavaScript
calls are unaffected but they will throw if the string argument does not
correspond to one of the known entries in the C++ enum. The existing whitelists
and blacklists of annotations are also generated from the YAML file and all
duplicate code related to them has been consolidated. Once written out to the
.extra file the annotations are converted in string form and are no different
than the existing ones.

All existing annotations have been included in the list (and some obsolete ones
have been removed) and all call sites have been updated including tests where
appropriate.
2018-07-05 15:42:11 +02:00
Julian Seward
823e7eddf6 Bug 1296819 - Intermittent valgrind-test | Invalid write of size 4 at mozilla:: / _pt_root / start_thread / clone. r=amarchesini@mozilla.com.
If we're running on Valgrind, we'll be making forward progress at a rate of
somewhere between 1/25th and 1/50th of normal.  This can cause shutdown
timeouts frequently enough to be a problem for the Valgrind runs on
automation.  As an attempt to avoid the worst of this, this patch scales up
the presented timeout by a factor of three.  For a non-Valgrind-enabled
build, or for an enabled build which isn't running on Valgrind, the timeout
is unchanged.
2018-05-31 14:15:39 +02:00
Andrea Marchesini
df9ecec8b1 Bug 1437575 - Better shutdown hang reporting: all the notifications must be received, r=smaug 2018-02-13 11:55:16 +01:00
Andrea Marchesini
3e08265e73 Bug 1432963 - Fixing workers headers - part 17 - no LIBS=[workers] in moz.build files, r=smaug 2018-01-31 08:25:30 +01:00
Petr Sumbera
36b0561b74 Bug 1419725 - better handle termination for systems with ticks per second 100000 ;r=Yoric
Fixes Solaris where PR_TicksPerSecond() returns 100000.
2017-11-22 05:58:52 -08:00
Gabriele Svelto
ec91f1a9ef Bug 1402519 - Remove MOZ_CRASHREPORTER directives from toolkit; r=mossop
MozReview-Commit-ID: GsnhrLJYkqG
2017-10-10 15:56:48 +02:00
shindli
f90a73f3c0 Backed out 16 changesets (bug 1402519) for conflicts during merge r=backout on a CLOSED TREE
Backed out changeset 07fcf163241a (bug 1402519)
Backed out changeset c6d2ad45d8e2 (bug 1402519)
Backed out changeset 8a3caca61294 (bug 1402519)
Backed out changeset 01425eae2c48 (bug 1402519)
Backed out changeset cf298d3815de (bug 1402519)
Backed out changeset e1964f4389cd (bug 1402519)
Backed out changeset f405337f3569 (bug 1402519)
Backed out changeset a76356fd3359 (bug 1402519)
Backed out changeset d3bb350d1c34 (bug 1402519)
Backed out changeset 9d3bfd9f932c (bug 1402519)
Backed out changeset e3dd6e5b073f (bug 1402519)
Backed out changeset e801b0c00134 (bug 1402519)
Backed out changeset 8a4139fa5dca (bug 1402519)
Backed out changeset 8d01c14ac1ca (bug 1402519)
Backed out changeset 24e0dcd01898 (bug 1402519)
Backed out changeset f8fdf450613f (bug 1402519)
2017-11-23 00:11:44 +02:00
Gabriele Svelto
5f26c2226d Bug 1402519 - Remove MOZ_CRASHREPORTER directives from toolkit; r=mossop
MozReview-Commit-ID: GsnhrLJYkqG
2017-10-10 15:56:48 +02:00
Eric Rahm
e75f2219b8 Bug 1414318 - Turn off |StartWriter| in leak checking builds. r=mccr8 2017-11-03 14:17:57 -07:00
Andrea Marchesini
5b98fa1520 Bug 1405290 - Improve logging of workers when shutting down - part 2 - Implement RuntimeService::CrashIfHanging(), r=asuth 2017-11-15 07:58:38 +01:00
Sebastian Hengst
0e0dc2a213 Backed out changeset 83f0e033450d (bug 1414318) for failing xpcshell's toolkit/components/terminator/tests/xpcshell/test_terminator_record.js on Linux x64 asan. r=backout a=backout on a CLOSED TREE
MozReview-Commit-ID: wqauBr1VCl
2017-11-04 17:38:52 +01:00
Eric Rahm
2282d670df Bug 1414318 - Turn off |StartWriter| in leak checking builds. r=mccr8 2017-11-03 14:17:57 -07:00
Adam Gashlin
69f4ad178e Bug 1401400 - Part 3. Process all threads when crashing for hang. r=gsvelto
MozReview-Commit-ID: JH4PGYJreF7
2017-10-19 14:49:13 -07:00
Nicholas Nethercote
a35e82f193 Bug 1403868 (part 4) - Reduce tools/profiler/public/*.h to almost nothing in non-MOZ_GECKO_PROFILER builds. r=mstange.
Currently the Gecko Profiler defines a moderate amount of stuff when
MOZ_GECKO_PROFILER is undefined. It also #includes various headers, including
JS ones. This is making it difficult to separate Gecko's media stack for
inclusion in Servo.

This patch greatly simplifies how things are exposed. The starting point is:

- GeckoProfiler.h can be #included unconditionally;

- everything else from the profiler must be guarded by MOZ_GECKO_PROFILER.

In practice this introduces way too many #ifdefs, so the patch loosens it by
adding no-op macros for a number of the most common operations.

The net result is that #ifdefs and macros are used a bit more, but almost
nothing is exposed in non-MOZ_GECKO_PROFILER builds (including
ProfilerMarkerPayload.h and GeckoProfiler.h), and understanding what is exposed
is much simpler than before.

Note also that in BHR, ThreadStackHelper is now entirely absent in
non-MOZ_GECKO_PROFILER builds.
2017-10-04 09:11:18 +11:00
Chris Peterson
6137e4ff8b Bug 870698 - Part 2: Replace Append("") with AppendLiteral(""). r=erahm
MozReview-Commit-ID: CrkIP4iHP1U
2017-09-03 22:14:11 -07:00
Nicholas Nethercote
96b8d5d8a9 Bug 1375387 - Reorder and section-ify GeckoProfiler.h. r=mstange.
This patch gives some structure and order to the profiler's API.

It also renames AutoProfilerRegister as AutoProfilerRegisterThread, to match
profiler_register_thread().
2017-06-22 14:28:47 +10:00
Cervantes Yu
6bcb4f30a4 Bug 1024669 - Part 1: Annotate crash reports with thread names. r=gsvelto
NS_SetCurrentThreadName() is added as an alternative to PR_SetCurrentThreadName()
inside libxul. The thread names are collected in the form of crash annotation to
be processed on socorro.

MozReview-Commit-ID: 4RpAWzTuvPs
2017-02-07 18:57:23 +08:00
Sebastian Hengst
189424cb45 Backed out changeset 7fdcabdbb675 (bug 1024669) for failing mda, GTest and talos jobs. r=backout on a CLOSED TREE 2017-04-10 19:05:44 +02:00
Cervantes Yu
c2014c712d Bug 1024669 - Part 1: Annotate crash reports with thread names. r=gsvelto
MozReview-Commit-ID: 4RpAWzTuvPs
2017-02-07 18:57:23 +08:00
Carsten "Tomcat" Book
e6d6caf1f8 Backed out changeset 7a52d887bcea (bug 1024669) for bustage 2017-04-10 11:43:49 +02:00
Cervantes Yu
eb13868db5 Bug 1024669 - Part 1: Annotate crash reports with thread names. r=gsvelto
MozReview-Commit-ID: 4RpAWzTuvPs
2017-02-07 18:57:23 +08:00
David Major
e77ed51418 No bug - Fix comment to match the code. DONTBUILD
MozReview-Commit-ID: LXrzCRvEWIa
2017-01-25 10:06:11 +13:00
Markus Stange
991ab574ae Bug 1323100 - Register most of the remaining threadfunc threads with the profiler. r=froydnj
As far as I can tell, this covers all the remaining threads which we start
using PR_CreateThread, except the ones that are created inside NSPR or NSS,
and except for the Shutdown Watchdog thread in nsTerminator.cpp and the
CacheIO thread. The Shutdown Watchdog thread stays alive past leak detection
during shutdown (by design), so we'd report leaks if we profiled it. The
CacheIO thread seems to stay alive past shutdown leak detection sometimes as
well.

This adds a AutoProfilerRegister stack class for easy registering and
unregistering. There are a few places where we still call
profiler_register_thread() and profiler_unregister_thread() manually, either
because registration happens conditionally, or because there is a variable that
gets put on the stack before the AutoProfilerRegister (e.g. a dynamically
generated thread name). AutoProfilerRegister needs to be the first object on
the stack because it uses its own `this` pointer as the stack top address.

MozReview-Commit-ID: 3vwhS55Yzt
2017-01-05 16:34:26 +01:00
Sylvestre Ledru
0f65f2ab6c Bug 1318004 - Converts for(...; ...; ...) loops to use the new range-based loops in C++11. r=Ehsan
MozReview-Commit-ID: lk5eJXUno9
2016-11-16 17:12:13 +01:00
Sylvestre Ledru
79a067af86 Bug 1318004 - Use C++11's override and remove virtual where applicable. r=Ehsan
MozReview-Commit-ID: H9tAe0YN1tx
2016-11-16 17:08:26 +01:00
Sylvestre Ledru
1672d883a9 Bug 1318004 - Replace string literals containing escaped characters with raw string literals. r=Ehsan
MozReview-Commit-ID: KOk13e23Py
2016-11-16 17:07:03 +01:00
Sylvestre Ledru
a15f1c5d08 Bug 1318004 - Replace default bodies of special member functions with = default; r=Ehsan
MozReview-Commit-ID: 33AOhtFrXS8
2016-11-16 18:26:14 +01:00
Wes Kocher
b620596e75 Backed out 4 changesets (bug 1318004) for xpcshell failures a=backout CLOSED TREE
Backed out changeset a3fe53641526 (bug 1318004)
Backed out changeset a5d1676b6f88 (bug 1318004)
Backed out changeset b56b37f0f4d7 (bug 1318004)
Backed out changeset fb5254baf1cb (bug 1318004)
2016-11-21 16:15:38 -08:00
Sylvestre Ledru
7ccbd595c5 Bug 1318004 - Converts for(...; ...; ...) loops to use the new range-based loops in C++11. r=Ehsan
MozReview-Commit-ID: lk5eJXUno9
2016-11-16 17:12:13 +01:00
Sylvestre Ledru
b48ac2ed6f Bug 1318004 - Use C++11's override and remove virtual where applicable. r=Ehsan
MozReview-Commit-ID: H9tAe0YN1tx
2016-11-16 17:08:26 +01:00
Sylvestre Ledru
9851572dbc Bug 1318004 - Replace string literals containing escaped characters with raw string literals. r=Ehsan
MozReview-Commit-ID: KOk13e23Py
2016-11-16 17:07:03 +01:00
Sylvestre Ledru
eaf1a1bb8c Bug 1318004 - Replace default bodies of special member functions with = default; r=Ehsan
MozReview-Commit-ID: 33AOhtFrXS8
2016-11-16 18:26:14 +01:00
Wes Kocher
13642ca8af Backed out 4 changesets (bug 1318004) for xpcshell failures a=backout
Backed out changeset 6995bd33872b (bug 1318004)
Backed out changeset 9be5c856bc78 (bug 1318004)
Backed out changeset 365b0b7f289a (bug 1318004)
Backed out changeset 2f2ebf176eac (bug 1318004)
2016-11-21 12:23:17 -08:00
Sylvestre Ledru
ea83e5e8bd Bug 1318004 - Converts for(...; ...; ...) loops to use the new range-based loops in C++11. r=Ehsan
MozReview-Commit-ID: lk5eJXUno9
2016-11-16 17:12:13 +01:00
Sylvestre Ledru
9fbcdd2d4f Bug 1318004 - Use C++11's override and remove virtual where applicable. r=Ehsan
MozReview-Commit-ID: H9tAe0YN1tx
2016-11-16 17:08:26 +01:00
Sylvestre Ledru
057d135c4c Bug 1318004 - Replace string literals containing escaped characters with raw string literals. r=Ehsan
MozReview-Commit-ID: KOk13e23Py
2016-11-16 17:07:03 +01:00
Sylvestre Ledru
c30faf12df Bug 1318004 - Replace default bodies of special member functions with = default; r=Ehsan
MozReview-Commit-ID: 33AOhtFrXS8
2016-11-16 18:26:14 +01:00
Nicholas Nethercote
b5810a1eb4 Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm.
This change avoids lots of false positives for Coverity's CHECKED_RETURN
warning, caused by NS_WARN_IF's current use in both statement-style and
expression-style.

In the case where the code within the NS_WARN_IF has side-effects, I made the
following change.

> NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));
> -->
> Unused << NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));

In the case where the code within the NS_WARN_IF lacks side-effects, I made the
following change.

> NS_WARN_IF(!condWithoutSideEffects);
> -->
> NS_WARNING_ASSERTION(condWithoutSideEffects, "msg");

This has two improvements.
- The condition is not evaluated in non-debug builds.
- The sense of the condition is inverted to the familiar "this condition should
  be true" sense used in assertions.

A common variation on the side-effect-free case is the following.

> nsresult rv = Fn();
> NS_WARN_IF_(NS_FAILED(rv));
> -->
> DebugOnly<nsresult rv> = Fn();
> NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Fn failed");
2016-09-02 17:12:24 +10:00
Kan-Ru Chen
a9b19d0584 Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj
The patch is generated from following command:

  rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,

MozReview-Commit-ID: AtLcWApZfES
2016-08-24 14:47:04 +08:00
Chris Peterson
c35faf4632 Bug 1277775 - Replace MOZ_CONSTEXPR{_VAR,_TMPL} with constexpr. r=froydnj 2016-07-08 14:39:53 -07:00
Alessio Placitelli
38c5e57c95 Bug 1242084 - nsTerminator::UpdateTelemetry() leaks 8 byte nsStringBuffer when app.update.channel gets set to Beta. r=gfritzsche 2016-03-14 06:12:00 +01:00
David Rajchenbach-Teller
1cbb83de61 Bug 1252382 - Get rid of PR_Sleep in the terminator;r=froydnj
The terminator currently makes use of PR_Sleep. As it turns out, late
in shutdown, this can cause infinite recursions and finally exit(-11) . This
patch replaces PR_Sleep with usleep(3) and Sleep().

MozReview-Commit-ID: 3SybinpQUVl
2016-03-01 09:01:22 +01:00
Timur Valeev
9a6e557701 Bug 1232285 - The Terminator's notion of ticks is incorrect. r=Yoric 2015-12-22 10:32:00 +03:00
Birunthan Mohanathas
ac37dec517 Bug 1219392 - Capitalize mozilla::unused to avoid conflicts. r=froydnj 2015-11-02 07:53:26 +02:00
Birunthan Mohanathas
a29151dc87 Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Alessio Placitelli
bc31318d43 Bug 1134279 - Change Telemetry data producers to use the correct recording flags. r=vladan 2015-03-23 04:39:00 +01:00