{{tag>Brouillon}} # Linux crash coredump Voir : * https://linux-audit.com/understand-and-configure-core-dumps-work-on-linux/ * finecore Note : **Avec SystemD le core est à configurer dans le service** ## Activation ~~~bash ulimit -S -c 0 ~~~ `/etc/security/limits.conf` ~~~ * soft core unlimited ~~~ Vérif ~~~bash ulimit -H -c ulimit -S -c ~~~ ## Configuration ### Générer les coredump sur une partition précise ~~~bash echo "/var/lib/core" > /proc/sys/kernel/core_pattern ~~~ `/etc/sysctl.conf` ~~~python # Controls whether core dumps will append the PID to the core filename # Useful for debugging multi-threaded applications kernel.core_uses_pid = 1 ~~~ ~~~ # cat /proc/sys/kernel/core_pattern |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e ~~~ ## Test ### Programme de crash - Division par zéro `crash.c` ~~~c int main() { return 1/0; } ~~~ ~~~bash gcc crash.c ./a.out ~~~ ### Crash d'un process en cours d’exécution ~~~bash kill -s SIGSEGV 1234 ~~~ ## Analyse ### coredumpctl ~~~bash coredumpctl info coredumpctl -r ~~~ ~~~ # coredumpctl -1 TIME PID UID GID SIG COREFILE EXE Tue 2026-10-27 11:41:43 CET 2290233 0 0 11 none /home/ansible/malloc_bad.bin ~~~