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

unexpected errno: 95 with Linux kernel 6.12.9 #373

Closed
krichprollsch opened this issue Jan 22, 2025 · 6 comments · Fixed by #374
Closed

unexpected errno: 95 with Linux kernel 6.12.9 #373

krichprollsch opened this issue Jan 22, 2025 · 6 comments · Fixed by #374
Assignees

Comments

@krichprollsch
Copy link
Member

Upgrading to Linux kernel 6.12.9 generates an error(cli): Server listen error: error.Unexpected error.

$ zig build run                                                                                                 
unexpected errno: 95                                    
/usr/local/zig-0.13.0/lib/std/debug.zig:197:31: 0x1afab42 in dumpCurrentStackTrace (lightpanda)
        writeCurrentStackTrace(stderr, debug_info, io.tty.detectConfig(io.getStdErr()), start_addr) catch |err| {
                              ^                         
/usr/local/zig-0.13.0/lib/std/posix.zig:7320:40: 0x1aca138 in unexpectedErrno (lightpanda)                      
        std.debug.dumpCurrentStackTrace(null);                                                                  
                                       ^                                                                        
/usr/local/zig-0.13.0/lib/std/posix.zig:6715:49: 0x1ac5274 in setsockopt (lightpanda)
            else => |err| return unexpectedErrno(err),                                                          
                                                ^     
/home/pierre/wrk/browser/src/server.zig:493:29: 0x1ac5101 in setSockOpt (lightpanda)
    try std.posix.setsockopt(fd, level, option, &std.mem.toBytes(value));                               
                            ^                                                                                   
/home/pierre/wrk/browser/src/server.zig:510:23: 0x1ac54a8 in listen (lightpanda)
        try setSockOpt(sockfd, std.posix.SOL.SOCKET, std.posix.SO.REUSEPORT, 1);
                      ^                                                                                         
/home/pierre/wrk/browser/src/main.zig:261:41: 0x1aefb79 in main (lightpanda)
            const socket = server.listen(addr) catch |err| {                
                                        ^                                                                       
/usr/local/zig-0.13.0/lib/std/start.zig:524:37: 0x1af267e in main (lightpanda)                                  
            const result = root.main() catch |err| {                                                            
                                    ^                                                                           
../sysdeps/nptl/libc_start_call_main.h:58:16: 0x7fd1be5ccd67 in __libc_start_call_main (../sysdeps/x86/libc-start.c)
../csu/libc-start.c:360:3: 0x7fd1be5cce24 in __libc_start_main_impl (../sysdeps/x86/libc-start.c)               
???:?:?: 0x1ac3020 in ??? (???)
???:?:?: 0x0 in ??? (???)                                                                                       
error(cli): Server listen error: error.Unexpected
@joshbaptiste
Copy link

socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
setsockopt(3, SOL_SOCKET, SO_REUSEPORT, [1], 4) = -1 EOPNOTSUPP (Operation not supported)
close(3)                          = 0
write(2, "error(cli): Server listen error:"..., 51) = 51

From strace output looks like kernel folks patched to not allow SO_REUSEPORT on Unix domain sockets anymore

@krichprollsch
Copy link
Member Author

Oh good catch @joshbaptiste thanks!
I'm pushing a fix.

@TibixDev
Copy link

TibixDev commented Jan 22, 2025

Just tried Lightpanda, I'm also getting this. I tried switching to LTS which is a much older version that's stable but it seems to not have helped.

❯ ./lightpanda-x86_64-linux --host 127.0.0.1 --port 9223
error(cli): Server listen error: error.Unexpected

usage: ./lightpanda-x86_64-linux [options] [URL]

  start Lightpanda browser

  * if an url is provided the browser will fetch the page and exit
  * otherwhise the browser starts a CDP server

  -h, --help      Print this help message and exit.
  --verbose       Display all logs. By default only info, warn and err levels are displayed.
  --host          Host of the CDP server (default "127.0.0.1")
  --port          Port of the CDP server (default "9222")
  --timeout       Timeout for incoming connections of the CDP server (in seconds, default "3")
  --dump          Dump document in stdout (fetch mode only)
error: Usage
❯ echo $?
1
❯ uname -a
Linux endeavour 6.6.70-1-lts #1 SMP PREEMPT_DYNAMIC Thu, 09 Jan 2025 13:22:24 +0000 x86_64 GNU/Linux

Maybe the patch was backported?

@krichprollsch
Copy link
Member Author

krichprollsch commented Jan 22, 2025

@TibixDev thanks for your message.
The error is pretty generic, but it looks like it is the same.
I'm forcing a nightly build with the fix (https://github.com/lightpanda-io/browser/actions/runs/12911614829)
Could-you test once the CI is done please?

@joshbaptiste
Copy link

@TibixDev yea since it's considered a vulnerability, backported to LTS kernels including 6.6.70

@joshbaptiste
Copy link

josh@fedora ~ > sha1sum ./lightpanda-x86_64-linux.2 ; uname -a; ./lightpanda-x86_64-linux.2
0315fcbb44f49142f94bd5d07b7cc3fb57da3c0c  ./lightpanda-x86_64-linux.2
Linux fedora 6.12.9-200.fc41.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jan  9 16:05:40 UTC 2025 x86_64 GNU/Linux
info(websocket): starting blocking worker to listen on 127.0.0.1:9222
info(server): accepting new conn...

nightly works... thx @krichprollsch !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants