eliasben2003 / namebench

Automatically exported from code.google.com/p/namebench
Apache License 2.0
0 stars 0 forks source link

Fails with string index out of range (dnspython 1.7.1 thread-safety bug) #96

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Running Fedora 11 with latest patches as of 2010-01-15
2.Just downloaded and ran namebench.py 
3.

What is the expected output? What do you see instead?
Expected to see benchmark results, instead I saw a lot of trace information.

What version of the product are you using? On what operating system?

Please provide any additional information below.

$ ./namebench.py 
- python-tk (tkinter) libraries are missing, falling back to command-line
interface.

namebench 1.1 - data/alexa-top-10000-global.txt (weighted) on 2010-01-15
10:17:19.390249
threads=45 tests=200 runs=1 timeout=2.0 health_timeout=3.5 servers=11
------------------------------------------------------------------------------
- Checking query interception status...
- Checking connection quality: 1/2..2/2
- Congestion level is 1.68X (check duration: 67.17ms)
- Applied 1.68X timeout multiplier due to congestion: 3.4 standard, 5.9 health.
- Checking latest sanity reference
- Checking nameserver health
- Building initial DNS cache for 3240 nameservers [45 threads]
- Checking nameserver availability:
0/3240.................................................
................................................................................
...........
................................................................................
...........
................................................................................
...........
......649.......................................................................
...........
................................................................................
...........
................................................................................
...........
................................................................................
...1335....
................................................................................
...........
................................................................................
...........
................................................................................
...........
......................................................................2021......
...........
................................................................................
...........
................................................................................
...........
................................................................................
...........
........................................................2704....................
...........
................................................................................
...........
................................................................................
...........
.............................................................3240/3240
- 2778 of 3240 name servers are available
- Running initial health checks on 648 servers:
0/648......................................
................................138.............................................
...........
...........269...................................Exception in thread Thread-74:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 522, in __bootstrap_inner
    self.run()
  File
"/home/bpetersen/Download/namebench-1.1/libnamebench/nameserver_list.py",
line 104, 
in run
    self.results.put(ns.CheckHealth(sanity_checks=self.checks))
  File
"/home/bpetersen/Download/namebench-1.1/libnamebench/health_checks.py",
line 226, in
 CheckHealth
    (is_broken, warning, duration) = function(*args)
  File
"/home/bpetersen/Download/namebench-1.1/libnamebench/health_checks.py",
line 61, in 
TestAnswers
    (response, duration, error_msg) = self.TimedRequest(record_type,
record, timeout)
  File "/home/bpetersen/Download/namebench-1.1/libnamebench/nameserver.py",
line 199, in Ti
medRequest
    request = self.CreateRequest(record, request_type, dns.rdataclass.IN)
  File "/home/bpetersen/Download/namebench-1.1/libnamebench/nameserver.py",
line 174, in Cr
eateRequest
    return dns.message.make_query(record, request_type, return_type)
  File "/usr/lib/python2.6/site-packages/dns/message.py", line 1032, in
make_query
    m = Message()
  File "/usr/lib/python2.6/site-packages/dns/message.py", line 137, in __init__
    self.id = dns.entropy.random_16()
  File "/usr/lib/python2.6/site-packages/dns/entropy.py", line 92, in random_16
    return pool.random_16()
  File "/usr/lib/python2.6/site-packages/dns/entropy.py", line 69, in random_16
    return self.random_8() * 256 + self.random_8()
  File "/usr/lib/python2.6/site-packages/dns/entropy.py", line 64, in random_8
    value = ord(self.digest[self.next_byte])
IndexError: string index out of range

Exception in thread Thread-50:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 522, in __bootstrap_inner
    self.run()
  File
"/home/bpetersen/Download/namebench-1.1/libnamebench/nameserver_list.py",
line 104, 
in run
    self.results.put(ns.CheckHealth(sanity_checks=self.checks))
  File
"/home/bpetersen/Download/namebench-1.1/libnamebench/health_checks.py",
line 226, in
 CheckHealth
    (is_broken, warning, duration) = function(*args)
  File
"/home/bpetersen/Download/namebench-1.1/libnamebench/health_checks.py",
line 61, in 
TestAnswers
    (response, duration, error_msg) = self.TimedRequest(record_type,
record, timeout)
  File "/home/bpetersen/Download/namebench-1.1/libnamebench/nameserver.py",
line 199, in Ti
medRequest
    request = self.CreateRequest(record, request_type, dns.rdataclass.IN)
  File "/home/bpetersen/Download/namebench-1.1/libnamebench/nameserver.py",
line 174, in Cr
eateRequest
    return dns.message.make_query(record, request_type, return_type)
  File "/usr/lib/python2.6/site-packages/dns/message.py", line 1032, in
make_query
    m = Message()
  File "/usr/lib/python2.6/site-packages/dns/message.py", line 137, in __init__
    self.id = dns.entropy.random_16()
  File "/usr/lib/python2.6/site-packages/dns/entropy.py", line 92, in random_16
    return pool.random_16()
  File "/usr/lib/python2.6/site-packages/dns/entropy.py", line 69, in random_16
    return self.random_8() * 256 + self.random_8()
  File "/usr/lib/python2.6/site-packages/dns/entropy.py", line 64, in random_8
    value = ord(self.digest[self.next_byte])
IndexError: string index out of range

and on and on.

Original issue reported on code.google.com by billyroy on 15 Jan 2010 at 4:25

GoogleCodeExporter commented 8 years ago
This is due to a thread-safety bug in the dnspython libraries that are 
installed on
your machine. namebench ships with it's own "fixed" copy of the dnspython 
library.
You should be able to use them if you deinstall your system copy of dnspython, 
or set
the PYTHONPATH variable:

PYTHONPATH="/home/bpetersen/Download/namebench-1.1/third_party"

Or you could copy the fixed third_party/dns/entropy.py to
/usr/lib/python2.6/site-packages/dns/entropy.py

The dnspython folk know about the issue and should be releasing a fix for this 
bug soon.

Original comment by thomas.r...@gmail.com on 26 Jan 2010 at 8:48

GoogleCodeExporter commented 8 years ago
Issue 112 has been merged into this issue.

Original comment by helixblue on 26 Mar 2010 at 1:09

GoogleCodeExporter commented 8 years ago
This is fixed in the upstream version of dnspython now (1.8.0). If you have 
this problem 
and the other workarounds are not sufficient, make sure you download it:

http://www.dnspython.org/

Original comment by helixblue on 26 Mar 2010 at 7:05

GoogleCodeExporter commented 8 years ago
Issue 113 has been merged into this issue.

Original comment by helixblue on 26 Mar 2010 at 7:06