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

222 Коммитов

Автор SHA1 Сообщение Дата
Anny Gakhokidze 0ce6e91045 Bug 1682694 - Add maxFrames arg to nsTraceRefcnt::WalkTheStack, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D99848
2020-12-16 17:44:28 +00:00
Andrew McCreight 0652b2582f Bug 1680040 - Remove failure check for CheckAndCreateBloatView() and rename it. r=xpcom-reviewers,nika
CheckAndCreateBloatView() is infallible, so there's no need to check if it
worked.

I also renamed the function to EnsureBloatView() because that better matches the
common practice, and what the function is actually doing.

Finally, I added a small grammar fix.

Differential Revision: https://phabricator.services.mozilla.com/D98342
2020-12-01 21:27:19 +00:00
Markus Stange fb91479c33 Bug 1667461 - Add a note about class name collisions. r=nika,xpcom-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D91473
2020-09-25 20:35:13 +00:00
Eric Rahm 8e4a18ed64 Bug 1627392 - Add missing includes and namespaces to xpcom/base. r=xpcom-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D69658

--HG--
extra : moz-landing-system : lando
2020-04-08 10:12:33 +00:00
Simon Giesecke 2d1ae94059 Bug 1619260 - Prevent assertion when processing nsStringBuffer leaks. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D64949

--HG--
extra : moz-landing-system : lando
2020-03-02 14:31:09 +00:00
Andrew McCreight 4babb2b5ab Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown
Patch by bhackett and jlaster. Also reviewed by mccr8.

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

--HG--
extra : moz-landing-system : lando
2020-02-27 17:39:15 +00:00
Ciure Andrei 00dd87f6f4 Backed out changeset d407a28318e6 (bug 1609815) for causing windows ming bustages CLOSED TREE
--HG--
extra : histedit_source : b2c748e31e0f6ba8fcf9960a336e0bbd361b07e6
2020-02-27 07:05:19 +02:00
Andrew McCreight b197e1f783 Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown
Patch by bhackett and jlaster. Also reviewed by mccr8.

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

--HG--
extra : moz-landing-system : lando
2020-02-27 04:43:48 +00:00
Eric Rahm 78ee6675cf Bug 1606187 - Part 2b: Update users of nsClassHashtable to handle UniquePtr differences r=KrisWright,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D59042

--HG--
extra : moz-landing-system : lando
2020-01-13 19:18:56 +00:00
Sylvestre Ledru c521758c5e Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2020-01-09 21:50:11 +00:00
Thinker Li dae3528029 Bug 1604084 - Fix log names of leak checking and refactor it. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D57222

--HG--
extra : moz-landing-system : lando
2019-12-18 17:02:10 +00:00
Thinker Li 7cfdf6a788 Bug 1470591 - Part 6: Create a fork server process. r=gsvelto
This patch make changes of Gecko infrastrutures to run a fork server
process.

 - ForkServerLauncher is a component, which creates a fork server
   process at XPCOM startup.

 - nsBrowserApp.cpp and related files have been chagned to start a
   fork server in a process.

 - Logging and nsTraceRefcnt were changed to make it work with the
   fork server.

Depends on D46883

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

--HG--
extra : moz-landing-system : lando
2019-12-05 00:02:40 +00:00
Bogdan Tara 3732e1f17c Backed out 6 changesets (bug 1470591) for test_punycodeURIs & test_nsIProcess* crashes CLOSED TREE
Backed out changeset 3ca19f8f388e (bug 1470591)
Backed out changeset f80db6e63169 (bug 1470591)
Backed out changeset cbac2d7dfe42 (bug 1470591)
Backed out changeset daad4d736ec0 (bug 1470591)
Backed out changeset ca1b804d404a (bug 1470591)
Backed out changeset a10772f780f7 (bug 1470591)
2019-12-04 00:53:14 +02:00
Thinker Li 035717ac2d Bug 1470591 - Part 6: Create a fork server process. r=gsvelto
This patch make changes of Gecko infrastrutures to run a fork server
process.

 - ForkServerLauncher is a component, which creates a fork server
   process at XPCOM startup.

 - nsBrowserApp.cpp and related files have been chagned to start a
   fork server in a process.

 - Logging and nsTraceRefcnt were changed to make it work with the
   fork server.

