Subject: bin/21820: gawk dumps core after detecting a syntax error
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jon@apa.bahz.se>
List: netbsd-bugs
Date: 06/07/2003 23:56:05
>Number:         21820
>Category:       bin
>Synopsis:       gawk dumps core after detecting a syntax error
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 07 21:57:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Jon Olsson
>Release:        NetBSD 1.6T
>Organization:
Monkey Mafia
>Environment:
System: NetBSD apa.bahz.se 1.6T NetBSD 1.6T (APA) #8: Sat Jun 7 19:55:54 CEST 2003 jon@apa.bahz.se:/usr/src/sys/arch/i386/compile/APA i386
Architecture: i386
Machine: i386
>Description:
apa% ktrace obj/awk -f ~/foo.awk
awk: /home/jon/foo.awk:1: !/^#/ && !/ / { print "\"" $1 "\" EXEC xterm -title " $1 " -exec ssh " $2 "\@" $1 " " $3 } '
awk: /home/jon/foo.awk:1:                                                                                            ^ Invalid char ''' in expression

awk: /home/jon/foo.awk:1: fatal error: internal error
zsh: 19998 abort (core dumped)  ktrace obj/awk -f ~/foo.awk

contents of ~/foo.awk:
!/^#/ && !/ / { print "\"" $1 "\" EXEC xterm -title " $1 " -exec ssh " $2 "\@" $1 " " $3 } '

apa% gdb -c awk.core obj/awk    
GNU gdb 5.0nb1
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386--netbsdelf"...Deprecated bfd_read called at /usr/src/gnu/dist/toolchain/gdb/dbxread.c line 2638 in elfstab_build_psymtabs
Deprecated bfd_read called at /usr/src/gnu/dist/toolchain/gdb/dbxread.c line 976 in fill_symbuf

Core was generated by `awk'.
Program terminated with signal 6, Abort trap.
Reading symbols from /usr/libexec/ld.elf_so...done.
Loaded symbols for /usr/libexec/ld.elf_so
Reading symbols from /usr/lib/libm387.so.0...done.
Loaded symbols for /usr/lib/libm387.so.0
Reading symbols from /usr/lib/libm.so.0...done.
Loaded symbols for /usr/lib/libm.so.0
Reading symbols from /usr/lib/libc.so.12...done.
Loaded symbols for /usr/lib/libc.so.12
#0  0x480b3877 in kill () from /usr/lib/libc.so.12
(gdb) bt
#0  0x480b3877 in kill () from /usr/lib/libc.so.12
#1  0x48125cbc in abort () from /usr/lib/libc.so.12
#2  0x805d8db in catchsig (sig=11, code=6) at /usr/src/gnu/dist/gawk/main.c:708
#3  0x480e8a7c in __sigtramp_sigcontext_1 () from /usr/lib/libc.so.12
Cannot access memory at address 0x6e6f6973

I'm not really sure what's happening here, and I've only made it appear 
with the exact above input file. 

>How-To-Repeat:
	See description
>Fix:
	Not known
>Release-Note:
>Audit-Trail:
>Unformatted: