Cure Of The Notorious Ubuntu futex_wait Bug
May 28, 2009 at 11:32 pm Siddhartha 1 comment
It all started two months back, when DC++ suddenly stopped working on my Ubuntu 8.10 – the Intrepid Ibex. Each time I tried running it, it would hang : the Interface Window would turn gray and not respond. I’d have to use the Force Quit application or kill the process from the System Monitor list of processes. I tried reinstalling DC++, but it didn’t solve the purpose. Soon other programs caught the infection and started exhibiting the same strange behaviour : Firefox, Gnome-do, EOG, python, and gvfs-fuse-daemon would hang at different times without issuing any warning. One day I noticed – in the Waiting Channel tab of the System Monitor – that they had a common waiting channel, “futex_wait”. I looked at the futex man page and learnt that futexes ( or better Fast Userspace muTexes ) were semaphores or mutex locks provided by Ubuntu to allow threads to work concurrently. The implications were clear : these multi-threaded applications were waiting on a futex and the duration of the wait indicated a deadlock.
The book “Operating System Principles” by Silberschatz, Galvin and Gagne says that in most Operating Systems, the method of handling deadlocks is to ignore deadlocks altogether and pretend that they never occur in the system. Further, it says that both Windows and UNIX use this solution. I researched a bit on the Internet and found that indeed it was a bug in the latest Ubuntu 2.6.27-* Kernels and the Ubuntu community was working on it to make sure the newer kernels don’t fall prey to this problem.
I had learnt to live with the shortcoming until today when luckily I found a workaround for the problem. It turns out that switching off the “Assistive Technologies” does the trick.
Go to System > Preferences > Assistive Technologies
uncheck the “Enable Assistive Technologies” options.
1.
Andrew P. | August 25, 2011 at 6:33 am
It isn’t the Assistive Technologies that’s at fault. I had an Ubuntu 8.10 system that ran with all Assistive Technologies disabled, and certain applications would regularly hang with a futex_wait_queue_me in the Waiting Channel. I’m now running Ubuntu 10.04.1 LTS, and it’s as bad as ever. The programs that have the worst record in this regard are Firefox and SeaMonkey, both Mozilla projects, and they share code. I’ve tried disabling all extensions and running in Safe Mode, but it doesn’t seem to make any difference. Strangely, it seems to be time-of-day and day-of-month dependent. The problem always gets acute in the late afternoon, around 3 p.m. by the system clock, and late in the month. I was running SeaMonkey just fine for several weeks. Today (August 24), it has become unusable. The same thing happened at the end of July and at the end of June. Strangely, a couple of days later I can fire up either browser, and barring an encounter with a nasty site or running Flash content, the browsers will run for days on end without hanging. (I’m posting this comment with Opera, which doesn’t seem to be affected by the futex_wait bug.)