-
-
Notifications
You must be signed in to change notification settings - Fork 319
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: attempt to write outside buffer bounds #94
Comments
Interestingly, I added a console.log here: exports.hexToBinary = function (str) {
console.log(str.length);
return new Buffer(str, 'hex').toString('binary')
} and apparently, the string is just 40 characters... |
Now getting a similar error here: node_modules/torrent-discovery/node_modules/bittorrent-tracker/node_modules/ws/lib/Receiver.js:386
default: srcBuffer.copy(dstBuffer, dstOffset, 0, length); break;
^
RangeError: out of range index
at RangeError (native)
at fastCopy (/node_modules/torrent-discovery/node_modules/bittorrent-tracker/node_modules/ws/lib/Receiver.js:386:24)
at Receiver.add (/node_modules/torrent-discovery/node_modules/bittorrent-tracker/node_modules/ws/lib/Receiver.js:86:3)
at TLSSocket.realHandler (/node_modules/torrent-discovery/node_modules/bittorrent-tracker/node_modules/ws/lib/WebSocket.js:800:20)
at emitOne (events.js:77:13)
at TLSSocket.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:146:16)
at TLSSocket.Readable.push (_stream_readable.js:110:10)
at TLSWrap.onread (net.js:523:20) Strange... Maybe this is due to the wrtc module not being compiled properly? |
Well, those errors seem to go away with node 0.12.7. |
Getting a similar error from an entirely different code base - but I notice the |
got the same error on |
Sadly, I can't figure out what the issue might be without more information. Are you using a memory-constrained device like a Raspberry Pi? What do you think might be causing this? |
no, modern laptop - I don't think the actual issue matches the error message. I think |
Okay, thanks for letting me know. I think we're going to move away from |
@feross curious what you plan to replace it with. I was daydreaming about a module that would summon a headless electron process, setup an rpc over a stream, and create remote versions of the wrtc classes that mirrored their behaviour in the electron runtime. but seems like a large api surface area and would be a challenge to reproduce any synchronous behaviour. |
@kumavis - that's actually something I've though of before! I think it actually might be possible too :) However, I'm currently placing my hopes in https://github.com/nickdesaulniers/node-rtc-peer-connection by @nickdesaulniers. If that works out, it'll be a pure JavaScript WebRTC implementation, and all our problems will be solved 👍 |
ah, nice! the javascript singularity approaches... |
Indeed! |
FWIW, I got this same error in an unrelated project on Node 5.5 because I tried to send a Buffer through a node-webrtc DataChannel. I don't know how that could have caused the original error, though, because it seems like simple-peer takes care of converting from Buffers. For anyone who searches for this error message, you might instead want to check out node-webrtc/node-webrtc#103, "Allow sending node.js Buffer objects." |
@paulkernfeld thanks for the link. At this point, I'm really hoping someone would take over node-webrtc and do a rewrite from scratch. If only I didn't suck at C++... |
There's an issue about this on the main webtorrent repo: webtorrent/webtorrent#820 where we've made progress toward fixing this. |
Getting this error when my client tries to connect to a webrtc peer:
The text was updated successfully, but these errors were encountered: