wheybags / wcp

Experimental file copy tool using io_uring
MIT License
198 stars 7 forks source link

Core dump when copying file #15

Closed nmaludy closed 8 months ago

nmaludy commented 8 months ago

Hello, i'm getting the following error when trying wcp cloned latest directly from git.

$ wcp a b
ASSERTION FAILED: (io_uring_queue_init_params(requestedRingSize, &this->ring, &params) == 0) in ~/src/wcp/src/CopyQueue.cpp:22
Trace/breakpoint trap (core dumped)

Backtrace from the core dump looks like

(gdb) bt
#0  0x00007f00677e354c in __pthread_kill_implementation () from /lib64/libc.so.6
#1  0x00007f0067796ce6 in raise () from /lib64/libc.so.6
#2  0x000000000040b180 in CopyQueue::CopyQueue(unsigned long, unsigned long, Heap&&) ()
#3  0x00000000004055e5 in wcpMain(int, char**) ()
#4  0x00007f0067781eb0 in __libc_start_call_main () from /lib64/libc.so.6
#5  0x00007f0067781f60 in __libc_start_main_impl () from /lib64/libc.so.6
#6  0x0000000000404f65 in _start ()

I'm running on RHEL 9.2

$ uname -r
5.14.0-162.12.1.el9_1.0.2.x86_64
nmaludy commented 8 months ago

I recompiled, adding in debug symbols,using cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo

(gdb) up
#2  0x00000000004092a8 in CopyQueue::CopyQueue (this=this@entry=0x7ffcda3955a0, requestedRingSize=requestedRingSize@entry=402, 
    fileDescriptorCap=fileDescriptorCap@entry=900, heap=...) at ~/src/wcp/src/CopyQueue.cpp:19
19          release_assert(this->fileDescriptorCap >= CopyQueue::minimumFileDescriptorCap());
(gdb) p requestedRingSize
$1 = 402
(gdb) p fileDescriptorCap
$2 = 900
(gdb) p RESERVED_FD_COUNT + RESERVED_HIGH_PRIORITY_FD_COUNT
$3 = 4

some more debugging:

Breakpoint 1, CopyQueue::CopyQueue (this=this@entry=0x7fffffffdce0, requestedRingSize=requestedRingSize@entry=402, 
    fileDescriptorCap=fileDescriptorCap@entry=900, heap=...) at ~/src/wcp/src/CopyQueue.cpp:22
22          io_uring_params params = {};
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.34-40.el9_1.1.x86_64 libgcc-11.3.1-2.1.el9.x86_64 libstdc++-11.3.1-2.1.el9.x86_64
(gdb) step
23          release_assert(io_uring_queue_init_params(requestedRingSize, &this->ring, &params) == 0);
(gdb) step
io_uring_queue_init_params (entries=402, ring=0x7fffffffdd28, p=0x7fffffffd910) at ~/src/wcp/liburing/src/setup.c:140
140     {
(gdb) step
143             fd = __sys_io_uring_setup(entries, p);
(gdb) step
__sys_io_uring_setup (entries=402, p=p@entry=0x7fffffffd910) at ~/src/wcp/liburing/src/syscall.c:48
48              return syscall(__NR_io_uring_setup, entries, p);
(gdb) step
io_uring_queue_init_params (entries=<optimized out>, ring=0x7fffffffdd28, p=0x7fffffffd910) at ~/src/wcp/liburing/src/setup.c:144
144             if (fd < 0)
(gdb) step
102     extern int io_uring_queue_init_params(unsigned entries, struct io_uring *ring,
(gdb) step
io_uring_queue_init_params (entries=<optimized out>, ring=0x7fffffffdd28, p=0x7fffffffd910) at ~/src/wcp/liburing/src/setup.c:145
145                     return -errno;
(gdb) p errno
$1 = 38

Looks like errno 38 is "function not implemented"

nmaludy commented 8 months ago

According to RHEL solutions: https://access.redhat.com/solutions/4723221

I need to install RHEL 9.3 kernel kernel-5.14.0-362.8.1.el9_3

And then set the following sysctl:

# 0 = allow all
# 1 = allow privileged only creation
# 2 = disable all
kernel.io_uring_disabled=0