Lưu ý: Phương pháp sau sẽ chấm dứt quá trình chạy & cũng yêu cầu ký hiệu.
Bạn có thể gửi một trong những tín hiệu sau (với action = core) để quá trình chạy:
Từ: http://man7.org/linux/man-pages/man7/signal.7.html
Signal Value Action Comment
──────────────────────────────────────────────────────────────────────
SIGHUP 1 Term Hangup detected on controlling terminal
or death of controlling process
SIGINT 2 Term Interrupt from keyboard
SIGQUIT 3 Core Quit from keyboard
SIGILL 4 Core Illegal Instruction
SIGABRT 6 Core Abort signal from abort(3)
SIGFPE 8 Core Floating point exception
SIGKILL 9 Term Kill signal
SIGSEGV 11 Core Invalid memory reference
SIGPIPE 13 Term Broken pipe: write to pipe with no
readers
SIGALRM 14 Term Timer signal from alarm(2)
SIGTERM 15 Term Termination signal
SIGUSR1 30,10,16 Term User-defined signal 1
SIGUSR2 31,12,17 Term User-defined signal 2
SIGCHLD 20,17,18 Ign Child stopped or terminated
SIGCONT 19,18,25 Cont Continue if stopped
SIGSTOP 17,19,23 Stop Stop process
SIGTSTP 18,20,24 Stop Stop typed at terminal
SIGTTIN 21,21,26 Stop Terminal input for background process
SIGTTOU 22,22,27 Stop Terminal output for background process
Giống như vậy:
kill <signal> <pid>
Và một khi bạn có cốt lõi, bạn có thể mở trong gdb cùng với tệp biểu tượng.
Bạn không cần đặt ulimit -c không giới hạn vì gdb không tôn trọng nó (gdb phải luôn cung cấp cho bạn toàn bộ tệp lõi). Bạn cũng có thể làm điều này bằng cách sử dụng lệnh 'gcore pid' từ cli mà không cần chạy gdb. – psanford