3 linux_check_core_pattern()
5 if grep -q '^|' </proc/sys/kernel/core_pattern; then
7 Your system uses a crash report tool ($(cat /proc/sys/kernel/core_pattern)). Core files
8 will not be generated. Please reset /proc/sys/kernel/core_pattern (requires root
9 privileges) to enable core generation.
18 core_pattern=$(sysctl -n kern.corefile)
21 core_pattern=$(cat /proc/sys/kernel/core_pattern)
24 echo "OS $OS not supported" >&2
31 if [ "$OS" = Linux ]; then
32 linux_check_core_pattern
36 real_limit=$(ulimit -c)
37 if [ $real_limit -lt 100 ]; then
39 Unable to increase the core file limit. Core file may be truncated!
40 To fix this, increase HARD core file limit (ulimit -H -c 1000). This may require root
49 Executable file is in a.out.
50 Core file will be saved according to pattern $core_pattern.
53 # Save stack size and core_dump_filter
54 stack_size=`ulimit -s`
55 ulimit -Ss 32 # Decrease stack size to 32k => smaller core files.
57 core_dump_filter=`cat /proc/self/coredump_filter`
58 echo 0 > /proc/self/coredump_filter
62 # Reset stack size and core_dump_filter
63 echo core_dump_filter > /proc/self/coredump_filter