Open qhariN opened 4 months ago
Debug build stack trace:
panic(main thread): @memcpy arguments alias
/Users/jarred/Code/bun/src/deps/zig/lib/std/io/fixed_buffer_stream.zig:66:57: 0x10335da6f in write (bun-debug)
@memcpy(self.buffer[self.pos..][0..n], bytes[0..n]);
^
/Users/jarred/Code/bun/src/deps/zig/lib/std/io.zig:360:27: 0x10335d6c3 in typeErasedWriteFn (bun-debug)
return writeFn(ptr.*, bytes);
^
/Users/jarred/Code/bun/src/deps/zig/lib/std/io/Writer.zig:13:24: 0x10335d4bf in write (bun-debug)
return self.writeFn(self.context, bytes);
^
/Users/jarred/Code/bun/src/deps/zig/lib/std/io/Writer.zig:19:32: 0x102e9bd2f in writeAll (bun-debug)
index += try self.write(bytes[index..]);
^
/Users/jarred/Code/bun/src/deps/zig/lib/std/io.zig:320:50: 0x103d8cd4b in decodeFaultTolerant__anon_111022 (bun-debug)
return @errorCast(self.any().writeAll(bytes));
^
/Users/jarred/Code/bun/src/http/url_path.zig:77:96: 0x103d8d47f in parse (bun-debug)
decoded_pathname = possibly_encoded_pathname[0..try PercentEncoding.decodeFaultTolerant(@TypeOf(writer), writer, clone, &needs_redirect, true)];
^
/Users/jarred/Code/bun/src/bun.js/api/filesystem_router.zig:305:39: 0x103d8ffbf in match (bun-debug)
const url_path = URLPath.parse(path.slice()) catch |err| {
How can we reproduce the crash?
When using
Bun.FileSystemRouter
on Windows, the server crashes if the pathname of the URL contains spaces (encoded as %20). The issue seems to occur during therouter.match(url.pathname)
call.Relevant log output
Stack Trace (bun.report)
Bun v1.1.17 (
bb66bba
) on windows x86_64 [AutoCommand]panic: @memcpy arguments alias
url_path.zig:86
:parse
filesystem_router.zig:306
:match
??