I have a strange behavior on my system.
When I invoke a command in the shell (bash version 4.2.45(1)-release), say top
or cat
, the running program (the process) does not respond to Ctrl+C. I even tried to run kill -2 <pid>
and kill -15 <pid>
, but it didn't help. However, I can kill processes with SIGKILL
.
I own the process, I even tried to send a signal to the process (signals 2 and 15) as root but it did not respond. I can quit top
if I press q
.
Any ideas about the problem? Or any hint to troubleshoot it?
UPDATE 1
cat
and top
were just examples. All processes have the same behavior. I tried to write a simple program to sleep only (without signal handler) and I had the same behavior.
UPDATE 2
I wrote a small program to sleep only. This time I installed signal handler to catch SIGTERM
and SIGINT
. When I invoked kill -15 <pid>
(and so with -2
), my program did not receive the signal!
I also updated the kernel to 3.11.10-100.fc18.i686
and still having the same problem.
Best Answer
Recent versions of the nVidia proprietary drivers (possibly combined with other recent versions of libraries) have a bug which causes them to corrupt the signal mask.
You can look at signal masks like this:
That's about what it should look like. If you run that on a system with the proprietary nVidia drivers, you'll see all kinds of crazy values for
BLOCKED
, for many of your programs—including, likely, all the misbehaving ones.Note that signal masks are passed from parent to child through
fork
/exec
, so once a parent process has a corrupt one, all the children it spawns from that point forward will, too.See also my question After upgrade, X button in titlebar no longer closes xterm and various distro bugs you'll be able to find now, knowing which package to look at. You can modify the code in my answer to that question to reset the signal mask to none blocked (Elide
sigaddset
and changeSIG_UNBLOCK
toSIG_SETMASK
).