Compare commits

...

9 Commits

Author SHA1 Message Date
Meghan Denny
d21745d553 fix build error from merge 2025-06-04 17:46:20 -07:00
Meghan Denny
d62ac6b0df Merge branch 'main' into nektro-patch-62869 2025-06-04 16:05:08 -08:00
Meghan Denny
ec3464ca6c dont sigaltstack when about to use WTFReportBacktrace 2024-11-22 01:37:06 -08:00
Meghan Denny
518127133f change zip but not exe 2024-11-21 23:12:47 -08:00
Meghan Denny
111825e718 use bun-profile 2024-11-21 22:53:06 -08:00
Meghan Denny
31c69c2060 add separator newline and clear color 2024-11-21 22:52:54 -08:00
Meghan Denny
1a541079f0 still print url 2024-11-21 22:03:22 -08:00
Meghan Denny
88f4037917 WTFReportBacktrace extern 2024-11-21 22:02:24 -08:00
Meghan Denny
b9e1c8d949 crash_handler: use WTFReportBacktrace in canary 2024-11-21 21:53:02 -08:00
3 changed files with 15 additions and 4 deletions

View File

@@ -1569,7 +1569,7 @@ async function getExecPathFromBuildKite(target, buildId) {
const releaseFiles = readdirSync(releasePath, { recursive: true, encoding: "utf-8" });
for (const entry of releaseFiles) {
const execPath = join(releasePath, entry);
if (/bun(?:-[a-z]+)?(?:\.exe)?$/i.test(entry) && statSync(execPath).isFile()) {
if (/bun-profile(?:-[a-z]+)?(?:\.exe)?$/i.test(entry) && statSync(execPath).isFile()) {
return execPath;
}
}

View File

@@ -70,6 +70,8 @@ var before_crash_handlers_mutex: bun.Mutex = .{};
const CPUFeatures = @import("./bun.js/bindings/CPUFeatures.zig");
extern fn WTFReportBacktrace() void;
/// This structure and formatter must be kept in sync with `bun.report`'s decoder implementation.
pub const CrashReason = union(enum) {
/// From @panic()
@@ -249,7 +251,7 @@ pub fn crashHandler(
} else if (bun.analytics.Features.unsupported_uv_function > 0) {
const name = unsupported_uv_function orelse "<unknown>";
const fmt =
\\Bun encountered a crash when running a NAPI module that tried to call
\\Bun encountered a crash when running a NAPI module that tried to call
\\the <red>{s}<r> libuv function.
\\
\\Bun is actively working on supporting all libuv functions for POSIX
@@ -363,7 +365,7 @@ pub fn crashHandler(
} else if (bun.analytics.Features.unsupported_uv_function > 0) {
const name = unsupported_uv_function orelse "<unknown>";
const fmt =
\\Bun encountered a crash when running a NAPI module that tried to call
\\Bun encountered a crash when running a NAPI module that tried to call
\\the <red>{s}<r> libuv function.
\\
\\Bun is actively working on supporting all libuv functions for POSIX
@@ -410,6 +412,12 @@ pub fn crashHandler(
writer.writeAll(trace_str_buf.slice()) catch std.posix.abort();
writer.writeAll("\n") catch std.posix.abort();
writer.writeAll(Output.prettyFmt("<r>\n", true)) catch std.posix.abort();
if (bun.Environment.is_canary) {
WTFReportBacktrace();
writer.writeAll("\n") catch std.posix.abort();
}
}
if (Output.enable_ansi_colors) {
@@ -812,7 +820,9 @@ fn handleSegfaultPosix(sig: i32, info: *const std.posix.siginfo_t, _: ?*const an
);
}
var did_register_sigaltstack = false;
// skip in canary since we let WTFReportBacktrace print trace
// this will make stack overflow have a slightly worse ux but its rare enough to be worth it and still unique enough to be diagnosable
var did_register_sigaltstack = bun.Environment.isRelease and bun.Environment.is_canary;
var sigaltstack: [512 * 1024]u8 = undefined;
fn updatePosixSegfaultHandler(act: ?*std.posix.Sigaction) !void {

View File

@@ -19,6 +19,7 @@ pub const isBrowser = !isWasi and isWasm;
pub const isWindows = @import("builtin").target.os.tag == .windows;
pub const isPosix = !isWindows and !isWasm;
pub const isDebug = @import("builtin").mode == .Debug;
pub const isRelease = @import("builtin").mode != .Debug;
pub const isTest = @import("builtin").is_test;
pub const isLinux = @import("builtin").target.os.tag == .linux;
pub const isAarch64 = @import("builtin").target.cpu.arch.isAARCH64();