Program received signal SIGSEGV, Segmentation fault.
0x000055556f731a32 in ?? ()
(gdb) backtrace
#0 0x000055556f731a32 in ?? ()
#1 0x000055555556d599 in std::sys::unix::fd::FileDesc::write () at library/std/src/sys/unix/fd.rs:120
#2 std::sys::unix::stdio::{impl#3}::write () at library/std/src/sys/unix/stdio.rs:39
#3 std::io::stdio::{impl#1}::write () at library/std/src/io/stdio.rs:127
#4 std::io::buffered::bufwriter::BufWriter::flush_buf<std::io::stdio::StdoutRaw> ()
at library/std/src/io/buffered/bufwriter.rs:166
#5 0x000055555556e45e in std::io::buffered::linewritershim::{impl#1}::write_all<std::io::stdio::StdoutRaw> ()
at library/std/src/io/buffered/linewritershim.rs:269
#6 std::io::buffered::linewriter::{impl#1}::write_all<std::io::stdio::StdoutRaw> ()
at library/std/src/io/buffered/linewriter.rs:206
#7 std::io::stdio::{impl#14}::write_all () at library/std/src/io/stdio.rs:878
#8 0x000055555556f337 in std::io::Write::write_fmt::{impl#0}::write_str<std::io::stdio::StdoutLock> ()
at library/std/src/io/mod.rs:1686
#9 0x000055555558c01f in core::fmt::write () at library/core/src/fmt/mod.rs:1173
#10 0x000055555556e14e in std::io::Write::write_fmt<std::io::stdio::StdoutLock> () at library/std/src/io/mod.rs:1697
#11 std::io::stdio::{impl#13}::write_fmt () at library/std/src/io/stdio.rs:858
#12 0x000055555556e71c in std::io::stdio::{impl#12}::write_fmt () at library/std/src/io/stdio.rs:832
#13 std::io::stdio::print_to<std::io::stdio::Stdout> () at library/std/src/io/stdio.rs:1200
#14 std::io::stdio::_print () at library/std/src/io/stdio.rs:1213
#15 0x000055555555be7f in aoc2021::main ()
#16 0x000055555555bee3 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#17 0x000055555555bc09 in std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h84d5cc331b770efe ()
#18 0x0000555555570ff1 in core::ops::function::impls::{impl#2}::call_once<(), (dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe)> ()
at /rustc/efec545293b9263be9edfb283a7aa66350b3acbf/library/core/src/ops/function.rs:259
#19 std::panicking::try::do_call<&(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe), i32> () at library/std/src/panicking.rs:406
#20 std::panicking::try<i32, &(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe)> () at library/std/src/panicking.rs:370
#21 std::panic::catch_unwind<&(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe), i32> () at library/std/src/panic.rs:133
#22 std::rt::lang_start_internal::{closure#2} () at library/std/src/rt.rs:128
#23 std::panicking::try::do_call<std::rt::lang_start_internal::{closure#2}, isize> ()
at library/std/src/panicking.rs:406
#24 std::panicking::try<isize, std::rt::lang_start_internal::{closure#2}> () at library/std/src/panicking.rs:370
#25 std::panic::catch_unwind<std::rt::lang_start_internal::{closure#2}, isize> () at library/std/src/panic.rs:133
#26 std::rt::lang_start_internal () at library/std/src/rt.rs:128
#27 0x000055555555bed2 in main ()
I tried this code:
Play ground link to my program as is, https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=9765bafb238e5df721c608bb04389873
I expected to see this happen:
I should be able to read contents of that file.
Instead, this happened: explanation
It exits instantly with a segmentation fault error.
Meta
rustc --version --verbose
:Also reproducible with,
Backtrace
I can only reproduce it on one machine running(AMD 5900x),
Linux emerald 5.15.10-arch1-1 #1 SMP PREEMPT Fri, 17 Dec 2021 11:17:37 +0000 x86_64 GNU/Linux
(Also tested onLinux emerald 5.15.11-arch2-1 #1 SMP PREEMPT Wed, 22 Dec 2021 09:23:54 +0000 x86_64 GNU/Linux
)Extra notes,
cat /proc/self/cgroup
works perfectly fine.Sections of strace output from Go/C programs and cat