Replies: 1 comment 1 reply
-
@lstoian The seg fault is happening inside Tokio. Could you please provide the exact version of Tokio being used in your application (from the You could also confirm that this problem happens without the let runtime = runtime::Builder::new_current_thread()
.enable_io()
.enable_time()
.build()
.expect("runtime initialization failed"); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I was trying to use tokio-console in a project that is writen in both C and Rust. The basic example works fine from a Rust only project.
If calling console_subscriber::init from a C main function it crashes:
#[no_mangle]
pub extern "C" fn init_console_logging() {
console_subscriber::init();
return;
}
then having a main func in C calling init_console_logging it gets SIGSEGV. Any idea how to make it work ?
This is the bt:
Thread 2 "console_subscri" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff6d6f100 (LWP 15054)]
0x000055555730acc7 in tokio::runtime::io::driver::Driver::new (nevents=0) at src/runtime/io/driver.rs:98
98 pub(crate) fn new(nevents: usize) -> io::Result<(Driver, Handle)> {
(gdb) bt
#0 0x000055555730acc7 in tokio::runtime::io::driver::Driver::new (nevents=0) at src/runtime/io/driver.rs:98
#1 0x00005555573a1814 in tokio::runtime::driver::create_io_stack (enabled=true, nevents=1024)
at src/runtime/driver.rs:148
#2 0x000055555739fc26 in tokio::runtime::driver::Driver::new (cfg=...) at src/runtime/driver.rs:47
#3 0x00005555573ee3a8 in tokio::runtime::builder::Builder::build_current_thread_runtime (self=0x7ffff6a49eb0)
at src/runtime/builder.rs:1082
#4 0x00005555573ee1c9 in tokio::runtime::builder::Builder::build (self=0x7ffff6a49eb0) at src/runtime/builder.rs:699
#5 0x00005555568a4eb9 in console_subscriber::builder::Builder::spawn::{{closure}} () at src/builder.rs:499
Thanks,
Lucian
Beta Was this translation helpful? Give feedback.
All reactions