-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad file descriptor when using NVIDIA Messaging Accelerator (VMA) #6923
Comments
Are you using forking? |
I am not using forking. |
Because of that I don't want to build the tokio runtime for the whole project. |
Using Tokio on a single thread is perfectly fine. Unfortunately, it's unclear what the issue is. Could you share a minimal reproducible example, or any other information about what you are doing that is unusual? |
use tokio::runtime::Builder;
fn main() {
core_affinity::set_for_current(core_affinity::CoreId { id: 3 });
std::thread::spawn(|| {
core_affinity::set_for_current(core_affinity::CoreId { id: 4 });
run_publisher();
});
loop {}
}
fn run_publisher() {
let rt = Builder::new_current_thread().enable_all().build().unwrap();
rt.block_on(async move {
println!("Hello, world!");
});
} As you said, when I run this it runs without any issue. |
It sounds like libvma does something weird to the process. This isn't something I'm able to debug myself. Can you figure out which operation within Tokio is emitting the bad fd error? Does disabling the process/signal features of Tokio fix the error? |
For the code snippet above, changing the dependency features as Thank you very much for your help! |
Version
tokio v1.40.0
│ └── tokio-macros v2.4.0 (proc-macro)
Platform
The output of
uname -a
(UNIX), or version and 32 or 64-bit (Windows)Linux server2 5.14.0-427.40.1.el9_4.x86_64+rt #1 SMP PREEMPT_RT Fri Oct 4 15:00:44 EDT 2024 x86_64 x86_64 x86_64 GNU/Linux
Description
While building a single thread tokio runtime, I get a
Bad file descriptor
error.The crashing line:
let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap();
The error:
called Result::unwrap() on an Err value: Os { code: 9, kind: Uncategorized, message: "Bad file descriptor" }
The structure of the code is like:
I expected to see runtime will be built and run the async part of the code.
Note: When I run a test using
#[tokio::test]
, the code runs without any issues.Instead, this happened:
called Result::unwrap() on an Err value: Os { code: 9, kind: Uncategorized, message: "Bad file descriptor" }
The text was updated successfully, but these errors were encountered: