foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.28k stars 1.75k forks source link

bug(`cast`): `failed printing to stdout: Broken pipe (os error 32)` #8568

Open Cocodrilette opened 3 months ago

Cocodrilette commented 3 months ago

Component

Cast

Have you ensured that all of these are up to date?

What version of Foundry are you on?

forge 0.2.0 (fdfaafd 2024-07-30T00:19:45.054521589Z)

What command(s) is the bug in?

cast call

Operating System

Linux

Describe the bug

I was running this command:

cast call $USDT_POL "balanceOf(address)" 0x6464C0D320599d2E8c2ee3b1E0331Ef8D5bbe035 --rpc-url $POL_RPC | calc $1/1e6

And this error was throw (the result was returned btw):

    0.000001
The application panicked (crashed).
Message:  failed printing to stdout: Broken pipe (os error 32)
Location: library/std/src/io/stdio.rs:1118

This is a bug. Consider reporting it at https://github.com/foundry-rs/foundry

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1: __libc_start_call_main<unknown>
      at ./csu/../sysdeps/nptl/libc_start_call_main.h:58
   2: __libc_start_main_impl<unknown>
      at ./csu/../csu/libc-start.c:392

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.
Cocodrilette commented 3 months ago

The result is wrong

zerosnacks commented 3 months ago

Possibly related: https://github.com/rust-lang/rust/issues/46016 + use of println over writeln

Likely related: https://github.com/foundry-rs/foundry/pull/6569