[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Memory allocation problem with latest gawk - new testcase
From: |
Stanislav Ievlev |
Subject: |
Re: Memory allocation problem with latest gawk - new testcase |
Date: |
Thu, 3 Apr 2003 14:55:15 +0400 |
On Thu, Apr 03, 2003 at 10:38:30AM +0200, Stepan Kasal wrote:
> Hello,
>
> On Wed, Apr 02, 2003 at 09:07:45PM +0400, Stanislav Ievlev wrote:
> > Try like this(or create 100M file):
> > gawk '/.*/ {;}' /dev/zero
>
> I tried to reproduce it with bigger files, the proces was very slow
> but no error occured.
>
> Perhaps you have a buggy version of malloc() which doesn't handle
> the tons of realloc's gracefully.
Problem #1: gawk behaviour depends on kernel version.
In attachment you can find testcase. It's demonstrates bug on 2.2.x kernels.
Diff between strace output on 2.2.x and 2.4.x kernels also included.
Problem #2: memory leak (works both on 2.2.x and 2.4.x kernels)
$(ulimit -Sv 16384 && time gawk '/.*/ {;}' /dev/zero)
gawk: cmd. line:2: fatal: grow_iop_buffer: iop->buf: can't allocate 16777218
bytes of memory (Cannot allocate memory)
0.03user 0.00system 0:00.12elapsed 24%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (186major+75minor)pagefaults 0swaps
--
With best regards
Stanislav Ievlev.
gawk.log
Description: Text document
2.4-2.2.diff
Description: Text document
Re: Memory allocation problem with latest gawk, Aharon Robbins, 2003/04/03