xxd -r hits an infinite loop for some inputs:
for example, echo -en '41414141\n\n' | xxd -r will run forever, spinning.
Environment:
xxd V1.10 27oct98 by Juergen Weigert
VIM - Vi IMproved 8.1 (2018 May 18, compiled Nov 7 2019 22:30:47)
x86_64 Arch Linux
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
xxd -rhits an infinite loop for some inputs:for example,
echo -en '41414141\n\n' | xxd -rwill run forever, spinning.Environment:
xxd V1.10 27oct98 by Juergen Weigert
VIM - Vi IMproved 8.1 (2018 May 18, compiled Nov 7 2019 22:30:47)x86_64 Arch Linux
your input (41414141\n\n) means "go to offset 0x41414141". In this case, xxd is using standard input and output, and xxd cannot go directly to that offset. So, xxd writes zero bytes until it reach that offset.
This process will take a while, but it's not forever.
You can see this process in real time with a command like this: echo -en '41414141\n\n' | xxd -r | xxd -g1.
If you want to write 41414141 as 4 bytes, you should use xxd -r -p.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
![]()
I suppose this can be closed then.
Closed #5272.