source: trunk/essentials/sys-apps/gawk/test/ofmtbig.awk

Last change on this file was 3076, checked in by bird, 18 years ago

gawk 3.1.5

File size: 2.7 KB
Line 
1#
2# [USEMAP]
3#
4# Problem Report gnu/7821
5#
6# awk in free(): warning: chunk is already free.
7#
8# Confidential
9# no
10#
11# Severity
12# serious
13#
14# Priority
15# medium
16#
17# Responsible
18# freebsd-bugs@freebsd.org
19#
20# State
21# suspended
22#
23# Class
24# sw-bug
25#
26# Submitter-Id
27# current-users
28#
29# Arrival-Date
30# Thu Sep 3 10:30:00 PDT 1998
31#
32# Last-Modified
33# Thu Sep 17 02:04:26 PDT 1998
34#
35# Originator
36# Alexander Litvin archer@lucky.net
37#
38# Organization
39#
40#
41#Lucky Net ltd.
42#
43# Release
44# FreeBSD 3.0-CURRENT i386
45#
46# Environment
47#
48#
49#FreeBSD grape.carrier.kiev.ua 3.0-CURRENT FreeBSD 3.0-CURRENT #121: Thu Sep 3
50#1
51#1:21:44 EEST 1998 archer@grape.carrier.kiev.ua:/usr/src/sys/compile/GRAPE
52#i
53#386
54#
55# Description
56#
57#
58#The problem first appeared when GNU awk in 3.0-CURRENT was apgraded to
59#3.0.3. I run C-News, which uses awk extensively. After awk apgrade C-News
60#expire stopped to work. It appeared that some GNU awk 3.0.3 programms when
61#given absolutely legitimate input fail, giving out a number of messages:
62#
63#awk in free(): warning: chunk is already free.
64#
65# How-To-Repeat
66#
67#
68#Run the following awk program (it is cut out of C-News expire scripts).
69#I was not able to cut it down more -- omitting some portions of the
70#code (e.g. OFMT line), make error go away in this case, though it
71#certainly does not fix awk.
72#
73#----------------cut-here----------------
74#!/usr/bin/awk -f
75BEGIN {
76 OFMT = "%.12g"
77 big = 99999999999
78 lowest = big
79 small = 0
80 highest = small
81}
82
83$0 ~ /^[0-9]+$/ {
84 if ($1 < lowest)
85 lowest = $1
86 if ($1 > highest)
87 highest = $1
88 next
89}
90
91$0 ~ /^[a-z]+/ {
92 print dir, highest, lowest
93 dir = $0
94 lowest = big
95 highest = small
96}
97#----------------cut-here----------------
98#
99#To get the error, just give this script the following input:
100#----------------cut-here----------------
101#a
102#1
103#b
104#----------------cut-here----------------
105#
106# Fix
107#
108#
109#I was not able to track the error in awk sources. As a workaround,
110#I just reverted to GNU awk 2.15.5.
111#
112# Audit-Trail
113#
114#
115#State-Changed-From-To: open-suspended
116#State-Changed-By: phk
117#State-Changed-When: Thu Sep 17 02:04:08 PDT 1998
118#State-Changed-Why:
119#reported to GNU maintainer.
120#
121# Submit Followup
122# _________________________________________________________________
123#
124#
125# www@freebsd.org
Note: See TracBrowser for help on using the repository browser.