Tuesday, July 13, 2010

Futex_wait in Eclipse on Linux

Sometimes, my Eclipse hangs indefinitely. For those of you who don't know, Eclipse is an editor that programmers use to create code. "Hangs" in this case means that the Eclipse window gets gray and not responsive.
In the system monitor, I see that Java, in which Eclipse runs, is stalled in something called "futex_wait". Futex is something that allows multiple threads/processes to control access to shared resource. There seems to be no way to resolve the problem. Rebooting my computer - I run Ubuntu linux 10.04 - doesn't solve the problem. What does solve the problem every time it occurs here, is the following.

I have a second Eclipse installation on my computer. I start this Eclipse, with a different workspace. Then I open the original workspace, the one I use for my projects, and save it. I exit Eclipse, start the original Eclipse, open the workspace, and presto! it works. If it doesn't, you may have to play with different workspaces in both Eclipses, but eventually, you should be able to solve the futex_wait problem, which apparently is a combination of errors in the workspace and in the Eclipse installation.

The reason I have two Eclipses is that I used to install Eclipse from eclipse.org, but currently, Ubuntu has the same version of Eclipse in their distribution, which is easier to install and upgrade. The drawback is that moving your tools - the update sites - to a new instance of Eclipse is cumbersome and not always straightforward.

Anyway, I can go back to work now :-)

No comments: