tokio 1.54 multi-thread spawn panics: "failed to resolve instance for ShardedListItem::get_shard_id"
Maintainers usually reply within 1 day
@kioku is already working on this.
Since Nov 22, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start with the reproducer in Cargo.toml and src/main.rs, then trace Relax’s instance resolution from libs/relax/types/src/instance.rs:238 against Tokio’s call at src/util/sharded_list.rs:91 and the trait and impl in src/runtime/task/mod.rs:627. Compare the Tokio case with the std-only trait-shaped example described in the issue to isolate the trigger. Done means the reproducer prints 42 under Relax without the internal compiler error.
Written by the indexing model from the issue text.
Description
On 30917dca5 (macOS arm64, rustc 1.100.0), spawning one task on tokio's multi-thread runtime panics under Relax with an internal compiler error while resolving tokio::util::sharded_list::ShardedListItem::get_shard_id. rustc runs the program.
Cargo.toml
[package]
name = "repro-tokio"
version = "0.1.0"
edition = "2024"
[workspace]
[dependencies]
tokio = { version = "=1.54.1", features = ["rt-multi-thread"] }
src/main.rs
fn main() {
let runtime = tokio::runtime::Builder::new_multi_thread().build().unwrap();
let answer = runtime.block_on(async { tokio::spawn(async { 42 }).await.unwrap() });
println!("{answer}");
}
Expected (cargo run): prints 42.
Actual (relax run --unattended repro-tokio, exit 101):
relax: main panic: compile error in tokio::util::sharded_list::ShardedList::lock_shard<Task<Arc<Handle>>>: internal compiler error in tokio::util::sharded_list::ShardedList::lock_shard: failed to resolve instance for tokio::util::sharded_list::ShardedListItem::get_shard_id with [Task<Arc<Handle>>]: Unimplemented (at libs/relax/types/src/instance.rs:238)
The failing call is tokio 1.54.1 src/util/sharded_list.rs:91, L::get_shard_id(L::as_raw(val)), where ShardedListItem: Link declares unsafe fn get_shard_id(target: NonNull<Self::Target>) -> usize and the impl is unsafe impl<S> ShardedListItem for Task<S> (src/runtime/task/mod.rs:627). A std-only copy of just that trait shape (supertrait associated type in an unsafe associated fn, called through a generic) runs correctly under Relax, so the trigger is something else in tokio's real types; I could not reduce it further without tokio.
- Dominant language
- Rust
- Stars
- 601
- Forks
- 34
- Avg merge
- 1h 58m
- Merged PRs (30d)
- 45
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from makepad/relax
-
std: `SliceIndex<str>` missing for `std::ops` ranges, so generic `R: SliceIndex<str>` bounds failOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 18/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 18/100
Maintainers usually reply within 1 day
Similar issues
-
CI/CD ignore-for-release
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
eclipse-ankaios/ankaios#844 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
symposium-dev/symposium#530 ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
topgrade-rs/topgrade#2540 ·
Maintainers usually reply within 1 day