Sono su Mac OS X 10.10.Come posso capire il programma che ha causato il core dump?
ho notato che il mio disco rigido si sta riempiendo, perché ogni pochi minuti un nuovo file core dump appare in /cores
:
$ ls -alhtr /cores
total 3551488
[email protected] 1 saqib admin 6.0K Apr 24 12:38 .DS_Store
drwxr-xr-x 32 root admin 1.1K Aug 1 17:00 ../
-r-------- 1 saqib admin 578M Aug 1 22:36 core.35049
-r-------- 1 saqib admin 578M Aug 1 22:37 core.35202
[email protected] 6 root admin 204B Aug 1 22:38 ./
-r-------- 1 saqib admin 578M Aug 1 22:38 core.35438
Ma non ho idea di quali processi stanno creando questi file core. I numeri nei nomi dei file dovrebbero rappresentare i PID dei processi che li hanno creati. Ma ovviamente quei processi sono morti. Quindi, come posso capire quale processo sta creando questi core in modo che io possa sistemarlo/rimuoverlo?
EDIT 1
Facendo gdb -c
sul file core non mi dà le informazioni che ho bisogno:
$ gdb -c /cores/core.35438
GNU gdb (GDB) 7.8.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin14.0.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
"/cores/core.35438": no core file handler recognizes format
(gdb)
EDIT 2
file
doesn' o sembra che funzioni:
$ file /cores/core.35049
/cores/core.35049: Mach-O core i386
EDIT 3
ho aperto il file core utilizzando un'applicazione chiamata MachOView. Puoi vedere lo screenshot di ciò che mi ha mostrato. Non riuscivo ancora a capire quale app ha creato questo file principale.
non direttamente collegate, ma hai guardato [CrashReporter] (https://developer.apple.com/library/mac/technotes/tn2004/tn2123.html)? Dovrebbe essere abilitato di default e registrare tutti i crash, ma potresti volerlo impostare in modalità sviluppatore come mostrato in [questa pagina wiki] (https://en.wikipedia.org/wiki/Crash_Reporter_ (OS_X)) – Hasturkun
Esegui a piccolo ciclo che memorizza tutti gli ID di processo ogni secondo in un file, quindi attendi l'arrivo di un core, interrompi il ciclo con Ctrl-C e controlla il processId nel file. 'mentre:; fai ps -aef >> /tmp/pids.txt; dormire 1; done' –