From: liljeber@hydra.Helsinki.FI (Mika Liljeberg) Subject: Re: I can malloc more memory than I have. Date: 28 Oct 1992 22:37:41 GMT
In article <1992Oct27.001649.26395@athena.mit.edu> alsaggaf@athena.mit.edu (M. Saggaf) wrote:
> Tcsh has a bug, 'limit coredumpsize 0' does not work. bash has no
> problem, 'ulimit -c 0' works just fine.
Hmm, I'd say the bug is in the kernel. This is from fs/exec.c, dump_core():
/* See if we have enough room to write the upage. */
if(current->rlim[RLIMIT_CORE].rlim_cur < PAGE_SIZE/1024) return 0;
^^^^^^^^^^^^^^
Should be just 1024, no?
Tcsh normally computes the limit like this: actual_value = (value +
0.5) * unit. The default unit for coredumpsize is 1024 bytes.
Therefore, limit coredumpsize 0 sets the limit to 512 bytes. This
would be ok, if the kernel tested this correctly. But the problem is
easy get around. If you give the unit explicitly, tcsh does not
attempt to round it:
nestor:~# unlimit
nestor:~# ./a.out
Floating exception (core dumped)
nestor:~# limit coredumpsize 0 kbytes
nestor:~# ./a.out
Floating exception
nestor:~#
> --
> /M. Saggaf
> alsaggaf@athena.mit.edu
Hope this helps.
Mika