In x86_64 architecture, the write! works as expected with string arguments, but not with integers. When using an integer argument, I get a weird loop (for example, write!(writer, "Hello {}!", 123) creates an infinite "Hello Hello Hello ..."). On aarch64, the write! macro write! not working at all.
I create 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} matches x86_64 or aarch64 .
My code is built using the same code generation options. The libcore version matches my compiler. The problematic code is here . Can you suggest a possible cause of the problem?
IMPORTANT UPDATES:
Here is a more distilled code. Libcore is built inside the project, so everything is under control. The cycle above comes from rebooting the computer. The code works fine on aarch64, but strangely crashes inside Write :: write_fmt on x86_64. Carefully checked my starting build - it looks like it has no errors.
source share