cosmopolitan/third_party/sqlite3
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
..
alter.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
analyze.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
attach.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
auth.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
backup.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
bitvec.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
btmutex.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
btree.c Add test for ioctl(SIOCGIFCONF) and polyfill on BSDs 2021-06-25 18:44:04 -07:00
btree.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
btreeInt.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
build.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
callback.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
complete.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
ctime.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
date.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
dbpage.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
dbstat.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
delete.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
expr.c Tune SQLite build for redbean (#97) 2021-06-10 08:00:08 -07:00
fault.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
fkey.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
fts3.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
fts3.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
fts3_aux.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
fts3_expr.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
fts3_hash.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
fts3_hash.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
fts3_icu.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
fts3_porter.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
fts3_snippet.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
fts3_tokenize_vtab.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
fts3_tokenizer.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
fts3_tokenizer.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
fts3_tokenizer1.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
fts3_unicode.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
fts3_unicode2.c Get SQLite to build 2021-05-14 02:40:04 -07:00
fts3_write.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
fts3Int.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
fts5.c Get SQLite to build 2021-05-14 02:40:04 -07:00
fts5.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
func.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
geopoly.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
global.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
hash.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
hash.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
hwtime.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
icu.c Get SQLite to build 2021-05-14 02:40:04 -07:00
insert.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
inttypes.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
json1.c Get SQLite to build 2021-05-14 02:40:04 -07:00
keywordhash.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
legacy.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
loadext.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
main.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
malloc.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
mem0.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
mem1.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
mem2.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
mem3.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
mem5.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
memdb.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
memjournal.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
msvc.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
mutex.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
mutex.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
mutex_noop.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
mutex_unix.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
notify.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
opcodes.c Get SQLite to build 2021-05-14 02:40:04 -07:00
opcodes.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
os.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
os.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
os_common.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
os_setup.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
os_unix.c Make numerous improvements 2021-09-28 01:52:34 -07:00
os_win.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
pager.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
pager.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
parse.c Tune SQLite build for redbean (#97) 2021-06-10 08:00:08 -07:00
parse.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
pcache.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
pcache.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
pcache1.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
pragma.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
pragma.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
prepare.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
printf.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
random.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
resolve.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
rowset.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
rtree.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
rtree.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
select.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
shell.c Improve memory safety 2021-10-13 17:27:13 -07:00
shell.c.in Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
sqlite3.h Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
sqlite3.mk Productionize new APE loader and more 2021-10-02 08:27:03 -07:00
sqlite3ext.h Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
sqlite3rbu.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
sqlite3rbu.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
sqlite3rtree.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
sqlite3session.c Add test for ioctl(SIOCGIFCONF) and polyfill on BSDs 2021-06-25 18:44:04 -07:00
sqlite3session.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
sqlite3userauth.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
sqliteicu.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
sqliteInt.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
sqliteLimit.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
status.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
stmt.c Get SQLite to build 2021-05-14 02:40:04 -07:00
table.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
threads.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
tokenize.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
tokenizer.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
treeview.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
trigger.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
update.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
upsert.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
userauth.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
utf.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
util.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
vacuum.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
vdbe.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
vdbe.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
vdbeapi.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
vdbeaux.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
vdbeblob.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
vdbeInt.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
vdbemem.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
vdbesort.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
vdbetrace.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
vdbevtab.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
vtab.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
vxworks.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
wal.c Make numerous improvements 2021-09-28 01:52:34 -07:00
wal.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
walker.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
where.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
wherecode.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
whereexpr.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
whereInt.inc Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00
window.c Further polish SQLite vendoring 2021-05-14 10:43:58 -07:00