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