oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.19k stars 2.68k forks source link

jscSignalHandler crash. #13120

Open renat2985 opened 1 month ago

renat2985 commented 1 month ago

How can we reproduce the crash?

The site is often visited by bots, and I often see such errors. Perhaps this is somehow related to the crash.

const server = Bun.serve({
  fetch(req, server) {
    let url;
    try {
      url = new URL(req.url);
    } catch (error) {
      console.error('Error parsing URL:', error);
      return new Response('Bad Request', { status: 400 });
    }
Error parsing URL: 27 |       });
28 |     }
29 | 
30 |     let url;
31 |     try {
32 |       url = new URL(req.url);
                 ^
TypeError: "1.1.1.1:443" cannot be parsed as a URL.

Relevant log output

Bun v1.1.21 (70ca2b76) Linux x64
Linux Kernel v5.4.0 | glibc v2.31
CPU: sse42 popcnt avx avx2
Args: "***"
Features: jsc fetch(19) http_server 
Builtins: "bun:main" "bun:sqlite" 
Elapsed: 685798740ms | User: 843834ms | Sys: 2204722ms
RSS: 1.07GB | Peak: 0.23GB | Commit: 1.07GB | Faults: 0

panic(main thread): Segmentation fault at address 0x2
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

Stack Trace (bun.report)

Bun v1.1.21 (70ca2b7) on linux x86_64 [AutoCommand]

Segmentation fault at address 0x00000002

cirospaciari commented 1 month ago

Friday we added some fixes on server.zig, can you try bun upgrade --canary and check if is still happening?