In a bash script on Ubuntu x86_64, I have no problem doing:
But on a Raspberry Pi it crashes when stdin is set to /dev/null:
Display All
Source Code
- $ uname -a
- Linux raspberrypi 4.14.70-v7+ #1144 SMP Tue Sep 18 17:34:46 BST 2018 armv7l GNU/Linux
- $ JLinkExe </dev/null
- SEGGER J-Link Commander V6.44i (Compiled May 17 2019 17:39:37)
- DLL version V6.44i, compiled May 17 2019 17:39:21
- Connecting to J-Link via USB...O.K.
- Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 7 2019 14:07:15
- Hardware version: V1.00
- S/N: 682780248
- VTref=3.300V
- Type "connect" to establish a target connection, '?' for help
- J-Link>Segmentation fault
- $ valgrind -v JLinkExe </dev/null
- ==2364==
- ...
- /lib/arm-linux-gnueabihf/libgcc_s.so.1 due to munmap()
- O.K.
- Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 7 2019 14:07:15
- Hardware version: V1.00
- S/N: 682780248
- VTref=3.300V
- Type "connect" to establish a target connection, '?' for help
- ==2369== Conditional jump or move depends on uninitialised value(s)
- ==2369== at 0x484AA1C: rindex (vg_replace_strmem.c:199)
- ==2369== by 0x12863: ??? (in /usr/local/bin/JLinkExe)