Depends on D46883

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

--HG--
extra : moz-landing-system : lando
2019-12-03 19:08:10 +00:00
Andrew McCreight a102cb7648 Bug 1599521 - Add helper method for getting a string for the current process type. r=froydnj
I also removed the unused forward declaration of GMPLoader. It used to
be needed for the declaration of XRE_InitChildProcess.

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

--HG--
extra : moz-landing-system : lando
2019-12-02 22:01:47 +00:00
Andrew McCreight d25c3b20ae Bug 1598787 - Rename XRE_ChildProcessTypeToString to XRE_GeckoProcessTypeToString. r=froydnj
This function works on all GeckoProcessTypes, not just those for child
processes.

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

--HG--
extra : moz-landing-system : lando
2019-11-25 22:45:31 +00:00
Coroiu Cristina 0356c7a1b5 Backed out changeset 8f52344661fe (bug 1598787) for build bustages at build/src/tools/fuzzing/faulty/Faulty.cpp on a CLOSED TREE 2019-11-26 00:22:28 +02:00
Andrew McCreight b8c9932d5b Bug 1598787 - Rename XRE_ChildProcessTypeToString to XRE_GeckoProcessTypeToString. r=froydnj
This function works on all GeckoProcessTypes, not just those for child
processes.

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

--HG--
extra : moz-landing-system : lando
2019-11-25 17:24:46 +00:00
kriswright ddd0133b2a Bug 1572238 - Dump assertion stacks using __android_log_print. r=Ehsan
Defines an android-only version of nsTraceRefcnt::WalkTheStack that takes a function callback, which outputs the stack frame buffer to `__android_log_print`. Also uses `__wrap_dladdr` in MozDescribeCodeAddress, which outputs slightly more informative data for the stack trace (instead of instances of '???/??? [???]').

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

--HG--
extra : moz-landing-system : lando
2019-09-24 20:50:41 +00:00
Bogdan Tara e4913f5aeb Backed out changeset 88334e3a605e (bug 1572238) for causing windows 2012 bustages CLOSED TREE 2019-09-24 21:57:56 +03:00
kriswright 9ac396cf78 Bug 1572238 - Dump assertion stacks using __android_log_print. r=Ehsan
Defines an android-only version of nsTraceRefcnt::WalkTheStack that takes a function callback, which outputs the stack frame buffer to `__android_log_print`. Also uses `__wrap_dladdr` in MozDescribeCodeAddress, which outputs slightly more informative data for the stack trace (instead of instances of '???/??? [???]').

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

--HG--
extra : moz-landing-system : lando
2019-09-24 12:14:24 +00:00
Cameron McCormack d075470483 Bug 1053379 - Simplify CodeAddressService so non-DMD users can rely on defaults. r=njn
None of the StringTable implementations were freeing their strdup'd
strings, either.

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

--HG--
extra : moz-landing-system : lando
2019-08-06 21:58:12 +00:00
Dave Townsend b2dea19e2d Bug 1570019: Verify that nsContentUtils is initialized before calling into it. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D39895

--HG--
extra : moz-landing-system : lando
2019-07-30 15:51:17 +00:00
Dave Townsend 9d647b266c Bug 1569682: Fix GetSerialNumber to not destroy the just added serial number record. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D39777

--HG--
extra : moz-landing-system : lando
2019-07-29 20:52:04 +00:00
Andrew McCreight 49edb9400b Bug 1531966 - Dump out the contents of leaked nsStringBuffers when logging them. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D22037

