setup
cat /proc/sys/kernel/core_pattern
|/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E
$ ulimit -c
0
$ ulimit -c unlimited
0
$ ulimit -c
unlimited
setup
sudo sysctl kernel.core_pattern=/var/crash/core.%c.%d.%p.%t.%s.%E
cat /proc/sys/kernel/core_pattern
/var/crash/%E.%p.%t.%s
code
touch a.cpp
nano
int main() {
int a = 1/0;
int b = a+1;
return 0;
}
g++ a.cpp
./a.out
Floating point exception (core dumped)
dump
ll /var/crash/
core.18446744073709551615.1.30876.1671522014.8.!home!user!a.out
No use
ll /var/lib/apport/coredump
sudo sysctl kernel.core_pattern=core.%p.%s.%c.%d.%P
Reference
https://askubuntu.com/questions/440708/unable-to-generate-core-dump-after-apport-disable
沒有留言:
張貼留言