A runaway program experience in Ubuntu

My dream of finding a perfect Operating System (or a near perfect) in Ubuntu was dashed today. So far I have had a pretty good impression of the Ubuntu user interface, and have not used anything out of the ordinary but a regular user usage. Today I was running a Ruby on Rail program that was supposed to do some rather heavy duty processing such as parsing a flat file and creating an XML file. And that application just "ran away" and left me in a situation where I was unable to regain control of my OS. The application has not crashed because I could see the hard disk light blinking away non-stop. My mouse pointer is constantly at the`wait state. When I tried to move the move, it was like nothing happened, and then it will shoot in the direction I was moving and then I would lose control of the mouse again. After a while, the application window became greyed out.

I have other windows opened but I could not switch to any of the windows, and neither could I start up a Terminal window either. In a Windows XP environment, I would use the Ctrl-Alt-Del for the Task Manager to kill that task. Of course, Ctrl-Alt-Del combination didn't seem to do anything in this situation. I tried putting it into hibernation (this is a laptop) hoping that perhaps that will temporarily suspend the program. But no deal. It still continue doing whatever it is doing, and I have no idea what. All I could see is that non-stop blinking hard disk light.

Did a search on the Internet for something like a task manager thing in Ubuntu or how to kill a runaway program. Aha! I found out that pressing Alt-F2 while in that program window and then type xkill will allow me to kill that program. Now I gotcha. Confidently I press that key combination, and nothing! Next I tried Ctrl-Alt-Backspace which is supposed to stop the graphic display and then restart it. That iwould kill the program in the process. Again no response from my computer. Next I tried Ctrl-Alt-F1 - F5 which will start up the virtual Terminal session. And perhaps with a virtual session in place (and in control), I could at least wrestle to get back control of my computer. Even that could not do anything. I couldn't believe it, and an application could gain control of my system and "lock" me out. Something like out of a science fiction movie, where a computer has gain control of the system and is running th e world.

The simplest thing (though not necessarily the wisest thing) I could do is just to turn off the computer power. That would surely take care of whatever that thing may be that is holding me hostage. But pride just wouldn't let go of me, that I should admit defeat to that dark invader. And so I plod on trying to find an answer, while my laptop continue churning away doing whatever it is doing. I really wish I could see exactly what it is doing rather than just knowing it is doing something (from the blinking hard disk light). By now it has been running almost 45 minutes, and I was near going crazy with determination to beat this thing.

Finally I found this Emergency Reboot Procedures (I'm highly tempted to switch off the computer and kill that that darn thing instantly) and they are as follows in the proper sequence:

  • Ctrl+Alt+SysRq+R
    Switches the keyboard mode.
  • Ctrl+Alt+SysRq+S
    Writes all data to the disks, necessary to avoid data corruption, unsaved files will still be lost.
  • Ctrl+Alt+SysRq+E
    Tries to end processes in a nice way. Allow a little bit of time before you use the next command.
  • Ctrl+Alt+SysRq+I
    Tries to forcefully kill processes that have not closed.
  • Ctrl+Alt+SysRq+U
    Temporarily makes the hard disks read-only, this makes it safe to reboot.
  • Ctrl+Alt+SysRq+B
    Force reboot.

And here it goes... Ctrl-Alt-SysRq-R. Aargh... nothing. There is really a dark force which have taken over control of my computer. Next tried Ctrl-Alt-SysRq-S and again nothing seems to be working. (Or maybe it is but I just don't see it). Never mind, just have to try the next thing in line. Ctrl-Alt-SysRq-E and something did happened. The hard disk light stopped blinking and now my computer totally foze. Even the mouse wait icon isn't moving any more. Hmmm.. well, might as well finish the whole sequence and see what other surprises there are. To cut the story short, I went through the whole sequence, and in the end all I have is a frozen screen now. Even the Force Reboot sequence didn't do anything? That can't be right. I decided to give it one more try... Ctrl-Alt-SysRq-B and voila! The computer rebooted finally! Although I have lost the work I was doing, but at least I'm happy that I proved to myself that I am still in control in the end.

This has been an interesting experience and I learned new stuff about the Emergency Reboot Procedures. And looks like this will not be the last time I use this procedures. I have the same thing happening to me again a few more times, since I wrote this blog entry. Must be something that occurred after I have had the last software updates installed. That will be a blog entry for another day.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
13 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.