Commit Graph

60 Commits

Author SHA1 Message Date
Ehsan Akhgari
7019ca781d Bug 806209 followup - fix a stupid mistake; irc-r=BenWa 2012-10-29 14:18:14 -04:00
Ehsan Akhgari
c6c8d4cb2c Bug 806209 - Prevent the Windows implementation of NS_StackWalk from accessing the stdio APIs in order to avoid deadlocks when profiling on Windows; r=BenWa
--HG--
extra : rebase_source : cb945d9d3cb162a1177029a6aa097af33f7c917b
2012-10-29 14:03:01 -04:00
Mark Hammond
d269de95a9 Bug 796526 - stop spewing errors re SysGetModuleInfo64 in debug builds. r=dbaron 2012-10-16 11:26:35 +11:00
Isaac Aggrey
65e8d33673 Bug 795507: Remove usage of PR_BEGIN_EXTERN_C and PR_END_EXTERN_C; r=ehsan 2012-09-30 21:10:22 -05:00
Ehsan Akhgari
b5c39afb4e Bug 792502 - Kill the FunctionTimer code; r=vlad 2012-09-19 16:59:38 -04:00
Justin Lebar
06da2b47db Bug 788546 - In our stack-walking code, instead of asserting that we're initialized and failing if we're not, go ahead and initialize ourself when necessary. r=espindola 2012-09-10 15:51:45 -04:00
Aryeh Gregor
5a68b81a9b Bug 783523 - Fix platform-specific nsresult misuse; r=ehsan,tbsaunde,smaug 2012-08-16 14:58:11 +03:00
Ehsan Akhgari
0fd9123eac Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg
This patch was generated by a script.  Here's the source of the script for
future reference:

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRInt8 int8_t
convert PRUint8 uint8_t
convert PRInt16 int16_t
convert PRUint16 uint16_t
convert PRInt32 int32_t
convert PRUint32 uint32_t
convert PRInt64 int64_t
convert PRUint64 uint64_t

convert PRIntn int
convert PRUintn unsigned

convert PRSize size_t

convert PROffset32 int32_t
convert PROffset64 int64_t

convert PRPtrdiff ptrdiff_t

convert PRFloat64 double
2012-08-22 11:56:38 -04:00
Jan Beich
c77fcfe437 Bug 781457 - Define _GNU_SOURCE for _Unwind_Backtrace. r=dbaron 2012-08-10 11:29:59 -04:00
Aryeh Gregor
e806eeab4f Bug 777292 part 2 - Change all nsnull to nullptr 2012-07-30 17:20:58 +03:00
Benoit Girard
168c4b79fb Bug 766579 - Part 3: Follow up fix. r=dbaron 2012-07-10 17:39:10 -04:00
Benoit Girard
7aa6b28d00 Bug 766579 - Part 1: Add SP param to NS_StackWalk. r=dbaron
--HG--
extra : rebase_source : dd4905ffadf5fe9327449fffdfbc665b05d74a6a
2012-06-27 16:08:21 -04:00
Ehsan Akhgari
ec89be8fa6 Bug 767479 - Handle the case of more than 1024 frames when walking the stack of another thread on Windows, and also use the infallible allocator when walking the stack of your own thread; r=dbaron 2012-06-22 16:31:59 -04:00
Ehsan Akhgari
e257354180 Bug 767488 - Cache the current process handle after reading it for the first time during stack walking; r=dbaron
The current process handle never changes, so it doesn't make a lot of sense
to read it over and over again.  Note that this doesn't close the process
handle explicitly but that's fine, since Windows will release all of the
open handles when the application is terminated.
2012-06-22 17:48:31 -04:00
Gervase Markham
ca171eec44 Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Jeff Muizelaar
26f4612385 Bug 719427. Add a comment about malloc_logger. r=espindola 2012-03-27 13:48:58 -04:00
Ehsan Akhgari
d206b44feb Bug 737959 - Fix the startup crash with MallocStackLogging; r=bsmedberg 2012-03-22 13:18:36 -04:00
Jeff Muizelaar
67d9b4c911 Bug 732806. Make stackwalking respect the stack end on OS X. r=ehsan
This will help us avoid some crashes.
2012-02-15 00:17:34 -05:00
Ehsan Akhgari
6844e12df3 Bug 733264 - Define FramePointerStackWalk on platforms where stackwalking is not supported; r=jrmuizel 2012-03-06 11:38:04 -05:00
Cameron McCormack
6efa10fcb3 Bug 732664 - Use FormatMessageA so that XPCOM stack walker prints error message correctly. r=dbaron 2012-03-06 10:04:40 +11:00
Masatoshi Kimura
28f2776f50 Bug 699247 - Remove Win2K related code. r=jimm, sr=neil 2012-02-23 08:53:55 -06:00
Jeff Muizelaar
d1be62a4ef Bug 724079. Add an internal stackwalk API. r=ehsan
This will be used by the profiler to be able to unwind arbitrary threads.
2012-02-03 15:13:24 -05:00
Ed Morley
ad5a8e1d06 Backout f1acc52a59da (bug 719983) & 6771bd53e267 (bug 699247) for 30% WinXp Ts regression 2012-02-08 21:04:21 +00:00
Masatoshi Kimura
88ba00973a Bug 699247 - Say goodbye to Win2k related code. r=jimm, sr=neil 2012-02-08 10:00:45 -06:00
Ehsan Akhgari
c83b553615 Bug 718032 - Make stackwalking for other threads cheaper on Windows by avoiding involving a third walker thread; r=jrmuizel 2012-01-26 11:57:23 -05:00
Vladan Djeric
68060606a9 Bug 716590 - WalkStackMain64 shouldn't skip frames unless it's walking the thread that called NS_StackWalk. r=dbaron 2012-01-23 17:21:23 -05:00
Ehsan Akhgari
44f218c3d4 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
Rafael Ávila de Espíndola
03f0b2e63d Bug 708031 - refactor the ifdefs in nsStackWalk.cpp. r=dbaron.
--HG--
extra : rebase_source : 806f8437d30787c59e0059054c094fee77b5dce3
2011-12-22 11:00:48 -05:00
Javi Rueda
313b993b78 Bug 379342 - Remove Win95/Win98 support code in XPCom; r=bsmedberg a=removal 2011-12-13 14:17:58 +00:00
Rafael Ávila de Espíndola
bb57c6b547 Bug 707648 - Only try to init the critical range if we are able to walk the stack. r=ehsan. 2011-12-06 14:26:49 -05:00
Rafael Ávila de Espíndola
561bf65f37 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
cbca29d21a 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
b573c23826 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
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
Jeff Walden
b7753477cf Bug 693469 - Implement mozilla::ArrayLength and mozilla::ArrayEnd, and replace uses of NS_ARRAY_LENGTH whenever possible. (Exceptions: assigning to static initializers, use in static assertions, as template parameters, etc. These will go away when the relevant compilers have C++11 constexpr support.) r=cjones
--HG--
extra : rebase_source : b4bae9a0f85abf2feb828609b50e756916b99a6f
2011-10-10 22:50:08 -07:00
Jeff Walden
eb2cb918a4 Back out everything since 5435ee09cf7b. Tinderbox compilers hate me. r=epic-fail 2011-10-12 12:21:53 -07:00
Jeff Walden
77ebbde4ab Bug 639469 - Implement mozilla::ArrayLength and mozilla::ArrayEnd, and replace uses of NS_ARRAY_LENGTH whenever possible. r=cjones
--HG--
extra : rebase_source : 860a8271bf7e51cde358f2a4185c410de1fc2960
2011-10-10 22:50:08 -07: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
Ed Morley
aa86759d37 Bug 652506 - Remove WinCE code from xpcom; r=bsmedberg 2011-05-01 20:59:24 +02:00
Jory A. Pratt
b8260165be Bug 593911 - Check for dlopen in the libc too. r=khuey a=bsmedberg 2010-11-05 18:26:51 +01:00
Jacek Caban
7393907967 Bug 569586 - XPCOM compilation failure on mingw-w64 due to pointer to int cast loosing precision. r=benjamin
--HG--
extra : rebase_source : e4d0b0b110992af5f397aea52c36a5f5ed9f56c5
2010-06-25 14:02:24 +02:00
Ehsan Akhgari
a87b134220 Bug 560647 - add startup timeline instrumentation; r=vlad 2010-05-19 19:22:19 -04:00
Makoto Kato
64ceec236c Bug 475229 - xpcom/base/nsStackWalk support for Windows x64. r=benjamin 2009-03-22 12:53:47 +09: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
Brad Lassey
4342224fbe Bug 455381 - WinCE XPCOM Explicit Unicode API Calls, Wide Char CheckVersion Function r=bsmedberg 2008-12-03 08:41:12 -05:00
roc+@cs.cmu.edu
1359e3a201 Bug 417903. Don't crash if _SymGetLineFromAddr64 fails. r=benjamin,a=beltzner 2008-02-24 17:16:41 -08: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
karlt+@karlt.net
e6cd923439 Bug 326594 - Consider using backtrace() for Unix stack traces: Add safety checks to i386/ppc unwind and use libgcc_s for amd64 and others r=dbaron,bsmedberg a=schrep 2007-11-11 20:45:40 -08:00