Hi,
The following script generates a compound command consisting of many instances
of the : command. I have found that it reproducibly induces a segfault in all
versions of bash from 2 onwards. I tested various other shells - several more
than are implied here - all of which could handle the generated code without
issue.
#!/bin/bash
shells=('busybox sh' dash posh ksh mksh bash)
code=$(printf '{ '; printf '%.s:; ' {1..50000}; printf '}')
for shell in "${shells[@]}"; do
type "${shell%% *}" &>/dev/null || continue
echo "testing: $shell"
echo "$code" | $shell || echo "$shell failed"
done
--
Kerin Millar <[email protected]>