Welcome to MSDN Blogs Sign in | Join | Help

What's you're favorite Infinite Loop bug?

The best feature of my dual proc machine is the ability to kill off bad processes that attempt to spike the cpu. When a process goes crazy on the dual proc, the machine becomes slightly sluggish. Checking taskman tends to show a process hovering at exactly 50% cpu usage. A single threaded app (or 1 thread in a multi-threaded app) is in an infinite loop. On a single proc machine the bad process can take so much cpu that it simply isn't feasible to identify and kill the process.

 

This 'feature' works because most applications are single threaded. To seriously hang a dual proc machine you need to have two threads that both contribute to the 'infinite loop'. Even if you have a multi-threaded application, and a bug or two that would cause an infinite loop on two threads, there is still one layer of protection. Multi-threaded applications are hard to write, so most fail to achieve significant parallelism. There is a reasonable chance one thread will end up blocked waiting on the other thread to finish. Herb Sutter thinks this happy accident is something that needs to be fixed.  He's probably right ... but I'll miss my favorite feature.

 

As an undergrad, I made my own 'infinite loop' bug that would still toast my dual proc machine today. I was using an HPUX box that had a gigantic harddrive.  It was something like 1 Gig, allowing for lots of virtual memory. I was writing some visualization code for computational chemists. The code would use fork() to run the chemist's FORTRAN code in another process while an XWindows application would grab the stdout. This allowed them to do visualization for things like Monte Carlo simulations, but continue making their code as command line Executables in FORTRAN. Early in development I had this nice bug where the process would fork twice then die. This had the interesting feature of creating an exponential cascade of processes with no easy way to kill it off.  It took about 10 minutes for the massive amount of virtual memory to be exhausted and the machine to reboot. I was remotely logged in so I couldn't just hit the big red button. Fortunately the chemist's were not running any of their week-long simulations at the time.

 

Do you have any stories of infinite loop bugs?

Published Wednesday, September 07, 2005 1:58 PM by SteveJS
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: What's you're favorite Infinite Loop bug?

A HyperThreading processor also has the same characteristic where it is not possible for an infinite loop to consume so much CPU that you can't terminate the process. Interestingly, on a HyperThreading CPU, a single process/thread can still take 100% of the CPU as reported by Windows. So there is an interesting situation there.
Wednesday, September 07, 2005 5:42 PM by tzagotta

# re: What's you're favorite Infinite Loop bug?

Not very specific at all but I was always dissapointed how easy it was to put classic ASP & IIS5 into an infinite loop.

One example I recently ran into was I populated a RecordSet and looped through it but forgot to put the code needed to move to the next record so the loop never ended, going as fast as the CPU would allow it.

Obviousy IIS6/Win2003 fixed this issue as far as I've seen but I haven't stress tested it to be sure.
Wednesday, September 07, 2005 7:38 PM by Travis Owens

# re: What's you're favorite Infinite Loop bug?

I have 2 "favorite" infinite loops bugs. The classic one in ATI drivers. Which is why I will never ever buy an ATI card again. Go to sleep at night wake up to find windows opengl screen savers caused ati.drv to go into an infinite loop. Of course they patched it and patched it and patched it. Sometimes the drivers would recognize only recognize 4x agp and sometimes it would find my full 8 speed. And every patch broke something else. I finally went back to Nvidia and problem solved.

My other good one which was a real problem was I have servers at EDS, they insist on installing their own server monitoring software. Which is ok if they are responsible for the uptime on the servers. Well this monitoring software constantly went into infinite loops. On a high trafficked database server and web server, this causes some problem. They disabled the monitoring software until it got a patch for it.
Thursday, September 08, 2005 9:32 AM by Jeff Parker

# re: What's you're favorite Infinite Loop bug?

my favorite infinite loop is when your playin a game and your so deep into it and its like the last level and then bammmmm there it goes the infinite loop YEAAAAAAAA BABYYYYYYYYYY
Thursday, March 09, 2006 2:44 AM by Gsxrmike69

# Bug Babble What s you re favorite Infinite Loop bug | Insomnia Cure

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker