Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeError #4

Open
mattjay opened this issue Aug 13, 2013 · 16 comments
Open

RangeError #4

mattjay opened this issue Aug 13, 2013 · 16 comments

Comments

@mattjay
Copy link
Contributor

mattjay commented Aug 13, 2013

Get an interesting error & I'm not sure what is causing it.
I've included the most recent question I got to the server and the error dump.

IPADDRESS:21018/udp4 {"id":11130,"type":"request","responseCode":0,"opcode":"query","authoritative":false,"truncated":false,"recursion_desired":false,"recursion_available":false,"authenticated":false,"checking_disabled":false,"question":[{"name":"MYDOMAIN.com","type":"A","class":"IN"}]}

buffer.js:579
throw new RangeError('Trying to access beyond buffer length');
^
RangeError: Trying to access beyond buffer length
at checkOffset (buffer.js:579:11)
at Buffer.readUInt8 (buffer.js:585:5)
at domain_parts (/home/MYREPO/node_modules/dnsd/parse.js:274:20)
at add_record (/home/MYREPO/node_modules/dnsd/parse.js:167:16)
at Object.sections (/home/MYREPO/node_modules/dnsd/parse.js:161:7)
at Request.DNSMessage.parse (/home/MYREPO/node_modules/dnsd/message.js:99:30)
at Request.DNSMessage (/home/MYREPO/node_modules/dnsd/message.js:55:10)
at new Request (/home/MYREPO/node_modules/dnsd/server.js:158:11)
at Server.on_udp (/home/MYREPO/node_modules/dnsd/server.js:148:13)
at Socket. (/home/MYREPO/node_modules/dnsd/server.js:45:54)
at Socket.EventEmitter.emit (events.js:98:17)

Any help or suggestions would be greatly appreciated.

@mattjay
Copy link
Contributor Author

mattjay commented Aug 28, 2013

Seeing this more and more often on any server I use running dnsd

Will try to diagnose today but anybody else seeing this issue and have any insight?

IPADDRESS:33582/udp4 {"id":58080,"type":"request","responseCode":0,"opcode":"query","authoritative":false,"trun
cated":false,"recursion_desired":true,"recursion_available":false,"authenticated":false,"checking_disabled":false,"
question":[{"name":"www.DOMAIN.com","type":"A","class":"IN"}]}

buffer.js:579
    throw new RangeError('Trying to access beyond buffer length');
    ^
RangeError: Trying to access beyond buffer length
at checkOffset (buffer.js:579:11)
at Buffer.readUInt8 (buffer.js:585:5)
at domain_parts (/home/MYREPO/node_modules/dnsd/parse.js:274:20)
at add_record (/home/MYREPO/node_modules/dnsd/parse.js:167:16)
at Object.sections (/home/MYREPO/node_modules/dnsd/parse.js:161:7)
at Request.DNSMessage.parse (/home/MYREPO/node_modules/dnsd/message.js:99:30)
at Request.DNSMessage (/home/MYREPO/node_modules/dnsd/message.js:55:10)
at new Request (/home/MYREPO/node_modules/dnsd/server.js:158:11)
at Server.on_udp (/home/MYREPO/node_modules/dnsd/server.js:148:13)
at Socket. (/home/MYREPO/node_modules/dnsd/server.js:45:54)
at Socket.EventEmitter.emit (events.js:98:17)

@jhs
Copy link
Member

jhs commented Aug 30, 2013

Hi, @mattjay. I have not forgotten you! This is a very interesting bug. I have to say, we use dnsd to run npmjs and I have never seen this problem, so you have found some sort of untested or unexercised code.

Is it possible for you to run tcpdump or something and capture the DNS packets? Would you mind attaching a .pcap file (or sending it to me privately)?

One mystery is whether the 58080 request there is the problem, or if the packet after that is the problem. The bug is in the parsing code, but that log message indicates a successful parse. So I wonder if it is crashing on the next packet.

@jhs
Copy link
Member

jhs commented Sep 7, 2013

Okay, @mattjay, this error is coming from within inside an infinite loop. The code is obviously supposed to break out of it.

The most direct way to fix this is to capture that data that is triggering the error. You will need to either use tcpdump or edit the JavaScript code to log that message before it throws the exception. Let me know if I can help.

@BrianCraig
Copy link

Hello jhs ! i have the same problem ! Im using DNSD for a project, and i only use this module in 4 lines

var dnsd = require('dnsd');
dnsd.createServer(function(req, res) {
res.end('186.23.145.50');
}).listen(53);

But, today crashed with the same error. I am only giving some A records, that IP is my home IP, and when the error succeded i wasnt making a request to the module ( maybe other person was doing an request, but its just probably )

Im sorry for my bad English, my native language is Spanish.

-- Edit
If you want to know, im using Windows 7 ( maybe thats the reason because npmjs works great )

@jhs
Copy link
Member

jhs commented Sep 15, 2013

@BrianCraig great! That means the problem is from some request coming from the Internet.

Are you using the latest version, v0.9.4?

@BrianCraig
Copy link

@jhs No, im using 0.9.2, Im going to update the module, did you try to repair the Bug after 0.9.2 ?

@BrianCraig
Copy link

Using dnsd 0.9.4, Today got the same problem

buffer.js:582
throw new RangeError('Trying to access beyond buffer length');
^
RangeError: Trying to access beyond buffer length
at checkOffset (buffer.js:582:11)
at Buffer.readUInt8 (buffer.js:588:5)
at domain_parts (D:\vps\node_modules\dnsd\parse.js:274:20)
at add_record (D:\vps\node_modules\dnsd\parse.js:167:16)
at Object.sections (D:\vps\node_modules\dnsd\parse.js:161:7)
at Request.DNSMessage.parse (D:\vps\node_modules\dnsd\message.js:99:30)
at Request.DNSMessage (D:\vps\node_modules\dnsd\message.js:55:10)
at new Request (D:\vps\node_modules\dnsd\server.js:161:11)
at Server.on_udp (D:\vps\node_modules\dnsd\server.js:151:13)
at Socket. (D:\vps\node_modules\dnsd\server.js:45:54)
at Socket.EventEmitter.emit (events.js:98:17)

@jhs
Copy link
Member

jhs commented Sep 17, 2013

Thanks. I will need to see the data to move forward on this ticket.

@jhs
Copy link
Member

jhs commented Sep 17, 2013

@BrianCraig and @mattjay, I have two ideas, both are a bit intense. Let me know if you can help out on either one.

  1. You run tcpdump on that server and privately send me the pcap file. Basically it is a command-line tool, plus some waiting, plus some emailing.
  2. You run a modified version of dnsd where we add a feature for it to log all data received before it attempts to parse it.

I think either one of those will allow me to close this bug. Thanks!

@BrianCraig
Copy link

Ok! The only thing, im a bit noob on this, you will have to say which command should i run on tcpdump ( Server is on port 53 ), and say us when you have the branch ( which logs the data )

@BrianCraig
Copy link

remember, that im using windows ( i think there is no tcpdump ) where do i download it ?

@tommedema
Copy link

is this still a problem?

@mattjay
Copy link
Contributor Author

mattjay commented Dec 2, 2013

I'm not sure honestly since I started using forever it kind of got deprioritized for me.

@tommedema
Copy link

@mattjay how is forever related to dynamic DNS?

@mattjay
Copy link
Contributor Author

mattjay commented Dec 3, 2013

@tommedema it isn't. but if my dns is crashing here and there I'm not noticing it anymore and haven't got around to log surfing or trying to fix this error.

@codewise-nicolas
Copy link

The fix in issue #11 may fix this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants