Open joeynq opened 2 months ago
Could you share some code to reproduce this issue? It looks like the stack trace doesn't give us enough information.
@Electroid I added example. I think the problem come from AsyncLocalStorage
. ~When I remove als, it run without any crashes.~
It still crash when trying to send multiple message through websockets. more frequent with als enabled
@Electroid I think I found the root cause. Turns out pino-pretty
is the main problem.
The codes below only will throw panic: Segmentation fault at address 0x6EA0
const logger = pino({
base: {},
transport: {
target: "pino-pretty", // disable this, the issue disappeared
options: {
crlf: true,
translateTime: "SYS:HH:MM:ss.l",
messageFormat: "{{traceId}} {msg}",
ignore: "traceId,userIp,serverUrl,userAgent",
},
},
})
setInterval(() => {
logger.info("Received message: %o", message);
}, 1000);
import { pino } from "pino";
const logger = pino({
base: {},
transport: {
target: "pino-pretty", // disable this, the issue disappeared
options: {
crlf: true,
translateTime: "SYS:HH:MM:ss.l",
messageFormat: "{{traceId}} {msg}",
ignore: "traceId,userIp,serverUrl,userAgent",
},
},
});
setInterval(() => {
logger.info({ traceId: 123, test: 1 }, "Received message: %o", {
version: Bun.version,
revision: Bun.revision,
});
}, 1000);
❯ bun run index.ts
[11:18:02.025] INFO: {123} Received message: {"version":"1.1.10","revision":"4b8f89cb73ac2b38f1da6a28eb91861eb7222264"}
test: 1
[11:18:03.014] INFO: {123} Received message: {"version":"1.1.10","revision":"4b8f89cb73ac2b38f1da6a28eb91861eb7222264"}
test: 1
[11:18:04.020] INFO: {123} Received message: {"version":"1.1.10","revision":"4b8f89cb73ac2b38f1da6a28eb91861eb7222264"}
test: 1
Please, can you add more details?
I'm running on:
And that's code crash after less than 30 seconds after started. Sometimes it crash after second or third log, sometimes it run longer. Just a very basic pino code as I posted. No more details.
I disabled pino-pretty
and didn't experience any crash until now.
How can we reproduce the crash?
No response
JavaScript/TypeScript code that reproduces the crash?
Relevant log output
Stack Trace (bun.report)
Bun v1.1.10 (
5102a94
) on linux x86_64 [AutoCommand]Segmentation fault at address 0x00006EA0
ld-temp.o:0
:WTF::jscSignalHandler
??
??