Public bug reported:
Binary package hint: linux-source-2.6.20
If core dump limit is unlimited, things work well:
$ echo -e '#!/bin/sh\necho $CORE_REAL_RLIM >/tmp/core_limit\ncat > /tmp/core' >
/tmp/dumper; chmod 755 /tmp/dumper; echo '|/tmp/dumper' | sudo tee
/proc/sys/kernel/core_pattern
$ ulimit -S -c unlimited
$ bash -c 'kill -SEGV $$'
$ cat /tmp/core_limit; ls -l /tmp/core
-rw-r--r-- 1 root root 905216 2007-02-22 16:27 /tmp/core
When the core dump size limit is finite, but large enough, it's still
fine:
$ ulimit -S -c 1000
$ bash -c 'kill -SEGV $$'
$ cat /tmp/core_limit; ls -l /tmp/core
-rw-r--r-- 1 root root 905216 2007-02-22 16:29 /tmp/core
However, things go wrong when the limit is too small:
$ ulimit -S -c 500
$ bash -c 'kill -SEGV $$'
$ cat /tmp/core_limit; ls -l /tmp/core
-rw-r--r-- 1 root root 770048 2007-02-22 16:30 /tmp/core
-> the core dump is incomplete (and rightly so), but $CORE_REAL_RLIM is
not set. Thus this creates an undetectable situation for apport.
If the limit is really small, the env variable seems to work again, but
the core dump is written out completely (the latter is not a big deal,
since apport stops writing it to the disk in that case).
$ ulimit -S -c 1
$ bash -c 'kill -SEGV $$'
$ cat /tmp/core_limit; ls -l /tmp/core
$ cat /tmp/core_limit; ls -l /tmp/core
1024
-rw-r--r-- 1 root root 909312 2007-02-22 16:42 /tmp/core
$ ulimit -S -c 0
$ bash -c 'kill -SEGV $$'
$ cat /tmp/core_limit; ls -l /tmp/core
$ cat /tmp/core_limit; ls -l /tmp/core
0
-rw-r--r-- 1 root root 909312 2007-02-22 16:42 /tmp/core
** Affects: linux-source-2.6.20 (Ubuntu)
Importance: Undecided
Status: Unconfirmed
--
does not set CORE_REAL_RLIM correctly
https://launchpad.net/bugs/87065
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs