Alien-libhisto
view release on metacpan or search on metacpan
bundled/tools/scripts/test_container.py view on Meta::CPAN
if err.returncode in [139, 134, 132, 136, 2, 1]:
sig_name = {139: "SIGSEGV (Segmentation Fault)", 134: "SIGABRT (Abort)", 132: "SIGILL (Illegal Instruction)", 136: "SIGFPE (Floating Point Exception)"}.get(err.returncode, f"Error {err.returncode}")
print("\n" + "=" * 75)
log_error(f"AUTOMATED CRASH INSPECTION & POST-MORTEM DIAGNOSTICS: {sig_name}")
print("=" * 75)
print(f"Target Architecture : {config.get('arch')} ({config.get('bits', 64)}-bit {config.get('endian', 'little')}-endian)")
print(f"Container Image : {image} ({config.get('platform', 'native')})")
print(f"Build Directory : {build_dir_name}")
print("=" * 75)
debug_script = (
"echo '--- Active System & Core Pattern ---' && "
"uname -a && "
"cat /proc/sys/kernel/core_pattern 2>/dev/null || true && "
"echo '--- Core Dump Search & GDB Backtrace ---' && "
"CORE_FILE=$(find /tmp /var/crash \"" + build_dir_name + "\" -name 'core*' -o -name '*.core' 2>/dev/null | head -n 1) && "
"if [ -n \"$CORE_FILE\" ]; then "
" echo \"Found Core Dump: $CORE_FILE\" && "
" BIN_FILE=$(find " + build_dir_name + " -type f -executable -not -name '*.sh' 2>/dev/null | head -n 1) && "
" if command -v gdb >/dev/null 2>&1 && [ -n \"$BIN_FILE\" ]; then "
" echo \"Inspecting with GDB against binary: $BIN_FILE...\" && "
bundled/tools/scripts/test_container.py view on Meta::CPAN
" echo 'Remedy: Retry with lower concurrency (e.g. -j 2 or -j 1) or upgrade host qemu-user-static.'; "
"fi"
)
inspect_cmd = [engine, "run", "--rm", "-e", "DEBIAN_FRONTEND=noninteractive"]
if config.get("platform"):
inspect_cmd.extend(["--platform", config["platform"]])
inspect_cmd.extend([
"-v", f"{repo_root}:/workspace",
"-w", "/workspace",
image,
"sh", "-c", debug_script
])
try:
exec_container_cmd(inspect_cmd, timeout=30)
except Exception:
pass
print("=" * 75 + "\n")
raise err
finally:
try:
exec_container_cmd([engine, "run", "--rm", "-v", f"{repo_root}:/workspace", "alpine:latest", "sh", "-c", post_chown_cmd], timeout=15)
( run in 0.856 second using v1.01-cache-2.11-cpan-c32d3c3b8f1 )