On x86_64 architectures, the write!
macro works as expected with string arguments, but not with integers. When an integer argument is used, I get a strange loop (e.g. write!(writer, "Hello {}!", 123)
produces infinite "Hello Hello Hello..."). On aarch64, the write!
macro does not work at all.
I build libcore using the following command:
rustc -C opt-level=3 -Z no-landing-pads -C no-stack-check \
--crate-type rlib --target {arch}-unknown-linux-gnu lib.rs
where {arch}
is respectively x86_64
or aarch64
.
My code is built using the same code generation options. The libcore version corresponds to my compiler. The problematic code is here. Can you suggest a possible cause of the problem?
IMPORTANT UPDATES:
Here is more distilled code. The libcore is built within the project so everything is under control. The loop above comes from machine rebooting. The code perfectly works on aarch64 but strangely crashes inside Write::write_fmt on x86_64. Carefully checked my startup assembly - doesn't seem to have errors there.
write_str
work fine? – Vally