bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: about gawk |& operator and getline on HPUX11


From: Stepan Kasal
Subject: Re: about gawk |& operator and getline on HPUX11
Date: Wed, 22 May 2002 15:23:04 +0200
User-agent: Mutt/1.2.5.1i

Hallo,

On Wed, 22 May 2002 10:55:49 +0800, Zhao Xiang reported:
> When I test the following simple programs, I got an error:
> gawk: test2:3: fatal: get_a_record: iop->buf: can't allocate -61246 bytes
>       of memory (not enough space)

I suspect that the problem is that return value of function optimal_bufsize
is int while it should be size_t (which is at least unsigned int, sometimes
even long).

I've prepared two patches:

- gawk-3.1.1-optimal_bufsize_size_t.patch

If this patch works, it should be accepted for gawk-3.1.2
Please do "touch awkgram.c" a second after applying the patch so that
make won't try to call yacc/bison.

- gawk-3.1.1-optimal_bufsize_hack.patch

This patch cruel hack prevents optimal_bufsize fromreturning more than 24 KB.
It may solve your problem though I'd say it's not suitable for including
to the distribution tree.

Both these patches are attached.
Both should also (with some offsets and fuzz) work with gawk-3.1.0 sources.

I tried to reproduce the error with gcc 2.7.2.3 with HPUX 10.20.
But gawk worked as expected.
So I cannot tell which of the above patches works (if any).

I'd be very glad if you sent us the information whether the patches (esp. the
first one) work or not.

Regards,
        Stepan Kasal

Attachment: gawk-3.1.1-optimal_bufsize_size_t.patch
Description: Text document

Attachment: gawk-3.1.1-optimal_bufsize_hack.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]