NetBSD-Bugs archive

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

Re: bin/40689: awk(1) crash with RE and ^ anchor



On Thu, Feb 19, 2009 at 01:10:01PM +0000, Nicolas Joly wrote:
> >Number:         40689
> >Category:       bin
> >Synopsis:       awk(1) crash with RE and ^ anchor
[...]
> >Description:
> While checking some unrelated program for a buffer overflow with electricfence
> library, i noticed that an awk(1) command crashed ...
> 
> I had a look, and it seems that using a regular expression with a `^' anchor
> triggers the problem. Note that i was unable to make it (luckily ?) crash
> without electricfence control.
> 
> njoly@lanfeust [~]> awk '/^root:/' </etc/passwd 
> root:*:0:0:Charlie &:/root:/bin/ksh
> njoly@lanfeust [~]> LD_PRELOAD=/usr/pkg/lib/libefence.so awk '/^root:/' 
> </etc/passwd
>   Electric Fence 2.1 Copyright (C) 1987-1998 Bruce Perens.
> zsh: segmentation fault (core dumped)  LD_PRELOAD=/usr/pkg/lib/libefence.so 
> awk '/^root:/' < /etc/passwd

I'm seeing a possibly related nbawk failure when building librump.a
natively on alpha :

/local/src/NetBSD/tool/bin/alpha--netbsd-nm -go librump.a | 
/local/src/NetBSD/tool/bin/nbawk '   
$NF!~/^(rump|RUMP|__|_GLOBAL_OFFSET_TABLE'')/  {printf "%s rumpns_%s\n", $NF, 
$NF}'  | sort | uniq  > renametab.librump.a
/local/src/NetBSD/tool/bin/nbawk: floating point exception 8
 input record number 1989, file 
 source line number 1
/local/src/NetBSD/tool/bin/alpha--netbsd-objcopy --redefine-syms 
renametab.librump.a librump.a
rm -f renametab.librump.a
/local/src/NetBSD/tool/bin/alpha--netbsd-ranlib librump.a
#     build  librump/librump_p.a
rm -f librump_p.a

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.


Home | Main Index | Thread Index | Old Index