Posts filed under ‘OS’

Python ElementTree Fix for Ubuntu

Did you face the following situation?

$python
>>> import elementtree
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named elementtree

In case you’ve installed the elementtree package correctly
(python-elementtree) and you’re using Ubuntu,the following
solution will most probably work:

instead of import elementtree, use
import xml.etree.ElementTree

( I believe you must’ve already figured out the cause of the import
failure and why the solution works.
In case you haven’t, read on.
The import failure is due to the directory structure of the
elementtree files being different in Ubuntu. Usually the python
import modules are located in /usr/lib/python
The elementtree import file (ElementTree.py) in Ubuntu however
is located at the path
/usr/lib/python/xml/etree
Hence the above change in the import parameter is necessary )

June 4, 2009 at 2:48 pm Leave a comment

Cure Of The Notorious Ubuntu futex_wait Bug

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.

May 28, 2009 at 11:32 pm 1 comment


 

June 2012
M T W T F S S
« Mar    
 123
45678910
11121314151617
18192021222324
252627282930  

Blog Stats

  • 6,440 hits

Follow

Get every new post delivered to your Inbox.