Checked by triggering the #34597 UB:
$ echo 'pipe' | valgrind --quiet ./bld-cmake/bin/bitcoin rpc -stdinrpcpass uptime
error: timeout on transient error: Could not connect to the server 127.0.0.1:18443
Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
Use "bitcoin-cli -help" for more info.
$ echo 'pipe' | valgrind --quiet --trace-children=yes ./bld-cmake/bin/bitcoin rpc -stdinrpcpass uptime
==841070== Syscall param ioctl(TCSET{S,SW,SF}) points to uninitialised byte(s)
==841070== at 0x4E65871: tcsetattr (in /usr/lib64/libc.so.6)
==841070== by 0x40678A7: SetStdinEcho (src/compat/stdin.cpp:39)
==841070== by 0x40678A7: NoechoInst::NoechoInst() (src/compat/stdin.cpp:67)
==841070== by 0x403E557: CommandLineRPC(int, char**) (src/bitcoin-cli.cpp:1223)
==841070== by 0x403D8DC: main (src/bitcoin-cli.cpp:1354)
==841070== Address 0x1ffefff490 is on thread 1's stack
==841070== in frame [#0](/bitcoin-bitcoin/0/), created by tcsetattr (???:)
==841070==
==841070== Syscall param ioctl(TCSET{S,SW,SF}) points to uninitialised byte(s)
==841070== at 0x4E65871: tcsetattr (in /usr/lib64/libc.so.6)
==841070== by 0x4067907: SetStdinEcho (src/compat/stdin.cpp:39)
==841070== by 0x4067907: NoechoInst::~NoechoInst() (src/compat/stdin.cpp:68)
==841070== by 0x403E65F: CommandLineRPC(int, char**) (src/bitcoin-cli.cpp:1235)
==841070== by 0x403D8DC: main (src/bitcoin-cli.cpp:1354)
==841070== Address 0x1ffefff490 is on thread 1's stack
==841070== in frame [#0](/bitcoin-bitcoin/0/), created by tcsetattr (???:)
==841070==
error: timeout on transient error: Could not connect to the server 127.0.0.1:18443
Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
Use "bitcoin-cli -help" for more info.