zon-dev / zinc

Zinc is a web framework written in pure Zig with a focus on high performance, usability, security, and extensibility.
https://zinc.zon.dev
MIT License
31 stars 0 forks source link

Issue with closing stream in Engine. #1

Open ciathefed opened 3 weeks ago

ciathefed commented 3 weeks ago

I have tried to use the example here and another one from the zinc-examples repo, and i keep getting this error.

thread 921703 panic: reached unreachable code
/opt/homebrew/Cellar/zig/0.13.0/lib/zig/std/posix.zig:245:22: 0x10446df9b in close (XXXXX)
            .BADF => unreachable, // Always a race condition.
                     ^
/opt/homebrew/Cellar/zig/0.13.0/lib/zig/std/net.zig:1798:32: 0x104490b53 in close (XXXXX)
            else => posix.close(s.handle),
                               ^
/Users/XXXXX/.cache/zig/p/122002abcd2597bc6c6dccaa76b6d871dcd461b4a82f4c80ff9fc68b01e402dae241/src/zinc/engine.zig:186:25: 0x1044c6c43 in worker (XXXXX)
            stream.close();
                        ^
/opt/homebrew/Cellar/zig/0.13.0/lib/zig/std/Thread.zig:429:13: 0x1044b4a87 in callFn__anon_11328 (XXXXX)
            @call(.auto, f, args) catch |err| {
            ^
/opt/homebrew/Cellar/zig/0.13.0/lib/zig/std/Thread.zig:674:30: 0x104491c9f in entryFn (XXXXX)
                return callFn(f, args_ptr.*);
                             ^
???:?:?: 0x19f3bf2e3 in ??? (libsystem_pthread.dylib)
???:?:?: 0x19f3ba0fb in ??? (libsystem_pthread.dylib)
dravenk commented 2 weeks ago

Thanks for report. I'm working on the new IO handle and this error will be fixed by next release.