GNU bug report logs -
#25390
Segfault with sed 4.3
Previous Next
Reported by: "S. Gilles" <sgilles <at> math.umd.edu>
Date: Sun, 8 Jan 2017 07:09:01 UTC
Severity: normal
Tags: fixed
Done: Assaf Gordon <assafgordon <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Hi,
I have a reliable segfault with (vanilla) sed 4.3 which does not appear
on (vanilla) 4.2.2. I've pared it down from the ./configure script (for
sed itself) to short working example, but I'm not sure if it's minimal.
I should note that this originally showed up on a bit of a snowflake
machine (armv7a+musl) when attempting to use any sort of nontrivial
./configure, but the my working example triggers the issue on a
boring amd64+glibc machine, even though that machine has no problem
./configure-ing all sorts of things. That could mean my example is
doing bad things that the original case didn't, in which case I'll try
to cook up another example. Without further ado (please excuse the UUoc):
----8<--------8<--------8<--------8<--------8<--------8<----
#!/bin/sh
# Or wherever you have it
sed="/bin/sed"
cat <<EOF > input.txt
1
1
\$LINENO \$LINEN
2
EOF
cat input.txt |
"${sed}" 's/\$LINENO.*/&-/
t lineno
:lineno
N
:loop
s/\$LINENO\(.*\n\)/\1/' > out.txt
----8<--------8<--------8<--------8<--------8<--------8<----
--
S. Gilles
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 8 years and 120 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.