frevib / io_uring-echo-server

io_uring echo server
MIT License
365 stars 55 forks source link

Use `io_uring_free_probe()` instead of `free()` in liburing 2.4 to avoid runtime errors. #22

Closed HowardZorn closed 8 months ago

HowardZorn commented 1 year ago

Hello frevib!

I've just started to learn io_uring. I am getting a runtime error while running your io_uring code for echo server. It seems we can no longer use free() to free probes. Here are my environments:

% pacman -Si liburing
Repository      : extra
Name            : liburing
Version         : 2.4-1
Description     : Linux-native io_uring I/O access library
Architecture    : x86_64
URL             : https://git.kernel.dk/cgit/liburing/
Licenses        : LGPL2.1  MIT
Groups          : None
Provides        : liburing.so=2-64  liburing-ffi.so=2-64
Depends On      : glibc
Optional Deps   : None
Conflicts With  : None
Replaces        : None
Download Size   : 160.30 KiB
Installed Size  : 309.36 KiB
Packager        : David Runge <dvzrv@archlinux.org>
Build Date      : Thu 08 Jun 2023 07:02:14 PM +08
Validated By    : MD5 Sum  SHA-256 Sum  Signature

% uname -a
Linux relm 6.4.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 27 Jul 2023 22:02:18 +0000 x86_64 GNU/Linux

% g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/13.1.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --enable-languages=ada,c,c++,d,fortran,go,lto,objc,obj-c++ --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.1.1 20230714 (GCC) 

Cheers, Fw[a]rd.

frevib commented 8 months ago

Thanks a lot!