Commit Graph

65 Commits

Author SHA1 Message Date
Justin Lebar
62dbeeb1ab Bug 731789 - Rename mfbt/StdInt.h to mfbt/StandardInteger.h, so stdint types work from cpp files inside mfbt. r=waldo 2012-02-29 22:56:43 -05:00
Ehsan Akhgari
c62bdde145 Bug 713278 - Teach NS_StackWalk to walk the stack of other threads too on Windows; r=dbaron 2011-12-23 18:14:09 -05:00
Jeff Walden
2cc32b18f2 Bug 711799 - Fix a few implicit-declaration warnings in trace-malloc. r=dbaron
--HG--
extra : rebase_source : 16fe9eb68d2db1488d89af4001e7d316cb110330
2011-12-17 22:56:55 -05:00
Matt Brubeck
efc97fe9ac Back out bcf9ce858829 and a3bade82ac92 (bug 711799) for build failures 2011-12-19 10:43:08 -08:00
Jeff Walden
0c04766c32 Bug 711799 - Fix a few implicit-declaration warnings in trace-malloc. r=dbaron
--HG--
extra : rebase_source : 67dc7295b8a2022e02f892f7eac74414e61b1c86
2011-12-17 22:56:55 -05:00
Jeff Walden
476c7d19c5 Bug 708735 - Use <stdint.h> types in JSAPI and throughout SpiderMonkey. Continue to provide the {u,}int{8,16,32,64} and JS{Uint,Int}{8,16,32,64} integer types through a single header, however, for a simpler backout strategy -- and also to ease the transition for embedders. r=timeless on switching the jsd API to use the <stdint.h> types, r=luke, r=dmandelin 2011-12-08 22:54:10 -05:00
Rafael Ávila de Espíndola
c171f20afb Bug 696376 - Change how we find critical ranges so that it works on 10.6 too. r=dbaron.
Currently we use dlsym on pthread_cond_wait$UNIX2003 to find a
function that indicates that new_sem_from_pool is on the stack. This
works on 10.5, but on 10.6 I could not find a single reliable
indicator that would work with dlsym.

The good news is that dladdr works with any symbol, not just exported
ones. To find the address of new_sem_from_pool, we set up a malloc logger
and force a call to new_sem_from_pool. From the logger callback we walk
the stack trying dladdr on every address.

To force a call to new_sem_from_pool, the initialization code has to be the
first to use semaphores, so it is now run from NS_LogInit.

This works on 10.6 and 10.5 (but we have to look for
"pthread_cond_wait$UNIX2003"). In 10.7 the call to malloc is gone, so we don't
have to worry about critical addresses on it anymore.

--HG--
extra : rebase_source : bba4ac9e3378c88f7037aa884511e473a57121f6
2011-12-02 19:26:04 -05:00
Chris Lord
3ae56ad4cd Backout bug 696376
This broke building on android due to requiring a newer version of unwind.h.
2011-12-02 18:00:58 +00:00
Rafael Ávila de Espíndola
7a8af51b1f Bug 696376 - Change how we find critical ranges so that it works on 10.6 too. r=dbaron.
Currently we use dlsym on pthread_cond_wait$UNIX2003 to find a
function that indicates that new_sem_from_pool is on the stack. This
works on 10.5, but on 10.6 I could not find a single reliable
indicator that would work with dlsym.

The good news is that dladdr works with any symbol, not just exported
ones. To find the address of new_sem_from_pool, we set up a malloc logger
and force a call to new_sem_from_pool. From the logger callback we walk
the stack trying dladdr on every address.

To for a call to new_sem_from_pool, the initialization code has to be the
first to use semaphores, so it is now run from NS_LogInit.

This works on 10.6 and 10.5 (but we have to look for
"pthread_cond_wait$UNIX2003"). In 10.7 the call to malloc is gone, so we don't
have to worry about critical addresses on it anymore.
2011-12-01 18:22:00 -05:00
Rafael Ávila de Espíndola
7852254683 Bug 696376 - If stacks_enabled is false, only walk the stack on OS X 32 bits. r=
dbaron.
The 64 bit stack walks lack the InCriticalRange functionality and it looks like
the extra walks are causing an orange on leaktest on the bot.

--HG--
extra : rebase_source : 4c0a75892e30a6e522ed981a1ff12df99d2a0464
2011-11-04 09:49:48 -04:00
Rafael Ávila de Espíndola
40e5be23cc Bug 696281 - disable trace malloc stacks on OS X too. r=dbaron.
This patch disables trace malloc stacks on OS X too. To make this work,
we still have to look on the stack to decide if we must set immediate_abort,
but we can avoid other work like decoding the addresses.
2011-10-28 18:43:49 -04:00
Ehsan Akhgari
2a602a5685 Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Landing on a CLOSED TREE
2011-10-17 10:59:28 -04:00
Michael Wu
d8e503c38b Bug 675553 - Switch from PRBool to bool on a CLOSED TREE , r=bsmedberg,khuey,bz,cjones
--HG--
rename : tools/trace-malloc/bloatblame.c => tools/trace-malloc/bloatblame.cpp
2011-09-28 23:19:26 -07:00
Mike Hommey
95fbb011b5 Bug 658995 part 2 - Use static destructors instead of atexit(). r=bsmedberg 2011-06-15 07:32:03 +02:00
Matt Brubeck
28a99ad4d4 Back out 6b23b52e68d6 - e92f98e8a335 (bug 632404, 552864, 658995) because of Tp4 regression. 2011-06-15 09:00:28 -07:00
Mike Hommey
899e31b0e1 Bug 658995 part 2 - Use static destructors instead of atexit(). r=bsmedberg 2011-06-15 07:32:03 +02:00
Ed Morley
223c46b36b Bug 659621 - Remove EXTRA_DSO_LIBS, EXTRA_DSO_LDOPTS, OS_LIBS from makefiles containing LIBXUL_LIBRARY = 1, now that libxul is always built; r=ted 2011-06-12 03:49:00 -04:00
Chris Jones ext:(%20and%20Kyle%20Huey%20%3Ckhuey%40kylehuey.com%3E)
0bb511a3d7 Rollup of bug 645263 and bug 646259: Switch to mozilla:: sync primitives. r=cjones,dbaron,doublec,ehsan src=bsmedberg
Bug 645263, part 0: Count sync primitive ctor/dtors. r=dbaron
Bug 645263, part 1: Migrate content/media to mozilla:: sync primitives. r=doublec
Bug 645263, part 2: Migrate modules/plugin to mozilla:: sync primitives. sr=bsmedberg
Bug 645263, part 3: Migrate nsComponentManagerImpl to mozilla:: sync primitives. sr=bsmedberg
Bug 645263, part 4: Migrate everything else to mozilla:: sync primitives. r=dbaron
Bug 645263, part 5: Remove nsAutoLock.*. sr=bsmedberg
Bug 645263, part 6: Make editor test be nicer to deadlock detector. r=ehsan
Bug 645263, part 7: Disable tracemalloc backtraces for xpcshell tests. r=dbaron
Bug 646259: Fix nsCacheService to use a CondVar for notifying. r=cjones
2011-03-31 23:29:02 -05:00
Chris Jones
a75fb12531 Backed out changeset 4beec31b9ea9 for increasing frequency of intermittent orange bug 618052 2011-03-31 18:57:38 -05:00
Chris Jones ext:(%20and%20Kyle%20Huey%20%3Ckhuey%40kylehuey.com%3E)
cc8b4c9c6c Rollup of bug 645263 and bug 646259: Switch to mozilla:: sync primitives. r=cjones,dbaron,doublec,ehsan src=bsmedberg
Bug 645263, part 0: Count sync primitive ctor/dtors. r=dbaron
Bug 645263, part 1: Migrate content/media to mozilla:: sync primitives. r=doublec
Bug 645263, part 2: Migrate modules/plugin to mozilla:: sync primitives. sr=bsmedberg
Bug 645263, part 3: Migrate nsComponentManagerImpl to mozilla:: sync primitives. sr=bsmedberg
Bug 645263, part 4: Migrate everything else to mozilla:: sync primitives. r=dbaron
Bug 645263, part 5: Remove nsAutoLock.*. sr=bsmedberg
Bug 645263, part 6: Make editor test be nicer to deadlock detector. r=ehsan
Bug 645263, part 7: Disable tracemalloc backtraces for xpcshell tests. r=dbaron
Bug 646259: Fix nsCacheService to use a CondVar for notifying. r=cjones
2011-03-31 14:51:19 -05:00
L. David Baron
488055346f Initialize the out param from backtrace(). (Bug 549561) r=bsmedberg a2.0=tests 2010-09-21 19:32:48 -07:00
L. David Baron
b04b6fac7d Add environment variable NS_TRACE_MALLOC_DISABLE_STACKS for disabling the stack-walking part of trace-malloc to improve performance of tinderbox test machines. (Bug 549561) r=bsmedberg a2.0=tests 2010-08-19 09:37:59 -04:00
L. David Baron
301610bb9d Avoid a lock/unlock pair for each call to |calltree|. (Bug 549561) r=bsmedberg a2.0=tests 2010-08-19 09:37:59 -04:00
Pirkka Kärenlampi
e5d4a986ff Bug 586944. Make 'backtrace' static to fix issues with the symbol being overriden by system libraries. r=dbaron,a=bsmedberg 2010-08-19 21:35:08 +12:00
L. David Baron
ccaa0e2983 Make trace-malloc work again on Linux following mozalloc landing. (Bug 576776) r=cjones 2010-07-16 22:36:34 -07:00
Makoto Kato
3202600c4c Bug 568467 - trace-malloc support for Windows x64. r=dbaron 2010-06-04 16:53:02 +09:00
Chris Jones
e732815453 Bug 560969: Teach trace-malloc about VC10. r=dbaron 2010-04-27 00:43:04 -05:00
L. David Baron
228ef7bfc2 Make trace-malloc malloc hooks work with 64-bit Mac OS X by adjusting types. (Bug 558097, maybe) 2010-04-08 17:21:03 -07:00
Chris Jones
7c959e67d7 Bug 551254: Allow reviewed+approved STL headers to be included through <foo>. (<algorithm> and <vector> are provisionally in the list because of their use in libpr0n, but need to be reviewed in followup bug 556700 and bug 556701). r=ehsan,ted,zwol 2010-04-02 12:58:11 -05:00
Chris Jones
2050fcae22 Bug 529134: Initialize tracemalloc in NS_LogInit() to ensure that tracemalloc is always thread safe. r=bsmedberg r=dbaron 2009-12-29 16:45:59 -06:00
Benjamin Smedberg
2e9438fd2f Followup to bug 398573 - remove REQUIRES from the tree since it is no longer used... automatically generated patch, rs=ted 2009-08-25 08:59:31 -07:00
L. David Baron
f69c0d0ad5 Don't rely on NS_TraceMallocStartupArgs to initialize TLS index. (Bug 442192) r=brendan 2009-03-11 07:51:30 -07:00
Ben Turner
ba731dee87 Bustage fix for bug 478195. 2009-02-17 21:51:50 -08:00
Robert O'Callahan
9d8186e0e0 Bug 478195 - '[Mac] Same-thread deadlock with trace-malloc (causing random red on OS X 10.5.2 mozilla-central leak test build)'. r=dbaron. 2009-02-17 21:11:29 -08:00
Arpad Borsos
8b11d938d2 Bug 456388 - Remove PR_STATIC_CALLBACK and PR_CALLBACK(_DECL) from the tree; r+sr=brendan 2008-10-10 17:04:34 +02:00
Ben Turner
de0ede1dc2 Bug 435122 - "Use TraceMalloc to get stack traces of potential deadlocks". r=bsmedberg+dbaron. 2008-06-26 10:12:42 -07:00
L. David Baron
5ff950ec54 Fix broken --shutdown-leaks argument handling on Windows by copying the argument out of argv rather than holding a pointer to it. b=433708 r=pavlov 2008-05-14 11:57:32 -07:00
dbaron@dbaron.org
84ec4d87d0 Expose trace-malloc stack tracing. b=422847 r=brendan a=NPOTDB 2008-03-14 17:11:37 -07:00
dbaron@dbaron.org
c861e5a715 And actually get the right bug number. b=415426 (which is what the previous checkin was for as well) 2008-02-03 11:59:07 -08:00
dbaron@dbaron.org
3896f75022 Switch back to evil casts, which are the only solution that works across SDK version. b=415252 2008-02-03 11:51:14 -08:00
dbaron@dbaron.org
4425004b4d Match new (more-const) signature for PENUMLOADED_MODULES_CALLBACK and PENUMLOADED_MODULES_CALLBACK64. b=415426 Fixing bustage on Windows tinderbox from SDK upgrade. 2008-02-03 11:34:31 -08:00
dbaron@dbaron.org
761ae96f72 Fix race saving/restoring malloc hooks by going back to overriding malloc, etc., plus some additional cleanup. b=392009 r+a1.9=brendan 2007-09-28 15:39:59 -07:00
dbaron@dbaron.org
da4d6cf178 Address brendan's review comments on bug 391141. r=brendan a=not part of release builds 2007-09-27 09:27:12 -07:00
dbaron@dbaron.org
3ceebe55ad Suppress tracing around calls into original allocators, in case they recur back into our hooks. Fixes most of leak *stats* regression from bug 392009. r+a1.9=brendan 2007-09-25 13:33:37 -07:00
brendan@mozilla.org
5796722d5b Reduce code duplication among platforms, support hooking and unhooking (392009, r=dbaron). 2007-09-24 18:13:17 -07:00
dbaron@dbaron.org
a966e89ed8 Revert previous checkin. 2007-08-19 17:59:57 -07:00
dbaron@dbaron.org
3281511c0d Attempt to fix trace-malloc bustage in libxul builds by removing LIBXUL_LIBRARY=1 (fixing tinderbox bustage for newly-enabled test). 2007-08-19 17:50:01 -07:00
dbaron@dbaron.org
881a6d3689 Port trace-malloc to Mac OS X. b=392118 r+a=brendan 2007-08-14 09:35:46 -07:00
dbaron@dbaron.org
bcfba5e648 Make void signatures match header. b=391766 r+a=brendan 2007-08-10 17:53:28 -07:00
dbaron@dbaron.org
a991022e1d Lock around NS_TraceMallocDumpAllocations. b=391766 r+a=brendan 2007-08-10 17:53:02 -07:00