dnspython-1.7* uses /dev/random which might block on lucid
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
The Trac Project |
New
|
Undecided
|
Unassigned | ||
dnspython (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Lucid |
Fix Released
|
Medium
|
Scott Kitterman |
Bug Description
The python-dnspython package (most specifically, dns/resolver.py at line 25-29) uses /dev/random to get random data. I observed that this blocks on /some/ machines that have Ubuntu 10.04 installed. It does not seem to happen on older versions. This causes the import of dns.entropy to block most of the time (but not always).
The solution is to use /dev/urandom instead. Two possible ways to solve this problem:
1. Provide a 1.8.0 package in the main repositories - it seems to have the bug fixed and is a maintenance release according to the homepage
2. replace '/dev/random' with '/dev/urandom' in entropy.py, line 25. I tested this solution and it no longer causes the import to block.
TEST CASE:
It seems as if the problem does not occur on *all*, but only *most* systems running lucid - presumably systems with not to much entropy, like servers. On affected systems, the command
python -c "from dns import entropy"
hangs. After applying the above patch, the system no longer hangs.
Related branches
description: | updated |
tags: |
added: verification-done removed: verification-needed |
tags: | added: testcase |
In case anyone runs into the same problem, I was getting several-minute freezes using python-xmpp (xmpppy), even with a single line program "import xmpp" and nothing else, and this turned out to be the cause.