Subject: Bugs in NetBSD-pmax gawk [was Re: netbsd awk [ was Re: ld bug ] ]
To: Arnold Robbins <arnold@cc.gatech.edu>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-pmax
Date: 12/12/1994 12:29:31
You write:
>X-Ultrix: Just Say NO!
>
I like that. It's a bit harsh though. Ultrix is 4.3BSD-Alpha
with DEC braindamage added. Ultrix.3BSD had its place.  I do agree that
that place ended with the release of 4.3-Tahoe, not to mention Reno and
Net-2.


>> I still don't know why).
>
>Um, as the current "owner" of gawk, could someone fill me in on just
>what exactly netbsd is using for 'awk'?  I thought it *was* the current
>gawk (2.15.5).
>
>If      awk -Wversion   does anything, that'd give a clue.

gawk --version sez 2.15.5.  The exact same source (modulo NetBSD preconfigured
headers, which I think are braindamage -- it makes updating more difficult)
compiles and works fine on Ultrix 4.2a. (Plus my local hacks, like
a 4.3BSD syslog and resolv.conf from bind-4.9.3-b9pl1, but they don't
affect this.)

Roughly, the symptoms I'm seeing are that gawk seems to sometimes lose
the ``last word'' of a long line.  For instance, the bigwords test
fails for NetBSD-pmax gawk.   Gawk only finds 14 words of 10 chars or
more.  The ones that are missing are all at the ends of their respective
lines.   I think this is the root cause of the awk script that builds
system-call interfaces from a template file breaking -- as it does
on NetBSD-pmax.


My instinct is that this is some kind of bug in the library.

Oh yes: floating-point numbers in awk are _horribly_ broken on
NetBSD-pmax.  They produce ':' as output in a %g format, and ':' is
just not a valid base-ten number.  The example below is from one of
the optional gawk regression tests. This looks like it might be a
strtod() problem...  regardless, it's clearly unacceptable. Any
insight into what might be causing this will be gratefully
appreciated.

--------
Reno> ../gawk -f inftest.awk
100000 100
100000000 100000
1e+11 100000000
:.00001e+13 1e+11
0.:e+17 :.00001e+13
0.9:e+20 0.:e+17
9.:e+22 0.9:e+20
:e+25 9.:e+22
1e+29 :e+25
1e+32 1e+29
:e+34 1e+32
:e+37 :e+34
:e+40 :e+37
:e+43 :e+40
:e+46 :e+43
:e+49 :e+46
:e+52 :e+49
:e+55 :e+52
1e+59 :e+55
:e+61 1e+59
9.:e+64 :e+61
9.:e+67 9.:e+64
9.:e+70 9.:e+67
:e+73 9.:e+70
1e+77 :e+73
1e+80 1e+77
:e+82 1e+80
:e+85 :e+82
:e+88 :e+85
:e+91 :e+88
1e+95 :e+91
:e+97 1e+95
:e+100 :e+97
:e+103 :e+100
1e+107 :e+103
:e+109 1e+107
9.:e+112 :e+109
9.:e+115 9.:e+112
9.:e+118 9.:e+115
:e+121 9.:e+118
1e+125 :e+121
1e+128 1e+125
:e+130 1e+128
:e+133 :e+130
:e+136 :e+133
:e+139 :e+136
:e+142 :e+139
:e+145 :e+142
:e+148 :e+145
:e+151 :e+148
1e+155 :e+151
:e+157 1e+155
9.:e+160 :e+157
9.:e+163 9.:e+160
9.:e+166 9.:e+163
:e+169 9.:e+166
1e+173 :e+169
1e+176 1e+173
:e+178 1e+176
1e+182 :e+178
:e+184 1e+182
:e+187 :e+184
:e+190 :e+187
:e+193 :e+190
:e+196 :e+193
:e+199 :e+196
1e+203 :e+199
:e+205 1e+203
9.:e+208 :e+205
9.:e+211 9.:e+208
9.:e+214 9.:e+211
:e+217 9.:e+214
1e+221 :e+217
1e+224 1e+221
:e+226 1e+224
:e+229 :e+226
:e+232 :e+229
:e+235 :e+232
:e+238 :e+235
:e+241 :e+238
:e+244 :e+241
:e+247 :e+244
1e+251 :e+247
:e+253 1e+251
9.:e+256 :e+253
9.:e+259 9.:e+256
9.:e+262 9.:e+259
:e+265 9.:e+262
1e+269 :e+265
1e+272 1e+269
:e+274 1e+272
:e+277 :e+274
:e+280 :e+277
:e+283 :e+280
:e+286 :e+283
:e+289 :e+286
:e+292 :e+289
:e+295 :e+292
1e+299 :e+295
:e+301 1e+299
9.:e+304 :e+301
9.:e+307 9.:e+304
Inf 9.:e+307
Inf Inf
loop terminated