Questions tagged [sigkill]

On POSIX-compliant platforms, SIGKILL is the signal sent to a process to cause it to terminate immediately. The symbolic constant for SIGKILL is defined in the header file signal.h. Symbolic signal names are used because signal numbers can vary across platforms, however on the vast majority of systems, SIGKILL is signal #9.

When sent to a program, SIGKILL causes it to terminate immediately. In contrast to SIGTERM and SIGINT, this signal cannot be caught or ignored, and the receiving process cannot perform any clean-up upon receiving this signal.

  • Zombie processes cannot be killed since they are already dead and waiting for their parent processes to reap them.
  • Processes that are in the blocked state will not die until they wake up again.
  • The init process is special: It does not get signals that it does not want to handle, and thus it can ignore SIGKILL.
  • Because SIGKILL gives the process no opportunity to do cleanup operations on terminating, in most system shutdown procedures an attempt is first made to terminate processes using SIGTERM, before resorting to SIGKILL if the process does not voluntarily exit in response to SIGTERM.
  • To speed the computer shutdown procedure, Mac OS X 10.6, aka Snow Leopard, will send SIGKILL to applications that have marked themselves "clean" resulting in faster shutdown times with, presumably, no ill effects.
  • An uninterruptibly sleeping process may not terminate (and free its resources) even when sent SIGKILL. This is one of the few cases in which a UNIX system may have to be rebooted to solve a temporary software problem.
192 questions
10
votes
3 answers

Is there some cases in which SIGKILL will not work?

Are there any cases where an application running on Linux, which has not blocked signal SIGKILL, will not get killed on firing SIGKILL signal?
Mandar
  • 693
  • 2
  • 9
  • 19
10
votes
1 answer

Python script terminated by SIGKILL rather than throwing MemoryError

Update Again I have tried to create some simple way to reproduce this, but have not been successful. So far, I have tried various simple array allocations and manipulations, but they all throw an MemoryError rather than just SIGKILL crashing. For…
rkh
  • 1,761
  • 1
  • 20
  • 30
8
votes
2 answers

iPhone app running Simulator 4.0 received Sigkill

I just got the iPhone SDK 4 and I'm trying to leave off developing an app I was working on before. So I implemented both -(void)applicationDidEnterBackground:(UIApplication *)application and - (void)applicationWillTerminate:(UIApplication…
NickDK
  • 999
  • 10
  • 24
8
votes
1 answer

SIGKILL init process (PID 1)

I'm facing a weird issue regarding sending signal 9 (SIGKILL) to the init process (PID 1). As you may know, SIGKILL can't be ignored via signal handlers. As I tried sending SIGKILL to init, I noticed that nothing was happening; init would not get…
Alex
  • 635
  • 6
  • 15
8
votes
2 answers

SIGKILL signal handling

If a linux process is waiting for I/O (i.e it is in SLEEP state) and a SIGKILL signal is issued against it, upon termination (STOPPED state) will it pass through RUNNING or READY state? In other words, for a process to handle a system interrupt such…
Radu Stoenescu
  • 3,187
  • 9
  • 28
  • 45
7
votes
1 answer

Why can't I CTRL-C a sleep infinity in docker when it runs as PID 1

Case: we have a docker container that runs a bash script that needs to "block" forever (because it exposes a volume for another container, but there are other reasons why we sometimes want this). I thought this could work then: exec sleep…
Otto
  • 1,787
  • 1
  • 17
  • 25
7
votes
1 answer

Debugging SIGKILL on glDrawArrays(). iPhone iOS

I hope someone can help me to figure out what is going on. I’m developing an iPhone game using cocos2d framework. From time to time I’m getting my code stopped because of SIGKIL signal. If I press “continue” button, the game continues without any…
Marmot
  • 117
  • 8
6
votes
2 answers

Killed process by SIGKILL

I have a process that get killed immediately after executing the program. This is the code of the compiled executable, and it is a small program that reads several graphs represented by numbers from standard input (a descriptive file usually) and…
Youssef Khloufi
  • 685
  • 3
  • 13
  • 24
6
votes
6 answers

c/linux infinite loop application: deallocate memory if kill -9 command is called

I developed a C application in linux that contains an infinite loop while(1). There are some pointers that are dynamically allocated and are useful under the infinite loop, so the only time to deallocate memory is after interrupting the while(1) by…
Kallel Omar
  • 1,208
  • 2
  • 17
  • 51
6
votes
1 answer

Unable to `syscall.Kill()` a daemonized Go process

I made program in Go that kills a process with syscall.Kill() But if I daeminze that process with fork() + setsid() then syscall.Kill() does not kill that process. If I use shell kill then I'm able to kill that process in both cases. I tried…
Eugene
  • 257
  • 1
  • 6
5
votes
1 answer

Weird EXC_Crash (SIGKILL) error report

When I start my app on device, the screen goes black and the app crashes. But the screen remains black rather than typical crash where you are brought back to springboard. Here's my crash error: Incident Identifier:…
sumderungHAY
  • 1,337
  • 18
  • 30
5
votes
3 answers

How to kill all processes of a Python program?

I am running a Python program service_host.py, which started multiple processes. And when I use ps -ef | grep python to check the pids, it shows a lot: congmin 26968 22897 0 Jun20 ? 00:00:00 python service_host.py congmin 26969 22897 0…
marlon
  • 6,029
  • 8
  • 42
  • 76
5
votes
1 answer

Catching SIGTERM from alpine image

I was trying to catch SIGTERM signal from a docker instance (basically when docker stop is called) but couldn't find a way since I have different results for each try I performed. Following is the setup I have Dockerfile FROM…
5
votes
2 answers

Handle if a process killed externally

I am writing a program where i am creating multiple threads in a process. I need to handle that if the process is killed externally by someone by using kill -9 signal or Ctrl + C, my program should do some action before closing e.g. it should change…
chumak
  • 117
  • 1
  • 9
5
votes
3 answers

Signal passing to managed processes using supervisord

I am using supervisord to spawn and manage a FastCGI application that I am writing in C for a linux target. I have a signal handler that gracefully exits my application when SIGINT is received. I have verified that the signal handler works as…
HikeOnPast
  • 456
  • 4
  • 13
1
2
3
12 13