Ubuntu Generate Core Dump On Fly

systemctl disable apport.service

/etc/security/limits.conf

* soft core unlimited
* hard core unlimited

/etc/sysctl.conf
kernel.core_pattern=/cores/core.%e.%p.%h.%t
mkdir /cores
chmod a+rwx /cores

sysctl -p

int main() {
    int *p;
    return *p;
}

gcc -o t t.c
.\t

Coredump will be generated at /cores
core.t.1219.u01.1570927314