cosmopolitan/test/tool/build/lib
Justine Tunney 226aaf3547 Improve memory safety
This commit makes numerous refinements to cosmopolitan memory handling.

The default stack size has been reduced from 2mb to 128kb. A new macro
is now provided so you can easily reconfigure the stack size to be any
value you want. Work around the breaking change by adding to your main:

    STATIC_STACK_SIZE(0x00200000);  // 2mb stack

If you're not sure how much stack you need, then you can use:

    STATIC_YOINK("stack_usage_logging");

After which you can `sort -nr o/$MODE/stack.log`. Based on the unit test
suite, nothing in the Cosmopolitan repository (except for Python) needs
a stack size greater than 30kb. There are also new macros for detecting
the size and address of the stack at runtime, e.g. GetStackAddr(). We
also now support sigaltstack() so if you want to see nice looking crash
reports whenever a stack overflow happens, you can put this in main():

    ShowCrashReports();

Under `make MODE=dbg` and `make MODE=asan` the unit testing framework
will now automatically print backtraces of memory allocations when
things like memory leaks happen. Bugs are now fixed in ASAN global
variable overrun detection. The memtrack and asan runtimes also handle
edge cases now. The new tools helped to identify a few memory leaks,
which are fixed by this change.

This change should fix an issue reported in #288 with ARG_MAX limits.
Fixing this doubled the performance of MKDEPS.COM and AR.COM yet again.
2021-10-13 17:27:13 -07:00
..
alu_test.c Get codebase completely working with LLVM 2021-02-09 02:57:32 -08:00
asmdown_test.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
bitscan_test.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
bsu_test.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
disinst_test.c Perform some code cleanup 2021-02-27 10:33:32 -08:00
divmul_test.c Remove garbage collector macro from header (#114) 2021-03-07 20:23:29 -08:00
getargs_test.c Improve memory safety 2021-10-13 17:27:13 -07:00
interner_test.c Improve Python tree-shaking 2021-09-06 19:24:10 -07:00
iovs_test.c Change license 2020-12-27 17:18:44 -08:00
isnocompressext_test.c Undiamond Python headers 2021-08-12 14:07:40 -07:00
javadown_test.c Remove garbage collector macro from header (#114) 2021-03-07 20:23:29 -08:00
machine_test.c Remove garbage collector macro from header (#114) 2021-03-07 20:23:29 -08:00
modrm_test.c Remove garbage collector macro from header (#114) 2021-03-07 20:23:29 -08:00
numbers.c Change license 2020-12-27 17:18:44 -08:00
numbers.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
optest.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
optest.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pty_test.c Improve memory safety 2021-10-13 17:27:13 -07:00
stripcomponents_test.c Experiment with making Python go faster 2021-08-18 21:57:11 -07:00
test.mk Fix link order in cosmopolitan.a 2021-01-16 12:05:41 -08:00
xlaterrno_test.c Fix XNU / FreeBSD / OpenBSD / RHEL5 / NT bugs 2021-01-25 18:31:17 -08:00