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

Handle EAGAIN errno's properly #35

Closed
RossComputerGuy opened this issue Apr 2, 2023 · 0 comments · Fixed by #36
Closed

Handle EAGAIN errno's properly #35

RossComputerGuy opened this issue Apr 2, 2023 · 0 comments · Fixed by #36

Comments

@RossComputerGuy
Copy link
Contributor

When working on a project, I wanted to see if setting NONBLOCK would allow for the thread to shutdown if the loop is stopped. I enabled it and got errno 11 which is EAGAIN. I think libxev should handle this error and just continue to monitor until the next event. This would make it so developers using libxev won't have to catch this error on their own.

neutron.runtime.ipc.base.Ipc{ .server = neutron.runtime.ipc.base.server{ .type = neutron.elemental.type.Type(neutron.runtime.ipc.base.server,neutron.runtime.ipc.base.server.Params,neutron.runtime.ipc.base.server.Impl){ .allocated = false, .allocator = mem.Allocator{ ... }, .parent = anyopaque@7ffc7e50dc80, .ref = neutron.elemental.ref{ ... } }, .base = neutron.runtime.ipc.base.base{ .type = neutron.elemental.type.Type(neutron.runtime.ipc.base.base,neutron.runtime.ipc.base.base.Params,neutron.runtime.ipc.base.base.Impl){ ... }, .vtable = neutron.runtime.ipc.base.base.VTableunexpected errno: { ... }, .runtime11 =
neutron.runtime.runtime{ ... }, .loop = backend.io_uring.Loop{ ... }, .running = false, .thread = null } } }/nix/store/vxhdcs2nc56ynlkm89f6f0qndsk5rs36-zig-0.11.0-dev.2247+38ee46dda/lib/std/debug.zig:561:19: 0x2939a7 in writeCurrentStackTrace__anon_10812 (neutron-runner)
    while (it.next()) |return_address| {
                  ^
/nix/store/vxhdcs2nc56ynlkm89f6f0qndsk5rs36-zig-0.11.0-dev.2247+38ee46dda/lib/std/debug.zig:157:80: 0x257b8d in dumpCurrentStackTrace (neutron-runner)
        writeCurrentStackTrace(stderr, debug_info, detectTTYConfig(io.getStdErr()), start_addr) catch |err| {
                                                                               ^
/nix/store/vxhdcs2nc56ynlkm89f6f0qndsk5rs36-zig-0.11.0-dev.2247+38ee46dda/lib/std/os.zig:5559:40: 0x23c438 in unexpectedErrno (neutron-runner)
        std.debug.dumpCurrentStackTrace(null);
                                       ^
/home/ross/ExpidusOS/neutron/vendor/third-party/zig/libxev/src/backend/io_uring.zig:557:59: 0x25bb33 in invoke (neutron-runner)
                    else => |errno| std.os.unexpectedErrno(errno),
                                                          ^
/home/ross/ExpidusOS/neutron/vendor/third-party/zig/libxev/src/backend/io_uring.zig:147:43: 0x25d408 in tick___anon_8624 (neutron-runner)
                switch (c.invoke(self, cqe.res)) {
                                          ^
/home/ross/ExpidusOS/neutron/vendor/third-party/zig/libxev/src/backend/io_uring.zig:60:42: 0x25d5b0 in run (neutron-runner)
            .until_done => try self.tick_(.until_done),
                                         ^
/home/ross/ExpidusOS/neutron/src/neutron/runtime/ipc/base/base.zig:75:24: 0x25d618 in callback (neutron-runner)
      try base.loop.run(.until_done);
                       ^
/nix/store/vxhdcs2nc56ynlkm89f6f0qndsk5rs36-zig-0.11.0-dev.2247+38ee46dda/lib/std/Thread.zig:427:13: 0x296166 in callFn__anon_10930 (neutron-runner)
            @call(.auto, f, args) catch |err| {
            ^
/nix/store/vxhdcs2nc56ynlkm89f6f0qndsk5rs36-zig-0.11.0-dev.2247+38ee46dda/lib/std/Thread.zig:679:30: 0x25de5c in entryFn (neutron-runner)
                return callFn(f, args_ptr.*);
                             ^
???:?:?: 0x7f9e6c40be85 in ??? (???)
thread 2996945 panic: attempt to unwrap error: Unexpected
/home/ross/ExpidusOS/neutron/src/neutron/runtime/ipc/socket/server.zig:93:37: 0x241d23 in callback (neutron-runner)
        const fd = res.accept catch unreachable;
                                    ^
/home/ross/ExpidusOS/neutron/vendor/third-party/zig/libxev/src/backend/io_uring.zig:671:34: 0x25c7ac in invoke (neutron-runner)
        return self.callback(self.userdata, loop, self, result);
                                 ^
/home/ross/ExpidusOS/neutron/vendor/third-party/zig/libxev/src/backend/io_uring.zig:147:43: 0x25d408 in tick___anon_8624 (neutron-runner)
                switch (c.invoke(self, cqe.res)) {
                                          ^
/home/ross/ExpidusOS/neutron/vendor/third-party/zig/libxev/src/backend/io_uring.zig:60:42: 0x25d5b0 in run (neutron-runner)
            .until_done => try self.tick_(.until_done),
                                         ^
/home/ross/ExpidusOS/neutron/src/neutron/runtime/ipc/base/base.zig:75:24: 0x25d618 in callback (neutron-runner)
      try base.loop.run(.until_done);
                       ^
/nix/store/vxhdcs2nc56ynlkm89f6f0qndsk5rs36-zig-0.11.0-dev.2247+38ee46dda/lib/std/Thread.zig:427:13: 0x296166 in callFn__anon_10930 (neutron-runner)
            @call(.auto, f, args) catch |err| {
            ^
/nix/store/vxhdcs2nc56ynlkm89f6f0qndsk5rs36-zig-0.11.0-dev.2247+38ee46dda/lib/std/Thread.zig:679:30: 0x25de5c in entryFn (neutron-runner)
                return callFn(f, args_ptr.*)
mitchellh added a commit that referenced this issue Apr 18, 2023
Closes #35, this probably could be done better than how it is but this
should be good enough.
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.

1 participant