When enabled (using heap_debug_dump_allocations_on_exit(true) or
MALLOC_DEBUG=e) this causes a dump of all remaining allocations when
libroot_debug is unloaded. It uses terminate_after to be called as
late as possible.
When combined with alloc stack traces this makes for a nice if a bit
crude leak checker. Note that a lot of allocations usually remain
even at that stage due to statically, lazyly and globally allocated
stuff from the various system libraries where it isn't necessarily
worth the overhead to free them when the program terminates anyway.
When configured to do so (using heap_debug_set_stack_trace_depth(depth)
or MALLOC_DEBUG=s<depth>) the guarded heap now captures stack traces on
alloc and free.
A crash due to hitting a guard page or an already freed page now dumps
these stack traces. In the case of use-after-free one can therefore see
both where the allocation was done and where it was freed.
Note that there is a hardcoded maximum stack trace depth of 50 and that
the alloc stack trace takes away space from the free stack trace which
uses up the rest of that maximum.
This allows for something similar as was implemented in 217f090 but
makes it optional and configurable.
The MALLOC_DEBUG environment variable now can take "a<size>" to set
the default alignment to the specified size. Note that not all
alignments may be supported depending on the heap implementation.
int64_t is signed. Although it does not make a difference by itself, because
INT64_MAX is still a valid number for uint64_t (UL), the later INT64_MIN
declaration depends on INT64_MAX, and therefore got implicitly casted to
unsigned type.
This fixes the following program on a x86_64 system:
#include <stdint.h>
int main() {
int64_t test = 5;
if (test < INT64_MIN)
return 1;
return 0;
}
This is a regression since commit 1d13a609 ("stdint.h: define [U]INT64[MAX|MIN]
with [U]L on x86_64").
Signed-off-by: Jerome Duval <jerome.duval@gmail.com>
* Partly reverting hrev47655, as the moved declarations are expected
by many ports to be accessable via string.h.
Following standards is a good thing in general, but not if it causes
more problems than it helps ...
instead or additionally to string.h, in preparation for functions move.
* moves str[n]casecmp() functions and others to strings.h.
* strings.h doesn't include string.h anymore.
* this solves #10949
* Add support for hubs in AllocateDevice().
* Prevent page fault in FinishTransfers().
* Set fCapabilityLength
* Correct in BIOS ownership code
* Fix context errors in _InsertEndpointForPipe().
* Update constants according to latest Specification (v1.1)
* Fix SMI code (reference
http://lkml.iu.edu/hypermail/linux/kernel/1204.2/02460.html).
* Fix Memory/Device-Slot leaks.
* Fix area allocation for TRBs.
* Fix for Intel Lynx Point and Panther Point chipsets. Also move init
of xhci before ehci, to switch USB 2.0 ports before the ehci module
discovers them.
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
* The ptrdiff_t limits are PTRDIFF_MIN and PTRDIFF_MAX, not PTDIFF_*.
* I could not find any non-Haiku reference to PTDIFF_*, so I guess
that's a mistake.
* Was causing LLVM to fail to build on x86_64
* Make XINT64 adjust based on architecture like
config/types.h to ensure these macros match
uint64 and int64 at all times.
* Resolves#10566
The baudrate constant for MIDI speed was after all the others in BeOS,
and we have to keep them with the same values for things to work.
Moreover, the constants in SerialPort.h were not changed, so everything
was out of sync and all apps using BSerialPort ended up using the wrong
speed.
Add a comment in termios.h to make sure this doesn't happen again.
This causes configure of gcc/binutils to fail its test for sys/time.h, which
in turn causes compilation of gcc/binutils to fail.
Found trying to do a @bootstrap-raw build for ARM.
If the alternate signal stack is used randomize the initial stack
pointer in the same way it is randomized on "normal" thread stacks.
Also, update MINSIGSTKSZ value so that regardless of where the new
stack pointer points to there is at least 4k of stack left.
This replaces the use of a few BSD-specific functions, as well
as the direct references to _open/_close et-al.
BFS doesn't support the FTS_NOSTAT directory link count optimization,
and no statfs() function is available, so we simply turn that off.