xref: /illumos-gate/usr/src/test/util-tests/tests/awk/gnu/arrymem1.awk (revision c3937c08b16d32677a7dc955a81325f2e7a61b5d)
1# From spcecdt@armory.com  Thu Jun 14 13:24:32 2001
2# Received: from mail.actcom.co.il [192.114.47.13]
3# 	by localhost with POP3 (fetchmail-5.5.0)
4# 	for arnold@localhost (single-drop); Thu, 14 Jun 2001 13:24:32 +0300 (IDT)
5# Received: by actcom.co.il (mbox arobbins)
6#  (with Cubic Circle's cucipop (v1.31 1998/05/13) Thu Jun 14 13:25:13 2001)
7# X-From_: spcecdt@armory.com Thu Jun 14 06:34:47 2001
8# Received: from lmail.actcom.co.il by actcom.co.il  with ESMTP
9# 	(8.9.1a/actcom-0.2) id GAA29661 for <arobbins@actcom.co.il>;
10# 	Thu, 14 Jun 2001 06:34:46 +0300 (EET DST)
11# 	(rfc931-sender: lmail.actcom.co.il [192.114.47.13])
12# Received: from billohost.com (www.billohost.com [209.196.35.10])
13# 	by lmail.actcom.co.il (8.11.2/8.11.2) with ESMTP id f5E3YiO27337
14# 	for <arobbins@actcom.co.il>; Thu, 14 Jun 2001 06:34:45 +0300
15# Received: from fencepost.gnu.org (we-refuse-to-spy-on-our-users@fencepost.gnu.org [199.232.76.164])
16# 	by billohost.com (8.9.3/8.9.3) with ESMTP id XAA02681
17# 	for <arnold@skeeve.com>; Wed, 13 Jun 2001 23:33:57 -0400
18# Received: from deepthought.armory.com ([192.122.209.42])
19# 	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
20# 	id 15ANu2-00005C-00
21# 	for <bug-gawk@gnu.org>; Wed, 13 Jun 2001 23:34:38 -0400
22# Date: Wed, 13 Jun 2001 20:32:42 -0700
23# From: "John H. DuBois III" <spcecdt@armory.com>
24# To: bug-gawk@gnu.org
25# Subject: gawk 3.1.0 bug
26# Message-ID: <20010613203242.A29975@armory.com>
27# Mime-Version: 1.0
28# Content-Type: text/plain; charset=us-ascii
29# X-Mailer: Mutt 1.0.1i
30# X-Www: http://www.armory.com./~spcecdt/
31# Sender: spcecdt@armory.com
32# Status: RO
33#
34# Under SCO OpenServer 5.0.6a using gawk 3.1.0 compiled with gcc 2.95.2, this
35# program:
36
37    BEGIN {
38	f1(Procs,b)
39	print "test"
40    }
41
42    function f1(Procs,a) {
43	# a[""]
44	a[""] = "a"	# ADR: Give it a value so can trace it
45	f2()
46    }
47
48    function f2() {
49	# b[""]
50	b[""] = "b"	# ADR: Give it a value so can trace it
51    }
52
53    # ADR: 1/28/2003: Added this:
54    BEGIN { for (i in b) printf("b[\"%s\"] = \"%s\"\n", i, b[i]) }
55    # END ADR added.
56
57# gives:
58#
59#     gawk: ./gtest:5: fatal error: internal error
60#
61# and dumps core.
62#
63# gdb gives me this stack backtrace:
64#
65# #0  0x80019943 in kill () from /usr/lib/libc.so.1
66# #1  0x8003e754 in abort () from /usr/lib/libc.so.1
67# #2  0x8062a87 in catchsig (sig=0, code=0) at main.c:947
68# #3  0x80053a0c in _sigreturn () from /usr/lib/libc.so.1
69# #4  0x80023d36 in cleanfree () from /usr/lib/libc.so.1
70# #5  0x80023156 in _real_malloc () from /usr/lib/libc.so.1
71# #6  0x80023019 in malloc () from /usr/lib/libc.so.1
72# #7  0x8053b95 in do_print (tree=0x0) at builtin.c:1336
73# #8  0x806b47c in interpret (tree=0x8084ee4) at eval.c:606
74# #9  0x806ad8d in interpret (tree=0x8084f0c) at eval.c:384
75# #10 0x806ad21 in interpret (tree=0x8084f5c) at eval.c:367
76# #11 0x8061d5b in main (argc=4, argv=0x80478ac) at main.c:506
77#
78# 	John
79# --
80# John DuBois  spcecdt@armory.com.  KC6QKZ/AE  http://www.armory.com./~spcecdt/
81#
82