diff --git a/core/sched.cc b/core/sched.cc index faf431740d542b6f3fa0528c462cf4bd8c0e4ecb..9e41c33a411d5147bcf31ff697192f93c7f75f5f 100644 --- a/core/sched.cc +++ b/core/sched.cc @@ -445,6 +445,7 @@ private: detached_thread::reaper::reaper() : _mtx{}, _zombies{}, _thread([=] { reap(); }) { + _thread.start(); } void detached_thread::reaper::reap() diff --git a/libc/stdio/vfprintf.c b/libc/stdio/vfprintf.c index 6a19c31dba583278233b5a13317f47d2866dd023..cba248ba4ace230f9f0ab045d16c51e2257b2809 100644 --- a/libc/stdio/vfprintf.c +++ b/libc/stdio/vfprintf.c @@ -9,7 +9,9 @@ #include <math.h> #include <float.h> -#define NL_ARGMAX _POSIX_ARG_MAX +// FIXME: _POSIX_ARG_MAX is 4096, this causes a stack overflow +//#define NL_ARGMAX _POSIX_ARG_MAX +#define NL_ARGMAX 20 /* Some useful macros */ diff --git a/libc/stdio/vfwprintf.c b/libc/stdio/vfwprintf.c index 7f8bf29122f7fc528b7c3bc6ae1f2b4c4a7dd34b..207a943d0fafef00c829198d514458026ee0ba48 100644 --- a/libc/stdio/vfwprintf.c +++ b/libc/stdio/vfwprintf.c @@ -8,7 +8,9 @@ #include <wctype.h> #include <inttypes.h> -#define NL_ARGMAX _POSIX_ARG_MAX +// FIXME: _POSIX_ARG_MAX is 4096, this causes a stack overflow +//#define NL_ARGMAX _POSIX_ARG_MAX +#define NL_ARGMAX 20 /* Convenient bit representation for modifier flags, which all fall * within 31 codepoints of the space character. */ diff --git a/scripts/loader.py b/scripts/loader.py index 2cae9948d624a2225fe828fd9b0288a71d5c561e..9338fb5649280a66963eaa384c6389fb08637008 100644 --- a/scripts/loader.py +++ b/scripts/loader.py @@ -5,6 +5,7 @@ import re import os, os.path import struct import json +from glob import glob build_dir = os.path.dirname(gdb.current_objfile().filename) external = build_dir + '/../../external' @@ -307,6 +308,13 @@ def continue_handler(event): gdb.events.cont.connect(continue_handler) +def setup_libstdcxx(): + gcc = external + '/gcc.bin' + sys.path += [gcc + '/usr/share/gdb/auto-load/usr/lib64', + glob(gcc + '/usr/share/gcc-*/python')[0], + ] + main = glob(gcc + '/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.*.py')[0] + execfile(main) osv() osv_heap() @@ -315,4 +323,6 @@ osv_info() osv_info_threads() osv_thread() osv_thread_apply() -osv_thread_apply_all() \ No newline at end of file +osv_thread_apply_all() + +setup_libstdcxx()