--HG--
extra : moz-landing-system : lando
2019-03-05 22:00:46 +00:00
Chris Peterson 8e1848413c Bug 1507049 - Rename MOZ_CRASH_UNSAFE_OOL MOZ_CRASH_UNSAFE. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D18515

--HG--
extra : rebase_source : e8ef6eec0f7542bb381e2da81ae6431b2828aabc
extra : source : a8c262b4a2579e6def1b3a5a8220f5197b443e34
2019-02-03 00:09:37 -08:00
Sylvestre Ledru 14486004b6 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-02-04 19:10:18 +00:00
Mike Hommey 9f9fcb476e Bug 1523851 - Remove the dynamic_cast<void*> test. r=froydnj
It relies on AC_TRY_RUN, which doesn't work on cross-compiles. What this
means is that the feature has been disabled on mac builds on automation
ever since we switched to cross-compiles. It's still enabled on local
mac builds because the test runs there, and returns "yes". It also means
it's disabled on Android, where it probably works (at least debug tests
on try don't complain).

It also doesn't currently run on Windows because it's in a skipped
section on Windows, but if moved out of that section, the test returns
"no".

So, we remove any configure test for the feature, in favor of
preprocessor checks in nsTraceRefcnt.cpp.

Depends on D18055

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

--HG--
extra : moz-landing-system : lando
2019-01-30 14:25:33 +00:00
Dorel Luca e1e5c4c775 Backed out 4 changesets (bug 1521191) for causing leaks on multiple tests
Backed out changeset 138e162d2778 (bug 1521191)
Backed out changeset 3782d011cc9f (bug 1521191)
Backed out changeset 38d3da4804d7 (bug 1521191)
Backed out changeset d6ce4b187195 (bug 1521191)
2019-01-26 03:23:40 +02:00
Andrew McCreight 0eb5d04802 Bug 1521191, part 1 - Add method to disable dump statistics. r=froydnj
In order to test the test harness's handling of a process failing to
produce a leak log, add a special function that disables the bloat log
output.

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

--HG--
extra : moz-landing-system : lando
2019-01-24 21:30:44 +00: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
Andrew McCreight b8e492eeff Bug 1508818, part 5 - Disable Clang formatting in a few places in xpcom/. r=froydnj
nsCRTGlue.cpp has a few data tables that get broken up badly by
clang-format, so just disable the formatting. There are some more
tables in this file, but the arrangement doesn't seem to matter for
them.

The bloat log header is just a little bit of ASCII art, so just ignore
it in formatting so it is easier to read.

MOZ_COLLECT_REPORT uses very wide string constants that get rewrapped
in an ugly way by clang-format, so just disable the formatting for
them.

Depends on D13185

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

--HG--
extra : moz-landing-system : lando
2018-11-28 21:06:13 +00:00
Andrew McCreight ec00ed2fca Bug 1508818, part 4 - Rearrange various string literals so they fit in 80 columns. r=froydnj
clang-format doesn't seem to reflow text when a single string constant
is represented as multiple lines of string literals to fit within 80
columns. Instead, if a single string literal is too long, it breaks
off a piece and moves it to the next line, which leads to a bunch of
choppy short string bits. The resulting string literals are still a
bit choppy, mostly because I didn't want to break up the long names of
prefs.

Here's an example of what I mean:

|--- max width --- |
"some long string literal"
"is here but it goes on for multiple lines"

This gets turned into:

|--- max width --- |
"some long string "
"literal"
"is here but it "
"goes on for multiple lines"

My patch manually would turn this into:

|--- max width --- |
"some long string "
"literal is here "
"but it goes on "
"for multiple lines"

The strings in my patch don't always end up at column 80, because the
width is set to work with wherever clang format ends up actually
indenting them.

There are more instances of this problem when MOZ_COLLECT_REPORT is
used, but that can be dealt with in another bug. There are a ton of
them.

Depends on D13184

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

--HG--
extra : moz-landing-system : lando
2018-11-28 21:06:53 +00:00
Andrew McCreight 68a1d4dad7 Bug 1508818, part 3 - Shrink comments so they don't get poorly reflowed by clang-format. r=froydnj
Clang format does not always reflow comments correctly to get them
within 80 columns.

The major categories of failures I have noticed in xpcom/ are:

- Comments that are lists. I fixed these by manually getting them so
  they'll be within 80 columns after clang-format runs.

- Comments intermixed with lists of things like enums, initializers,
  or even fields in a class. It doesn't seem to associate the comment
  with the item in the list correctly. The worst cases of these happen
  when it changes initializer lists from having commas at the start of
  each item to having them at the end. In the initializer comma cases,
  I fixed them by making the commas at the end, so clang-format won't
  mix things up. For other cases, I often moved the comment for an
  item onto its own line, because it was not possible to have both the
  comment and the item on the same line and stay within 80 columns.

- One odd case is nsEnumeratorUtils.cpp, where the end of line comment
  after a NS_DECL macro confused clang-format and made it stop
  realizing that the NS_DECL thing was a complete statement. I also
  added a blank line to that file before a declaration because I think
  that is better.

Depends on D13183

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

--HG--
extra : moz-landing-system : lando
2018-11-28 21:06:09 +00:00
Masatoshi Kimura 019eed26b0 Bug 1485224 - Make best efforts to write a stack frame atomically. r=froydnj
--HG--
extra : rebase_source : d8d4d9b7fcb98963ceebea10daedaba2ae48caa6
2018-09-13 19:22:18 +09:00
Brian Hackett 474e450289 Bug 1207696 Part 5l - Don't trace refcounts while recording or replaying, r=froydnj.
--HG--
extra : rebase_source : 7e410db1606f7b0fedd6a4483da908e6244ec6b5
2018-07-23 14:40:18 +00:00
Eric Rahm cf21a1de96 Bug 1442765 - Part 2: Switch nsTraceRefcnt's hashtables to use xpcom hashtables. r=mccr8
--HG--
extra : rebase_source : 5fecdd86a3ef27d211cb43d4c602162db7554f2f
2018-03-05 16:50:00 -08:00
Andi-Bogdan Postelnicu 78304aaf0d Bug 1453795 - XPCOM - Initialize member fields in classes/ structures. r=froydnj
--HG--
extra : rebase_source : c9d9e80b83ad52d8ac9203f491f1c9469a7e9b0c
extra : amend_source : ca502ae98ff21a2e3d1ab2d389310f3a5aded5ed
2018-06-15 14:41:20 +03:00
Karl Tomlinson 9e0c1c7c2b bug 1442776 make CycleCollectedJSContext accessible from JSContext private r=peterv
Inheriting PerThreadAtomCache on CycleCollectedJSContext permits use of
static_cast, avoiding one level of indirection compared to adding a
CycleCollectedJSContext* to PerThreadAtomCache.

PerThreadAtomCache is over 18kB, and so WorkerJSContext and WorkletJSContext
are moved from the stack to the heap.

MozReview-Commit-ID: 6jdJeZcviK4

--HG--
extra : rebase_source : 3c2accb71faf3f017a44c405ae0484e57aaf039c
2018-05-10 17:04:12 +12:00
Nathan Froyd 32dc58b2ba Bug 1451255 - make nsTraceRefcnt handle multibyte characters in log files; r=mccr8
...on Windows, at least.  Apparently if you have environment variables
set that contain multibyte characters, and ask for them with getenv, you
get garbage.  Or perhaps you get something sensible, but then passing it
to fopen produces garbage.  Either way, the most reasonable way to
handle this is to use the Windows wide-character APIs all over.
2018-04-17 10:13:42 -04:00
Sebastian Hengst 0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Karl Tomlinson 2405fe930c bug 1328964 use nsContentUtils::GetCurrentJSContext() on all threads r=smaug
nsContentUtils::GetCurrentJSContextForThread() originally needed to use
workers::GetCurrentThreadJSContext() in
https://hg.mozilla.org/mozilla-central/rev/366a45b41539#l2.18
because CycleCollectedJS*()->Context() did not exist until
https://hg.mozilla.org/mozilla-central/rev/1a0cd542e1e9#l7.12

nsContentUtils::GetCurrentJSContext() is thread-safe since these changes:
https://hg.mozilla.org/mozilla-central/rev/e636c7186286#l3.12
https://hg.mozilla.org/mozilla-central/rev/c8029c072776#l2.12

MozReview-Commit-ID: 2f1eGS9uBBO

--HG--
extra : rebase_source : dad1d2084a63413c3975f9e7c66c6b06857c9f23
2018-04-09 12:11:18 +12:00
Tristan Bourvon a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Andrew McCreight 9d063bfac8 Bug 1420975 - Add a environment variable to record JS stack for leaks. r=froydnj,mrbkap
This patch adds a new environment variable XPCOM_MEM_LOG_JS_STACK that
changes XPCOM leakchecking to record a JS stack for all objects, in
addition to a C++ stack. This is useful when a C++ object is being
leaked due to JS. The JS stack will be printed if the object leaks, if
it is used in combination with XPCOM_MEM_BLOAT_LOG=1 and
XPCOM_MEM_LOG_CLASSES=nsFoo, if nsFoo is the class of interest.

This patch moves a few XPConnect functions for recording the stack
into xpcpublic.h so they can be called from nsTraceRefcnt.cpp.

MozReview-Commit-ID: FX2QVCSXz4f

--HG--
extra : rebase_source : 5bd4e341072f4cf7d3be774b63d2107479fe9985
2018-01-10 14:02:45 -08:00
Andrew McCreight 4e452aadbf Bug 1410209, part 3 - Use Runnable::mName for the class name with XPCOM leak checking. r=smaug
Most subclasses of Runnable don't bother to override AddRef and
Release, so XPCOM leak checking ends up reporting Runnable, which
makes it impossible to know what is actually leaking.

Each subclass of Runnable is already required to pass in the name of
the class, which is stored in the field mName. This patch changes
Runnable to use mName as the class name for XPCOM leak checking, thus
giving each subclass a specific name without needing to change the
hundreds of existing subclasses of Runnable.

The limitation of this approach is the classes that DO use
NS_IMPL_ADDREF/RELEASE_INHERITED end up using the same class name that
is used by the superclass AddRef/Release, but with a different size,
which causes assertions in the leak checker. To work around this, I
change NS_IMPL_ADDREF/RELEASE_INHERITED to not call into
NS_LOG_ADDREF/RELEASE for classes that are a subclass of
Runnable. This needs to use IsConvertible<> and not IsBaseOf<> because
the latter requires the classes involved to be defined, and headers
can use nsISupportsImpl.h without nsThreadUtils.h.

MozReview-Commit-ID: H0pgvwQSZAE

--HG--
extra : rebase_source : 0be13fe2e649e62be1f9471fc03fac43024eb0aa
2017-10-25 13:51:17 -07:00
Chris Peterson 73037a0f6a Bug 1412048 - Replace NS_RUNTIMEABORT(var) with MOZ_CRASH_UNSAFE_OOL(var). r=froydnj data-review=francois
And remove unreachable code after MOZ_CRASH_UNSAFE_OOL().

MOZ_CRASH_UNSAFE_OOL causes data collection because crash strings are annotated to crash-stats and are publicly visible. Firefox data stewards must do data review on usages of this macro. However, all the crash strings this patch collects with MOZ_CRASH_UNSAFE_OOL are already collected with NS_RUNTIMEABORT.

MozReview-Commit-ID: IHmJfuxXSqw

--HG--
extra : rebase_source : 031f30934b58a7b87f960e57179641d44aefe5c5
extra : source : fe9f638a56a53c8721eecc4273dcc074c988546e
2017-10-24 23:38:38 -07: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
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 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