Commit Graph

145 Commits

Author SHA1 Message Date
marco
bce375dc3a --- Merging r31434 into '.':
U    rtl/inc/heaptrc.pp
--- Recording mergeinfo for merge of r31434 into '.':
 U   .

# revisions: 31434

git-svn-id: branches/fixes_3_0@33861 -
2016-05-31 05:59:35 +00:00
marco
158da745d0 --- Merging r29678 into '.':
U    rtl/win64/seh64.inc
--- Recording mergeinfo for merge of r29678 into '.':
 U   .
--- Merging r29692 into '.':
U    rtl/inc/system.inc
U    rtl/win64/system.pp
G    rtl/win64/seh64.inc
--- Recording mergeinfo for merge of r29692 into '.':
 G   .
--- Merging r29713 into '.':
U    rtl/inc/systemh.inc
G    rtl/inc/system.inc
U    rtl/inc/heaptrc.pp
--- Recording mergeinfo for merge of r29713 into '.':
 G   .
--- Merging r29733 into '.':
G    rtl/inc/system.inc
--- Recording mergeinfo for merge of r29733 into '.':
 G   .
--- Merging r29739 into '.':
G    rtl/inc/system.inc
--- Recording mergeinfo for merge of r29739 into '.':
 G   .

# revisions: 29678,29692,29713,29733,29739
------------------------------------------------------------------------
r29678 | sergei | 2015-02-13 06:02:20 +0100 (vr, 13 feb 2015) | 2 lines
Changed paths:
   M /trunk/rtl/win64/seh64.inc

* Win64 SEH: don't call RunError in exception handler, because it always prints backtrace from caller's context. Instead, print the correct backtrace explicitly.

------------------------------------------------------------------------
------------------------------------------------------------------------
r29692 | sergei | 2015-02-14 12:41:33 +0100 (za, 14 feb 2015) | 1 line
Changed paths:
   M /trunk/rtl/inc/system.inc
   M /trunk/rtl/win64/seh64.inc
   M /trunk/rtl/win64/system.pp

* Win64: Use separate implementation of CaptureBacktrace that calls RtlCaptureStackBackTrace. This way it does not require non-optimized code to work correctly.
------------------------------------------------------------------------
------------------------------------------------------------------------
r29713 | sergei | 2015-02-15 21:00:24 +0100 (zo, 15 feb 2015) | 2 lines
Changed paths:
   M /trunk/rtl/inc/heaptrc.pp
   M /trunk/rtl/inc/system.inc
   M /trunk/rtl/inc/systemh.inc

+ Overloaded procedure dump_stack that calls CaptureBacktrace, thus encapsulating internals of stack traversing.
* Use this new procedure in heaptrc unit.
------------------------------------------------------------------------
------------------------------------------------------------------------
r29733 | sergei | 2015-02-16 23:05:54 +0100 (ma, 16 feb 2015) | 7 lines
Changed paths:
   M /trunk/rtl/inc/system.inc

* Finalize units after printing the runtime error message. Rationale:
  * Unit finalization executes arbitrarily large amount of code. Doing it when error occurred can cause
    other errors, overwriting the original error information.
  * Code that prints error message depends on everything and a kitchen sink (most notably, Unicode manager
    and lineinfo unit). Running it after finalizing units can be successful only by coincidence.
  * Last but not least, this sequence (ExitProc -> print RTE -> finalize units) is same as one used in Delphi.

------------------------------------------------------------------------
------------------------------------------------------------------------
r29739 | pierre | 2015-02-17 08:35:31 +0100 (di, 17 feb 2015) | 1 line
Changed paths:
   M /trunk/rtl/inc/system.inc

 Revert aligntoptr to RTTIAlign rename
------------------------------------------------------------------------

git-svn-id: branches/fixes_3_0@33410 -
2016-04-02 16:35:37 +00:00
sergei
baa18dfcb4 * Introduced a new function CaptureBacktrace, using it to handle most of back-tracing in heaptrc unit.
* Use StackTop instead of StackBottom+StackLength in a few remaining locations.

git-svn-id: trunk@27141 -
2014-03-15 05:16:37 +00:00
sergei
5ddb267d57 * Clean up/refactor stack back-tracing code, reducing overall amount of checks and rejecting range from StackBottom to <current frame>.
git-svn-id: trunk@27097 -
2014-03-11 16:29:20 +00:00
sergei
3b5552ae75 - Killed 'goto'.
git-svn-id: trunk@27096 -
2014-03-11 15:16:00 +00:00
nickysn
c1b0fb81f1 * updated all the RTL helper functions related to exceptions and stack traces to use codepointer instead of pointer
git-svn-id: trunk@25513 -
2013-09-17 21:25:26 +00:00
Jonas Maebe
69c29a415f * pass the procdef to getintparaloc instead of only the proccalloption, so
that the type of the parameters can be determined automatically
   o added compilerproc declarations for all helpers called in the compiler
     via their assembler name, so we can look up the corresponding procdef

git-svn-id: trunk@23325 -
2013-01-06 15:05:40 +00:00
florian
ddc054be79 * patch by Cyrax for easy redirection of heaptrc output, resolves #22168
git-svn-id: trunk@22922 -
2012-11-04 14:07:57 +00:00
pierre
f340ef87e3 * get_addr function renamed to get_pc_addr
+ get_caller_stackinfo procedure added.

git-svn-id: trunk@21707 -
2012-06-25 22:17:49 +00:00
pierre
00ca9b4ce5 + Support multithreaded windows executables inCheckPointer function
git-svn-id: trunk@20181 -
2012-01-26 13:52:51 +00:00
florian
0cc53cc5df + patch from Benito van der Zander to enable heaptrc to dump leaked or faulty memory blocks (function disabled by default), resolves #19691
git-svn-id: trunk@18231 -
2011-08-16 20:47:15 +00:00
sergei
d11d08af73 * heaptrc.pp: In case of early multithreading initialization, initialize all related items (namely, main_relo_todolist), not just the critical section. main_relo_todolist is used later without assigned checks, and it is also used as a flag to destroy the critical section.
git-svn-id: trunk@17937 -
2011-07-05 08:49:24 +00:00
pierre
04d85d32d9 * Disable inline for FPC_HEAPTRC_EXTRA to facilitate cdebugging with GDB
git-svn-id: trunk@17890 -
2011-07-01 07:50:51 +00:00
florian
e6648da567 * make heaptrc aware of the fact that multi threading could be initialized before heaptrc itself is initialized, this is currently the case for windows dlls
git-svn-id: trunk@14560 -
2010-01-07 13:41:43 +00:00
Jonas Maebe
0eec337a00 - removed SUPPORT_UNALIGNED, FPC_SUPPORTS_UNALIGNED and FPC_UNALIGNED_FIXED
defines and ifdefs (already all defined by 2.2.4)

git-svn-id: trunk@13581 -
2009-08-23 07:51:26 +00:00
Jonas Maebe
9ed40aa926 - reverted r13079, it gives wrong results when using heaptrc with an
program that does nothing. It was also not logical, because the expected
    free heap at the end is the total heap size minus any allocated blocks
    and minus the memory that was allocated before heaptrc was activated
    (as the old code calculated, and as it does again now -- mantis #13678)

git-svn-id: trunk@13124 -
2009-05-10 09:28:47 +00:00
micha
c9bea201ce * heaptrace: fix calculation of expected free heap
git-svn-id: trunk@13080 -
2009-05-02 13:48:23 +00:00
Jonas Maebe
f9a17c47bd * write output to screen if log file(s) cannot be opened (mantis #12532)
git-svn-id: trunk@13032 -
2009-04-24 13:28:06 +00:00
giulio
50cd527d30 Checkpointer: consider bss section too for go32v2 (webtbs/tw3661 now works)
git-svn-id: trunk@10967 -
2008-05-14 13:08:11 +00:00
yury
6a36ac786a * Fixed warnings.
git-svn-id: trunk@9095 -
2007-11-03 10:36:27 +00:00
yury
05f718fbd2 * Fixed warnings and notes.
git-svn-id: trunk@9044 -
2007-11-01 15:45:33 +00:00
florian
7cea844223 * more crash fixes
git-svn-id: trunk@9042 -
2007-11-01 14:52:22 +00:00
florian
9472497e5b * finally fixed heaptrc for win64
git-svn-id: trunk@9032 -
2007-11-01 11:42:39 +00:00
florian
7f4c387841 o new BeOS patch by Olivier Coursiere:
* correctly define the stack size for BeOS,
  + implement a minimum nl_langinfo function to correctly initialize WideString support
  + add fgl unit in the BeOS RTL makefile
  * SysOSAlloc now return nil when the system can not allocate the asked memory,
  * HAS_SYSOSFREE is no more defined with an empty implementation under BeOS. This was preventing FPC to reuse memory.
  + there is now a basic implementation of CheckPointer under BeOS.

git-svn-id: trunk@8994 -
2007-10-29 19:00:32 +00:00
florian
a221785d0b * try to read caller address only when we got a proper base pointer
git-svn-id: trunk@8960 -
2007-10-27 20:23:17 +00:00
daniel
0c3a2a257d * Convert heap to ptruint.
git-svn-id: trunk@7950 -
2007-07-04 19:46:47 +00:00
micha
b4363e046b * fix heaptrace segfault, access of lost block
git-svn-id: trunk@7806 -
2007-06-24 21:33:29 +00:00
micha
a70f5bb51e * fix lock release in heap trace
git-svn-id: trunk@7782 -
2007-06-23 09:35:47 +00:00
micha
c0fa8fd255 * heap manager: fix thread exit race condition by using single global lock
fix finishing to be freed list in orphaned list context
  fix heaptrace finalization

git-svn-id: trunk@7752 -
2007-06-20 21:10:35 +00:00
micha
3b7792ead1 * heaptrace: cleanup orphaned lock only in case of threading used
also improve readability of zeroing LSB

git-svn-id: trunk@7726 -
2007-06-18 21:05:32 +00:00
Jonas Maebe
0a10f521f6 * added {$inline on} directive to fix compilation with 2.0.4
git-svn-id: trunk@7658 -
2007-06-14 07:25:47 +00:00
micha
c226f6fd44 * heap manager: handle freeing of block owned by exited thread
* heap trace: ditto

git-svn-id: trunk@7649 -
2007-06-13 20:27:42 +00:00
Jonas Maebe
79e84ba129 * fixed add_tail functionality for cpus which require natural
alignment

git-svn-id: trunk@7471 -
2007-05-25 12:02:08 +00:00
micha
e989730f34 * initialize/finalize critical sections in heaptrace properly
git-svn-id: trunk@7419 -
2007-05-22 15:34:46 +00:00
micha
7f2a257102 + heap manager now per thread, reduce heap lock contention
+ heap threading test

git-svn-id: trunk@7407 -
2007-05-20 20:58:12 +00:00
pierre
9137533864 Patch from Vincent Snijders, sent to fpc-devel
add the same sanity check for the frame pointer
  in TraceReAllocMem as already is in TraceGetMem.

git-svn-id: trunk@7086 -
2007-04-10 22:14:47 +00:00
pierre
4f3f5d042b * return nil in TraceGetMem if SysGetMem returns nil
git-svn-id: trunk@6811 -
2007-03-12 20:59:36 +00:00
florian
8ed35dd5fb * do a stack trace in case of abording with an heap error when EXTRA is defined
git-svn-id: trunk@6358 -
2007-02-07 19:35:54 +00:00
florian
2fb33c4664 * better export of EXTRA define of heaptrc unit
git-svn-id: trunk@6317 -
2007-02-03 11:14:18 +00:00
Jonas Maebe
01749b93f3 * disabled checkpointer for Darwin since it doesn't work
git-svn-id: trunk@6079 -
2007-01-19 21:40:58 +00:00
pierre
1eefed6cfe + HaltOnNotReleased boolean added:defaults to false.
if set to true, and all memory is not freed,
   a RTE 203 is generated.
   Can only be set via HEAPTRC environment variable.

git-svn-id: trunk@5806 -
2007-01-04 10:48:22 +00:00
Károly Balogh
8311d34b3f + added some morphos support to checkpointer
git-svn-id: trunk@4122 -
2006-07-08 08:25:19 +00:00
florian
481f73e989 * don't check pointers in the heap trace unit fixes #7050
git-svn-id: trunk@3873 -
2006-06-16 17:50:41 +00:00
florian
f9df108e03 * heaptrc should be multi threading safe now
git-svn-id: trunk@3582 -
2006-05-19 19:38:37 +00:00
Tomas Hajny
ad14231358 * fix for OS/2 - StackTop is a pointer now
git-svn-id: trunk@3177 -
2006-04-08 16:48:10 +00:00
florian
0a1275dcf7 * fixed heaptrc for win64
git-svn-id: trunk@3122 -
2006-04-02 18:13:16 +00:00
Jonas Maebe
b8e3723bb0 - removed markheap since it doesn't work anymore (since a long
time already in fact)

git-svn-id: trunk@2968 -
2006-03-19 16:44:18 +00:00
peter
4c56a87d59 * integrate loaders in system unit
git-svn-id: trunk@2695 -
2006-02-26 18:21:35 +00:00
Vincent Snijders
32fc7668cc write pointer values using 16 hexadecimal digits on 64 bits platforms
git-svn-id: trunk@2293 -
2006-01-15 14:12:42 +00:00
Tomas Hajny
349d7108ce * Check of memory ranges under OS/2 added to HeapTrc
git-svn-id: trunk@1735 -
2005-11-13 19:05:38 +00:00