faile: test "request: fuzz"
aarch64 macOS 15.2 (24C101)
$ zig version
0.14.0-dev.3036+7ac110ac2
$ git log -1
commit a691d731047e9a5a79d71ac594cb8f5fad1d0705 (HEAD -> master, origin/master, origin/HEAD)
Author: trilowy <[email protected]>
Date: Mon Feb 3 02:00:14 2025 +0100
fix: zig master 0.14.0-dev.3026+c225b780e (#96)
https://github.com/ziglang/zig/pull/22627
Log
$ zig build test
/Users/rofrol/.zvm/master/lib/std/debug.zig:518:14: 0x100c74f8b in assert (test)
if (!ok) unreachable; // assertion failure
^
/Users/rofrol/.cache/zig/p/1220cb75f778354bc894ceb824542c942b6f5f41d56052b2e146812cd323c3bb6b89/src/server/server.zig:1457:21: 0x100d97a67 in handleClientData__anon_44409 (test)
std.debug.assert(hc.handshake == null);
^
/Users/rofrol/.cache/zig/p/1220cb75f778354bc894ceb824542c942b6f5f41d56052b2e146812cd323c3bb6b89/src/server/server.zig:742:40: 0x100d9792f in _dataAvailable (test)
const ok = handleClientData(H, hc, self.allocator, &fba);
^
/Users/rofrol/.cache/zig/p/1220cb75f778354bc894ceb824542c942b6f5f41d56052b2e146812cd323c3bb6b89/src/server/server.zig:728:39: 0x100d8e55b in dataAvailable (test)
return self._dataAvailable(hc, thread_buf) catch |err| {
^
/Users/rofrol/personal_projects/zig/vendor/http.zig/src/worker.zig:815:64: 0x100d8143f in processWebsocketData (test)
const success = self.websocket.worker.dataAvailable(hc, thread_buf);
^
/Users/rofrol/personal_projects/zig/vendor/http.zig/src/worker.zig:773:61: 0x100d6df43 in processData (test)
.websocket => |hc| self.processWebsocketData(conn, thread_buf, hc),
^
/Users/rofrol/personal_projects/zig/vendor/http.zig/src/thread_pool.zig:244:17: 0x100d4d157 in run (test)
@call(.auto, F, full_args);
^
/Users/rofrol/.zvm/master/lib/std/Thread.zig:488:13: 0x100d34867 in callFn__anon_36278 (test)
@call(.auto, f, args);
^
/Users/rofrol/.zvm/master/lib/std/Thread.zig:757:30: 0x100d09b23 in entryFn (test)
return callFn(f, args_ptr.*);
^
???:?:?: 0x19e1902e3 in ??? (libsystem_pthread.dylib)
???:?:?: 0x19e18b0fb in ??? (libsystem_pthread.dylib)
test
└─ run test failure
error: the following command terminated unexpectedly:
/Users/rofrol/personal_projects/zig/vendor/http.zig/.zig-cache/o/a409d3790cbaef77025a5cb37be31e29/test
Build Summary: 3/5 steps succeeded; 1 failed
test transitive failure
└─ run test failure
error: the following build command failed with exit code 1:
/Users/rofrol/personal_projects/zig/vendor/http.zig/.zig-cache/o/9df47bc7fddbdb49d75d792aee676fe0/build /Users/rofrol/.zvm/master/zig /Users/rofrol/.zvm/master/lib /Users/rofrol/personal_projects/zig/vendor/http.zig /Users/rofrol/personal_projects/zig/vendor/http.zig/.zig-cache /Users/rofrol/.cache/zig --seed 0x34a3d0f2 -Zaf4cd8980bf02552 test
I don't know.
That assertion is correct, in that the conneciton's handshake should be null. What I don't know is how it possibly isn't. When incorporated through httpz, that hc.handshake should always be null.
I see you're running the tests through your own project. How are you starting / executing them?
If you cd vendor/http.zig/ and then zig build test do you get the same thing?
I am not running tests through project. vendor directory is just the name. I do simple cd vendor/http.zig/ && zig build test.
Now also test "websocket: upgrade" failed:
debug(websocket): (127.0.0.1:49876) received text message
debug(websocket): (127.0.0.1:49876) received text message
warning(websocket): (127.0.0.1:49876) error reading from connection: error.WouldBlock
Segmentation fault at address 0xwebsocket: upgrade (4.23ms)
ContentType: forX (0.05ms)
aaaaaaaaaaaaaaaa
================================================================================
panic running "atoi"
================================================================================
aborting due to recursive panic
test
└─ run test failure
error: the following command terminated unexpectedly:
/Users/rofrol/personal_projects/zig/vendor/http.zig/.zig-cache/o/0edbc0a7d9ce9626bd605f0880dfcda9/test
Build Summary: 3/5 steps succeeded; 1 failed
test transitive failure
└─ run test failure
error: the following build command failed with exit code 1:
/Users/rofrol/personal_projects/zig/vendor/http.zig/.zig-cache/o/9df47bc7fddbdb49d75d792aee676fe0/build /Users/rofrol/.zvm/master/zig /Users/rofrol/.zvm/master/lib /Users/rofrol/personal_projects/zig/vendor/http.zig /Users/rofrol/personal_projects/zig/vendor/http.zig/.zig-cache /Users/rofrol/.cache/zig --seed 0xedfffda0 -Z1181d6a6b99a16bf test
I have updated to zig 0.14.0-dev.3046+08d661fcf.
After skipping tests like these, zig build test pass.
test "httpz: no route with custom notFound handler" {
+ // if (true) return error.SkipZigTest;
const stream = testStream(5993);
defer stream.close();
try stream.writeAll("GET /not_found HTTP/1.1\r\n\r\n");
@@ -1382,6 +1383,7 @@ test "websocket: invalid request" {
}
test "websocket: upgrade" {
+ if (true) return error.SkipZigTest;
const stream = testStream(5998);
defer stream.close();
try stream.writeAll("GET /ws HTTP/1.1\r\nContent-Length: 0\r\n");
@@ -1428,6 +1430,7 @@ test "websocket: upgrade" {
}
test "ContentType: forX" {
+ if (true) return error.SkipZigTest;
I always got this output:
warning: httpz: unhandled exception for request: /fail
Err: error.Failure
Error for "websocket: upgrade":
debug(websocket): (127.0.0.1:55512) received text message
debug(websocket): (127.0.0.1:55512) received text message
================================================================================
panic running "websocket: upgrade"
================================================================================
thread 4498590 panic: reached unreachable code
Sorry, I've been swamped and I actually have no clue what's going on.
Can you get any info from lldb?
lldb /Users/rofrol/personal_projects/zig/vendor/http.zig/.zig-cache/o/0edbc0a7d9ce9626bd605f0880dfcda9/test```
then enter "run" + enter
It should stop on the crash, you can type "gui" + enter to bring a not-so-great terminal UI. You can navigate up the stack trace to get some insight into where/what's happening.