[Top][All Lists]

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

wrong unit for core limitation in 'ulimit -a'

From: fboiteux
Subject: wrong unit for core limitation in 'ulimit -a'
Date: Wed, 5 Oct 2005 09:53:59 +0200 (CEST)

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-pc-linux-gnu' 
-I/home/doko/packages/bash/bash-2.05a/lib -g -O2
uname output: Linux Prem3s 2.4.27-dev #1 ven aoû 26 11:55:01 CEST 2005 i686 
Machine Type: i386-pc-linux-gnu

Bash Version: 2.05a
Patch Level: 0
Release Status: release

        When looking at the bash's man page, it seems that the ulimit -c '<arg>'
        interprets its argument as number of kilobytes, but when we look at
        current values with ulimit -a, the result tells about 'blocks'
        (disk blocks ?) :
        $ ulimit -a
        core file size        (blocks, -c) unlimited
        data seg size         (kbytes, -d) unlimited
        file size             (blocks, -f) unlimited
        max locked memory     (kbytes, -l) unlimited
        max memory size       (kbytes, -m) unlimited
        open files                    (-n) 1024
        pipe size          (512 bytes, -p) 8
        stack size            (kbytes, -s) 8192
        cpu time             (seconds, -t) unlimited
        max user processes            (-u) 7168
        virtual memory        (kbytes, -v) unlimited

        Looking at the Bash's source, I guess it really kilobytes :
        $ grep core builtins/ulimit.def 
            -c  the maximum size of core files created
              { 'c',        RLIMIT_CORE,  1024,     "core file size",       
"blocks" },
        so I think this file should be fixed to use "kbytes" instead of "blocks"
        as other limits (filesize limit also uses 'blocks', is it the same
        problem ?).

        I've looked inside the latest Debian's bash package (bash_3.0-16)
        and the problem is already there.

        $ ulimit -a

        patch the builtins/ulimit.def file, moving from :
                      { 'c',        RLIMIT_CORE,  1024,     "core file size",   
    "blocks" },
                      { 'c',        RLIMIT_CORE,  1024,     "core file size",   
    "kbytes" },

        and perhaps the same modification for RLIMIT_FILESIZE stanza...

        with regards,
                Frédéric Boiteux.

reply via email to

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