Skip to content

Random parse failure in Net::DNS::Resolver#query_tcp when querying MX records from 8.8.4.4 #71

@postmodern

Description

@postmodern

I've only been able to reproduce this in a Digital Ocean VM which uses 8.8.8.8 and 8.8.4.4 for nameservers by default, with net-dns 0.8.0 and ruby 2.2.4.

Steps to Reproduce

  1. gem 'net-dns', '0.8.0'
  2. require 'net/dns'
  3. resolver = Net::DNS::Resolver.new(use_tcp: true, nameservers: '8.8.4.4')
  4. resolver.query('wwpinfo.com', Net::DNS::MX).each_mx { |pref,mx| puts "#{pref}\t#{mx}" }

Backtrace

ArgumentError: comparison of Fixnum with nil failed
    from /srv/app/vendor/bundle/ruby/2.2.0/gems/net-dns-0.8.0/lib/net/dns/resolver.rb:1174:in `<'
    from /srv/app/vendor/bundle/ruby/2.2.0/gems/net-dns-0.8.0/lib/net/dns/resolver.rb:1174:in `block (2 levels) in query_tcp'
    from /usr/lib/ruby/2.2.0/timeout.rb:88:in `block in timeout'
    from /usr/lib/ruby/2.2.0/timeout.rb:32:in `block in catch'
    from /usr/lib/ruby/2.2.0/timeout.rb:32:in `catch'
    from /usr/lib/ruby/2.2.0/timeout.rb:32:in `catch'
    from /usr/lib/ruby/2.2.0/timeout.rb:103:in `timeout'
    from /srv/app/vendor/bundle/ruby/2.2.0/gems/net-dns-0.8.0/lib/net/dns/resolver/timeouts.rb:40:in `timeout'
    from /srv/app/vendor/bundle/ruby/2.2.0/gems/net-dns-0.8.0/lib/net/dns/resolver.rb:1160:in `block in query_tcp'
    from /srv/app/vendor/bundle/ruby/2.2.0/gems/net-dns-0.8.0/lib/net/dns/resolver.rb:1152:in `each'
    from /srv/app/vendor/bundle/ruby/2.2.0/gems/net-dns-0.8.0/lib/net/dns/resolver.rb:1152:in `query_tcp'
    from /srv/app/vendor/bundle/ruby/2.2.0/gems/net-dns-0.8.0/lib/net/dns/resolver.rb:1007:in `query'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions