Restart CI for New Technology and UBSAN hunting

Continuous Integration (via runit and runitd) is now re-enabled on win7
and win10. The `make test` command, which runs the tests on all systems
is now the fastest and most stable it's been since the project started.

UBSAN is now enabled in MODE=dbg in addition to ASAN. Many instances of
undefined behavior have been removed. Mostly things like passing a NULL
argument to memcpy(), which works fine with Cosmopolitan Libc, but that
doesn't prevents the compiler from being unhappy. There was an issue w/
GNU make where static analysis claims a sprintf() call can overflow. We
also now have nicer looking crash reports on Windows since uname should
now be supported and msys64 addr2line works reliably.
This commit is contained in:
Justine Tunney 2022-03-21 03:46:16 -07:00
parent d5ff2c3fb9
commit 5e8ae2d5bc
80 changed files with 506 additions and 249 deletions

View file

@ -16,45 +16,30 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/assert.h"
#include "libc/bits/weaken.h"
#include "libc/calls/calls.h"
#include "libc/calls/internal.h"
#include "libc/calls/ntspawn.h"
#include "libc/calls/strace.internal.h"
#include "libc/dce.h"
#include "libc/fmt/itoa.h"
#include "libc/intrin/kprintf.h"
#include "libc/macros.internal.h"
#include "libc/mem/alloca.h"
#include "libc/nexgen32e/nt2sysv.h"
#include "libc/nt/dll.h"
#include "libc/nt/enum/exceptionhandleractions.h"
#include "libc/nt/enum/filemapflags.h"
#include "libc/nt/enum/memflags.h"
#include "libc/nt/enum/pageflags.h"
#include "libc/nt/enum/startf.h"
#include "libc/nt/enum/wt.h"
#include "libc/nt/files.h"
#include "libc/nt/ipc.h"
#include "libc/nt/memory.h"
#include "libc/nt/process.h"
#include "libc/nt/runtime.h"
#include "libc/nt/signals.h"
#include "libc/nt/struct/context.h"
#include "libc/nt/struct/ntexceptionpointers.h"
#include "libc/nt/synchronization.h"
#include "libc/nt/thread.h"
#include "libc/runtime/directmap.internal.h"
#include "libc/runtime/memtrack.internal.h"
#include "libc/runtime/runtime.h"
#include "libc/str/str.h"
#include "libc/sysv/consts/auxv.h"
#include "libc/sysv/consts/map.h"
#include "libc/sysv/consts/o.h"
#include "libc/sysv/consts/prot.h"
#include "libc/sysv/consts/sig.h"
#include "libc/sysv/errfuns.h"
extern int __pid;
extern unsigned long long __kbirth;

View file

@ -102,15 +102,15 @@ textstartup void __printargs(int argc, char **argv, char **envp,
}
}
STRACE("SPECIALS");
STRACE(" ☼ %21s = %#s", "kTmpPath", kTmpPath);
STRACE(" ☼ %21s = %#s", "kNtSystemDirectory", kNtSystemDirectory);
STRACE(" ☼ %21s = %#s", "kNtWindowsDirectory", kNtWindowsDirectory);
STRACE(" ☼ %21s = %#s", "program_executable_name", program_executable_name);
STRACE(" ☼ %21s = %#s", "GetInterpreterExecutableName()",
STRACE(" ☼ %30s = %#s", "kTmpPath", kTmpPath);
STRACE(" ☼ %30s = %#s", "kNtSystemDirectory", kNtSystemDirectory);
STRACE(" ☼ %30s = %#s", "kNtWindowsDirectory", kNtWindowsDirectory);
STRACE(" ☼ %30s = %#s", "program_executable_name", program_executable_name);
STRACE(" ☼ %30s = %#s", "GetInterpreterExecutableName()",
GetInterpreterExecutableName(path, sizeof(path)));
STRACE(" ☼ %21s = %p", "RSP", __builtin_frame_address(0));
STRACE(" ☼ %21s = %p", "GetStackAddr()", GetStackAddr(0));
STRACE(" ☼ %21s = %p", "GetStaticStackAddr(0)", GetStaticStackAddr(0));
STRACE(" ☼ %21s = %p", "GetStackSize()", GetStackSize());
STRACE(" ☼ %30s = %p", "RSP", __builtin_frame_address(0));
STRACE(" ☼ %30s = %p", "GetStackAddr()", GetStackAddr(0));
STRACE(" ☼ %30s = %p", "GetStaticStackAddr(0)", GetStaticStackAddr(0));
STRACE(" ☼ %30s = %p", "GetStackSize()", GetStackSize());
#endif
}

View file

@ -36,7 +36,7 @@
// @returnstwice
// @vforksafe
vfork:
#ifdef __FSANITIZE_ADDRESS__
#ifdef __SANITIZE_ADDRESS__
jmp fork # TODO: asan and vfork don't mix?
.endfn vfork,globl
#else
@ -98,4 +98,4 @@ vfork.bsd:
.previous
#endif /* DEBUGSYS */
#endif /* __FSANITIZE_ADDRESS__ */
#endif /* __SANITIZE_ADDRESS__ */