little-dude / netlink

netlink libraries for rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rtnetlink seems to fail if used with non-stock tokio::main

mcr opened this issue · comments

I am getting complaints from deep inside rtnetlink when I started my tokio runtime manually rather than with the tokio::main macro.
Based upon the tokio::main macros and a variety of feedback on discord and github, I changes rtnetlink/examples/get_links.rs as shown in branch: https://github.com/mcr/netlink/tree/get_links_crashes

I duplicated get_links.rs into get_links0.rs where I initialize tokio::main runtime manually.
This causes a crash:

obiwan-[connect/netlink/rtnetlink](2.6.6) mcr 18322 %../target/debug/examples/get_links0 
blocking in main
thread 'main' panicked at 'there is no reactor running, must be called from the context of Tokio runtime', /home/mcr/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/io/driver/mod.rs:202:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I will attach backtrace in next comment.

I hope that this is simplest way to demonstrate this.
I struggled a lot to make sure that my tokio::main initialisation was really correct.
I do not use the macro because I need to do some things before starting the runtime. (I need to fork to create a child to own the network namespace I am creating. I create a socketpair(2) between parent/child for IPC).

Many possibilities:

  1. rtnetlink is doing some check for a runtime, and not finding the default, failing to find it.
  2. maybe I need to poke that default somehow
  3. maybe the way that I'm starting tokio runtime is just wrong.
  4. something else boneheaded.
obiwan-[connect/netlink/rtnetlink](2.6.6) mcr 18330 %RUST_BACKTRACE=full ../target/debug/examples/get_links0
blocking in main
thread 'main' panicked at 'there is no reactor running, must be called from the context of Tokio runtime', /home/mcr/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/io/driver/mod.rs:202:14
stack backtrace:
   0:     0x55c087d3bc35 - backtrace::backtrace::libunwind::trace::h14d338b30b3ea0a7
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1:     0x55c087d3bc35 - backtrace::backtrace::trace_unsynchronized::h73ea91d74a3fd67f
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2:     0x55c087d3bc35 - std::sys_common::backtrace::_print_fmt::hd42948c952866e12
                               at src/libstd/sys_common/backtrace.rs:78
   3:     0x55c087d3bc35 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha8f928866ff7571e
                               at src/libstd/sys_common/backtrace.rs:59
   4:     0x55c087d5afac - core::fmt::write::he0c1e5f7426d2718
                               at src/libcore/fmt/mod.rs:1076
   5:     0x55c087d397b2 - std::io::Write::write_fmt::hf3afc6cfd57d0033
                               at src/libstd/io/mod.rs:1537
   6:     0x55c087d3e280 - std::sys_common::backtrace::_print::hfc0110703f3696fd
                               at src/libstd/sys_common/backtrace.rs:62
   7:     0x55c087d3e280 - std::sys_common::backtrace::print::h3f77c6990ddfaa22
                               at src/libstd/sys_common/backtrace.rs:49
   8:     0x55c087d3e280 - std::panicking::default_hook::{{closure}}::heae49580a8d62d75
                               at src/libstd/panicking.rs:198
   9:     0x55c087d3dfcc - std::panicking::default_hook::hecc34e3f729e213c
                               at src/libstd/panicking.rs:217
  10:     0x55c087d3e8c3 - std::panicking::rust_panic_with_hook::he82f5d0644692441
                               at src/libstd/panicking.rs:526
  11:     0x55c087d3e4bb - rust_begin_unwind
                               at src/libstd/panicking.rs:437
  12:     0x55c087d5a3b1 - core::panicking::panic_fmt::h09c929f06bb87c98
                               at src/libcore/panicking.rs:85
  13:     0x55c087d5a143 - core::option::expect_failed::hb49e05615ae76cc6
                               at src/libcore/option.rs:1261
  14:     0x55c087c92201 - core::option::Option<T>::expect::h74466b54198cca58
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9/src/libcore/option.rs:344
  15:     0x55c087c8c61f - tokio::io::driver::Handle::current::h0439e90268b0ca6c
                               at /home/mcr/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/io/driver/mod.rs:201
  16:     0x55c087c8141c - tokio::io::registration::Registration::new_with_ready::h2390c92b7eb5fd79
                               at /home/mcr/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/io/registration.rs:106
  17:     0x55c087c8021e - tokio::io::poll_evented::PollEvented<E>::new_with_ready::h53077ad4282142c4
                               at /home/mcr/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/io/poll_evented.rs:206
  18:     0x55c087c812f9 - tokio::io::poll_evented::PollEvented<E>::new::hc6db43940a8d0d9a
                               at /home/mcr/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/io/poll_evented.rs:178
  19:     0x55c087c7f0bf - netlink_sys::tokio::TokioSocket::new::h429f309cbf124c6b
                               at netlink-sys/src/tokio.rs:57
  20:     0x55c087c0fcbd - netlink_proto::connection::Connection<T>::new::h3c6af6a902aaaf07
                               at /ssw/projects/pandora/connect/netlink/netlink-proto/src/connection.rs:62
  21:     0x55c087c0f8d7 - netlink_proto::new_connection::h31058d80d70ff3a9
                               at /ssw/projects/pandora/connect/netlink/netlink-proto/src/lib.rs:226
  22:     0x55c087c0d099 - rtnetlink::connection::new_connection::h0f8e519177ce0721
                               at rtnetlink/src/connection.rs:18
  23:     0x55c087a32406 - get_links0::do_it::{{closure}}::ha2557bd6792b761d
                               at rtnetlink/examples/get_links0.rs:15
  24:     0x55c087a2cc57 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hbb436eaade1dda30
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9/src/libcore/future/mod.rs:78
  25:     0x55c087a26763 - tokio::runtime::enter::Enter::block_on::{{closure}}::hb5fdc6b4aee0f120
                               at /home/mcr/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/runtime/enter.rs:160
  26:     0x55c087a2c646 - tokio::coop::with_budget::{{closure}}::hb3416220789e2a88
                               at /home/mcr/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/coop.rs:127
  27:     0x55c087a2fe81 - std::thread::local::LocalKey<T>::try_with::ha9bae83bad866ccd
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9/src/libstd/thread/local.rs:263
  28:     0x55c087a2fcfd - std::thread::local::LocalKey<T>::with::h699b1bf0b5d1a249
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9/src/libstd/thread/local.rs:239
  29:     0x55c087a26566 - tokio::coop::with_budget::h5a47a7ac36f256b9
                               at /home/mcr/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/coop.rs:120
  30:     0x55c087a26566 - tokio::coop::budget::h83636136c08ccbe1
                               at /home/mcr/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/coop.rs:96
  31:     0x55c087a26566 - tokio::runtime::enter::Enter::block_on::h9d5b97e4bf9c2b6c
                               at /home/mcr/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/runtime/enter.rs:160
  32:     0x55c087a1f5ba - tokio::runtime::handle::Handle::block_on::{{closure}}::h01e685c913503ba3
                               at /home/mcr/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/runtime/handle.rs:277
  33:     0x55c087a26bcf - tokio::runtime::context::enter::hbda1f9cd5b37d096
                               at /home/mcr/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/runtime/context.rs:72
  34:     0x55c087a1f49b - tokio::runtime::handle::Handle::enter::hd1a7fc3c9b409aee
                               at /home/mcr/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/runtime/handle.rs:76
  35:     0x55c087a1f52d - tokio::runtime::handle::Handle::block_on::h6f0b81935e0be87d
                               at /home/mcr/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/runtime/handle.rs:275
  36:     0x55c087a22e69 - get_links0::main::h8c6b72ed4d0139d7
                               at rtnetlink/examples/get_links0.rs:123
  37:     0x55c087a1a2cd - std::rt::lang_start::{{closure}}::hcdd5d9793350e002
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9/src/libstd/rt.rs:67
  38:     0x55c087d3ec93 - std::rt::lang_start_internal::{{closure}}::h5d3ea623498f5f43
                               at src/libstd/rt.rs:52
  39:     0x55c087d3ec93 - std::panicking::try::do_call::hac65e71be769a440
                               at src/libstd/panicking.rs:348
  40:     0x55c087d3ec93 - std::panicking::try::hd4706e264bcf6712
                               at src/libstd/panicking.rs:325
  41:     0x55c087d3ec93 - std::panic::catch_unwind::h948a0fb4a8b3ee82
                               at src/libstd/panic.rs:394
  42:     0x55c087d3ec93 - std::rt::lang_start_internal::h72cc068ed2d0ac53
                               at src/libstd/rt.rs:51
  43:     0x55c087a1a297 - std::rt::lang_start::hc00ed92f123bc240
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9/src/libstd/rt.rs:67
  44:     0x55c087a22f4a - main
  45:     0x7fe01d5cd09b - __libc_start_main
                               at ../csu/libc-start.c:308
  46:     0x55c087a0b17a - _start
  47:                0x0 - <unknown>

Thank for the report @mcr.

It may be an issue with netlink-sys. When creating the socket I call PollEvented::new. From the doc:

This function panics if thread-local runtime is not set.

The runtime is usually set implicitly when this function is called from a future driven by a tokio runtime, otherwise runtime can be set explicitly with Handle::enter function.

I'll take a closer look tonight.

I can reproduce with this:

use netlink_sys::{protocols::NETLINK_AUDIT, TokioSocket};

fn main() -> Result<(), String> {
    let rt = tokio::runtime::Builder::new().build().unwrap();

    let future = async {
        let _socket = TokioSocket::new(NETLINK_AUDIT).unwrap();
    };
    rt.handle().block_on(future);
    return Ok(());
}

Full stacktrace:

thread 'main' panicked at 'there is no reactor running, must be called from the context of Tokio runtime', /home/little-dude/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/io/driver/mod.rs:202:14
stack backtrace:
   0:     0x55dbacb502a0 - std::backtrace_rs::backtrace::libunwind::trace::h448c56741b6011d3
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/std/src/../../backtrace/src/backtrace/libunwind.rs:100:5
   1:     0x55dbacb502a0 - std::backtrace_rs::backtrace::trace_unsynchronized::h2d26397c5720fdbb
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55dbacb502a0 - std::sys_common::backtrace::_print_fmt::h720a2f61f75b9f58
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x55dbacb502a0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8d62bbfda6d5c836
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x55dbacb6990c - core::fmt::write::h1857a60b204f1b6a
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/core/src/fmt/mod.rs:1078:17
   5:     0x55dbacb4e132 - std::io::Write::write_fmt::h16a9fe7680ac245c
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/std/src/io/mod.rs:1519:15
   6:     0x55dbacb527d5 - std::sys_common::backtrace::_print::h9ba51a6db618de7d
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x55dbacb527d5 - std::sys_common::backtrace::print::h5f20e41c85e91716
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x55dbacb527d5 - std::panicking::default_hook::{{closure}}::h5b7294ca19e8edab
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/std/src/panicking.rs:208:50
   9:     0x55dbacb5232a - std::panicking::default_hook::hb3948d1f74b6ff4c
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/std/src/panicking.rs:225:9
  10:     0x55dbacb52f71 - std::panicking::rust_panic_with_hook::h55d23fef0ad751bc
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/std/src/panicking.rs:591:17
  11:     0x55dbacb52ab7 - std::panicking::begin_panic_handler::{{closure}}::h56ae74c6dea6e141
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/std/src/panicking.rs:497:13
  12:     0x55dbacb5073c - std::sys_common::backtrace::__rust_end_short_backtrace::h3c4721f56689fae4
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/std/src/sys_common/backtrace.rs:141:18
  13:     0x55dbacb52a19 - rust_begin_unwind
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/std/src/panicking.rs:493:5
  14:     0x55dbacb68cb1 - core::panicking::panic_fmt::hb15d6f55e8472f62
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/core/src/panicking.rs:92:14
  15:     0x55dbacb68a43 - core::option::expect_failed::h6bc6a05976f4cb88
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/core/src/option.rs:1260:5
  16:     0x55dbacb253b1 - core::option::Option<T>::expect::hc6157668873f4237
                               at /nix/store/lcq6gpfm5fnk7fb237qmiy9wy0cmc4l8-rust-1.50.0-nightly-2020-11-17-c919f490b/lib/rustlib/src/rust/library/core/src/option.rs:349:21
  17:     0x55dbacb16bdf - tokio::io::driver::Handle::current::h27b16f9127ba0f94
                               at /home/little-dude/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/io/driver/mod.rs:201:9
  18:     0x55dbacb0a3dc - tokio::io::registration::Registration::new_with_ready::h3536835dc7f22e57
                               at /home/little-dude/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/io/registration.rs:106:22
  19:     0x55dbacb09eee - tokio::io::poll_evented::PollEvented<E>::new_with_ready::h15a458153b309012
                               at /home/little-dude/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/io/poll_evented.rs:206:28
  20:     0x55dbacb0a239 - tokio::io::poll_evented::PollEvented<E>::new::h01e709e50588a48b
                               at /home/little-dude/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/io/poll_evented.rs:178:9
  21:     0x55dbacb098ee - netlink_sys::tokio::TokioSocket::new::hb3aa2370a5d11efc
                               at /home/little-dude/code/netlink/netlink-sys/src/tokio.rs:57:24
  22:     0x55dbacb0734f - crash::main::{{closure}}::hb3fca0926968fce9
                               at /home/little-dude/code/netlink/netlink-sys/examples/crash.rs:8:23
  23:     0x55dbacb07617 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h137be8f80daf54c0
                               at /nix/store/lcq6gpfm5fnk7fb237qmiy9wy0cmc4l8-rust-1.50.0-nightly-2020-11-17-c919f490b/lib/rustlib/src/rust/library/core/src/future/mod.rs:80:19
  24:     0x55dbacb08773 - tokio::runtime::enter::Enter::block_on::{{closure}}::he7d274101c9f6cb8
                               at /home/little-dude/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/runtime/enter.rs:160:58
  25:     0x55dbacb088d6 - tokio::coop::with_budget::{{closure}}::hc3a7cd72e7939aa6
                               at /home/little-dude/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/coop.rs:127:9
  26:     0x55dbacb08cf5 - std::thread::local::LocalKey<T>::try_with::h73edbf38ae0567a9
                               at /nix/store/lcq6gpfm5fnk7fb237qmiy9wy0cmc4l8-rust-1.50.0-nightly-2020-11-17-c919f490b/lib/rustlib/src/rust/library/std/src/thread/local.rs:272:16
  27:     0x55dbacb08bfd - std::thread::local::LocalKey<T>::with::he84d175d7b92c05b
                               at /nix/store/lcq6gpfm5fnk7fb237qmiy9wy0cmc4l8-rust-1.50.0-nightly-2020-11-17-c919f490b/lib/rustlib/src/rust/library/std/src/thread/local.rs:248:9
  28:     0x55dbacb08586 - tokio::coop::with_budget::h2c1db2e56130a931
                               at /home/little-dude/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/coop.rs:120:5
  29:     0x55dbacb08586 - tokio::coop::budget::h4a66e3a3f0ba5b97
                               at /home/little-dude/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/coop.rs:96:5
  30:     0x55dbacb08586 - tokio::runtime::enter::Enter::block_on::h000f650cd157db02
                               at /home/little-dude/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/runtime/enter.rs:160:35
  31:     0x55dbacb09357 - tokio::runtime::handle::Handle::block_on::{{closure}}::hf6b798b1f1ba940e
                               at /home/little-dude/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/runtime/handle.rs:277:17
  32:     0x55dbacb089a2 - tokio::runtime::context::enter::h9682c5ca56f15cf1
                               at /home/little-dude/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/runtime/context.rs:72:5
  33:     0x55dbacb092b0 - tokio::runtime::handle::Handle::enter::h2a822ff8ac2e997c
                               at /home/little-dude/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/runtime/handle.rs:76:9
  34:     0x55dbacb09306 - tokio::runtime::handle::Handle::block_on::hbe005835bc803670
                               at /home/little-dude/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.22/src/runtime/handle.rs:275:13
  35:     0x55dbacb079c7 - crash::main::h631b208406015277
                               at /home/little-dude/code/netlink/netlink-sys/examples/crash.rs:10:5
  36:     0x55dbacb08f62 - core::ops::function::FnOnce::call_once::hf61a2077457645da
                               at /nix/store/lcq6gpfm5fnk7fb237qmiy9wy0cmc4l8-rust-1.50.0-nightly-2020-11-17-c919f490b/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
  37:     0x55dbacb0723a - std::sys_common::backtrace::__rust_begin_short_backtrace::h32c9d76b84975edd
                               at /nix/store/lcq6gpfm5fnk7fb237qmiy9wy0cmc4l8-rust-1.50.0-nightly-2020-11-17-c919f490b/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125:18
  38:     0x55dbacb07d56 - std::rt::lang_start::{{closure}}::h01e6a2a628f584ce
                               at /nix/store/lcq6gpfm5fnk7fb237qmiy9wy0cmc4l8-rust-1.50.0-nightly-2020-11-17-c919f490b/lib/rustlib/src/rust/library/std/src/rt.rs:66:18
  39:     0x55dbacb53397 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h3f3ba5d1e0ce8d49
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/core/src/ops/function.rs:259:13
  40:     0x55dbacb53397 - std::panicking::try::do_call::hd7a374fc87b951e7
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/std/src/panicking.rs:379:40
  41:     0x55dbacb53397 - std::panicking::try::h068087b173f80a49
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/std/src/panicking.rs:343:19
  42:     0x55dbacb53397 - std::panic::catch_unwind::h1f8259807e825279
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/std/src/panic.rs:396:14
  43:     0x55dbacb53397 - std::rt::lang_start_internal::h8ff82302dd620b52
                               at /rustc/c919f490bbcd2b29b74016101f7ec71aaa24bdbb/library/std/src/rt.rs:51:25
  44:     0x55dbacb07d27 - std::rt::lang_start::h91e284f4cd800df4
                               at /nix/store/lcq6gpfm5fnk7fb237qmiy9wy0cmc4l8-rust-1.50.0-nightly-2020-11-17-c919f490b/lib/rustlib/src/rust/library/std/src/rt.rs:65:5
  45:     0x55dbacb07a6a - main
  46:     0x7ff649e3fdbd - __libc_start_main
  47:     0x55dbacb070aa - _start
  48:                0x0 - <unknown>

So I don't think this is specific to netlink-sys. I think we're doing something wrong with tokio instead, because I can reproduce with the tokio TcpListener:

use tokio::net::TcpListener;


fn main() -> Result<(), String> {
    let rt = tokio::runtime::Builder::new().build().unwrap();

    let future = async {
        let std_listener = std::net::TcpListener::bind("127.0.0.1:8888").unwrap();
        let tokio_listener = TcpListener::from_std(std_listener).unwrap();
    };
    rt.handle().block_on(future);
    return Ok(());
}

@mcr I got an answer on Discord. We need to call enable_all on the runtime builder.

So, just for those getting here by google search, etc, I think you are saying that it should be:

use netlink_sys::{protocols::NETLINK_AUDIT, TokioSocket};

fn main() -> Result<(), String> {
    let rt = tokio::runtime::Builder::new().enable_all().build().unwrap();

    let future = async {
        let _socket = TokioSocket::new(NETLINK_AUDIT).unwrap();
    };
    rt.handle().block_on(future);
    return Ok(());
}

The link to discord didn't identify a specific message, so maybe you could paste it in here?
I updated my test branch to include this code above.

My get_links0 now compiles and runs, but it does not seem to provide a result: and it does not exit.
That suggests that there is still something that needs to be added to the Runtime :-(