UEFI: fmt::Debug for TcpStream/TcpListener is unimplemented!() and panics
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- networking, operating-systems
Research direction
Start by reading the fmt::Debug implementations in library/std/src/sys/net/connection/uefi/mod.rs at lines 165–170 and 233–238, then check nearby platform implementations for the expected formatting style. Implement non-panicking debug output for TcpStream and TcpListener; done when formatting either type with {:?} no longer panics on UEFI.
Written by the indexing model from the issue text.
Description
On UEFI, the fmt::Debug implementations for TcpStream and TcpListener call
unimplemented!(), so any debug-print or log of these types panics the process
from safe code — including {:?}, .unwrap_err() on a Debug-bound error, or
any logging layer that formats them.
I tried this code:
use std::net::TcpListener;
let listener = TcpListener::bind("0.0.0.0:8080").unwrap();
println!("{listener:?}"); // panics: not yet implemented
I expected to see this happen: a Debug rendering (even a minimal
non-exhaustive one), as on all other platforms.
Instead, this happened: the impl is a stub
(library/std/src/sys/net/connection/uefi/mod.rs:165-170, and 233-238 for TcpListener):
impl fmt::Debug for TcpStream {
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
// FIXME(implement this)
unimplemented!()
}
}
Any debug-formatting of these types panics — a crash from safe code on a shipped
platform. The same applies to TcpListener.
Meta
Found by static analysis of main @ dc44e7f. Related: #100499.
rustc --version --verbose:
rustc 1.101.0-dev
binary: rustc
commit-hash: dc44e7f2c436b6041742e138b9c2176f093196d5
commit-date: 2026-10-24
host: x86_64-unknown-linux-gnu
release: 1.101.0-dev
Backtrace
thread 'main' panicked at 'not yet implemented', library/std/src/sys/net/connection/uefi/mod.rs:167
stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: <std::sys::net::connection::uefi::TcpStream as core::fmt::Debug>::fmt
3: core::fmt::write
4: std::io::stdio::_print
(representative; captured on a UEFI target)
@rustbot label +C-bug +T-libs +O-uefi
- Dominant language
- Rust
- Stars
- 121k
- Forks
- 18.7k
- Avg merge
- 3d 4m
- Merged PRs (30d)
- 536
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
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 rust-lang/rust
-
UEFI: File::read/File::write report success on firmware error status when byte count is non-zeroOpenC-bug needs-triage O-UEFI T-libs
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
C-bug I-prioritize I-unsound needs-triage O-UEFI T-libs
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
relnotes relnotes-needs-review relnotes-tracking-issue T-libs
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
relnotes relnotes-tracking-issue T-libs
Difficulty 1/5 Under an hour Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
A-patterns F-guard_patterns relnotes relnotes-needs-review relnotes-tracking-issue T-compiler T-lang
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
manuscript-lang/manuscript#1364 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
fable-compiler/Fable#5157 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day
-
移动端宽屏适配Open
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
bug priority: P3 ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
shep-pm/shep-kelpie#1332 ·
Maintainers usually reply within 1 day