shuveb / loti-examples

Source code for example programs from Lord of the io_uring guide
MIT License
152 stars 31 forks source link

"Error: Invalid argument" with cat_io_uring.c #23

Open shawndx opened 1 year ago

shawndx commented 1 year ago

cat_io_uring.c raises the error in case the input file is large, 1MB seems to be a threshold.

Environment:

% cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=23.10
DISTRIB_CODENAME=mantic
DISTRIB_DESCRIPTION="Ubuntu Mantic Minotaur (development branch)"

% uname -a
Linux devbox 5.10.104-linuxkit #1 SMP Thu Mar 17 17:08:06 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Reproduce:

% for i in {1..100}; do cat cat_io_uring.c >> big.c; done
% gcc -o cat cat_io_uring.c
% ./cat big.c
Error: Invalid argument
AoMYgod commented 4 months ago

I met the same problem on my computer. It feels the issue of the programe. It runs ok with my test_24KB.txt but fails with test_24MB.txt.