bug-sed
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25390: Segfault with sed 4.3


From: S. Gilles
Subject: bug#25390: Segfault with sed 4.3
Date: Sun, 8 Jan 2017 00:07:58 -0500
User-agent: Mutt/1.7.2 (2016-11-26)

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

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]