Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirection reach unreachable code #7

Closed
krichprollsch opened this issue Nov 29, 2024 · 0 comments · Fixed by #11
Closed

Redirection reach unreachable code #7

krichprollsch opened this issue Nov 29, 2024 · 0 comments · Fixed by #11
Labels
bug Something isn't working

Comments

@krichprollsch
Copy link
Member

Try to request https://httpbin.io/links/1 which redirects to https://httpbin.io/links/1/0 crash the client.
here is the full trace.

$ zig build test                                                                 
info: request https://httpbin.io/links/1                                         
debug: REQUEST CONNECTED                                                         
debug: REQUEST SENT                                                              
debug: REQUEST FINISHED                                                          
thread 771757 panic: reached unreachable code                                    
/usr/local/zig-0.13.0/lib/std/debug.zig:412:14: 0x1246ecd in assert (test)       
    if (!ok) unreachable; // assertion failure                                   
             ^                                                                   
/home/pierre/wrk/zig-async-io/src/std/http/Client.zig:938:15: 0x15ec76a in prepareRedirect (test)
        assert(req.response.parser.done);                                        
              ^                                                                  
/home/pierre/wrk/zig-async-io/src/std/http/Client.zig:881:32: 0x15ecd07 in async_redirect (test)
        try req.prepareRedirect();                                               
                               ^                                                 
/home/pierre/wrk/zig-async-io/src/std/http/Client.zig:1416:35: 0x15cdd98 in onResponse (test)
            ctx.req.async_redirect(uri, ctx) catch |err| return ctx.pop(err);    
                                  ^                                              
/home/pierre/wrk/zig-async-io/src/std/http/Client.zig:1401:26: 0x150e14a in onResponseHeaders (test)
        return onResponse(ctx, {});                                              
                         ^                                                       
/home/pierre/wrk/zig-async-io/src/std/http/Client.zig:2460:13: 0x12506be in pop (test)
            return @call(.auto, func, .{ self, res });                           
            ^                                                                    
/home/pierre/wrk/zig-async-io/src/std/http/Client.zig:286:23: 0x150e6e6 in onFill (test)
        return ctx.pop({});                                                      
                      ^                                                          
/home/pierre/wrk/zig-async-io/src/std/http/Client.zig:2460:13: 0x12506be in pop (test)
            return @call(.auto, func, .{ self, res });                           
            ^                                                                    
/home/pierre/wrk/zig-async-io/src/tls.zig/connection.zig:303:35: 0x150ef9d in onReadv (test)
                    return ctx.pop({});                                          
                                  ^                                              
/home/pierre/wrk/zig-async-io/src/std/http/Client.zig:2460:13: 0x12506be in pop (test)
            return @call(.auto, func, .{ self, res });                           
@krichprollsch krichprollsch added the bug Something isn't working label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant