[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: python 2.4: os.urandom() hangs if /dev/random, /dev/urandom are not

From: olafBuddenhagen
Subject: Re: python 2.4: os.urandom() hangs if /dev/random, /dev/urandom are not reconnected to a translator
Date: Sat, 27 Jan 2007 15:33:36 +0100
User-agent: Mutt/1.5.13 (2006-08-11)


On Thu, Jan 25, 2007 at 11:36:01PM +0000, massimo s. wrote:

> I noticed that gconf-schemas was hung (even overnight) until ctrl-c is
> pressed.
> When using ctrl-c python gives the following traceback, showing the
> instruction where it hangs:
> File "/usr/lib/python2.4/os.py", line 723, in urandom bytes +=
> read(_urandomfd, n - len(bytes))

> At first I tried showtrans on the /dev/random, /dev/urandom devices
> and I found they were attached to the unofficial translator
> (http://hurd.gnufans.org/bin/view/Hurd/RandomDevice). Resetting
> /dev/random, /dev/urandom by detaching (settrans -fg /dev/urandom) and
> then reattaching the translator fixed the bug. If I release the
> translator the bug comes out again.

Does it also hang if you don't have a translator there at all?

>From the above description, it sounds like this is indeed a bug in the
urandom translator: The read() operation never returns.

There is no simple way to protect against such misbehaviour in a
translator, so I don't think there is anything to fix on the Python


reply via email to

[Prev in Thread] Current Thread [Next in Thread]