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

Error: Offset is out of bounds #773

Closed
green13 opened this issue Apr 25, 2016 · 12 comments
Closed

Error: Offset is out of bounds #773

green13 opened this issue Apr 25, 2016 · 12 comments

Comments

@green13
Copy link

@green13 green13 commented Apr 25, 2016

  • WebTorrent version: 0.90.3
  • Node.js version: 5.10.0
  • Electron: 0.37.6
  • OS: windows 8.1

Hello.
I have all files, run WebTorrent (client.add) and get error:

fs.js:620 Uncaught Error: Offset is out of bounds
    fs.read @ fs.js:620
    onread  @ C:\Projects\launcher\src\main_app\node_modules\random-access-file\index.js:84
    wrapper @ fs.js:614

Note:
My server not working, torrent can't download. Screenshot from uTorrent:
image

@rom1504

This comment has been minimized.

Copy link
Member

@rom1504 rom1504 commented Apr 25, 2016

Providing the code reproducing that problem should help ;)

@green13

This comment has been minimized.

Copy link
Author

@green13 green13 commented Apr 25, 2016

It reproducing with webtorrent-cli:

D:\downloads>webtorrent http://example.com/my.torrent 

UNEXPECTED ERROR: If this is a bug in WebTorrent, report it!
OPEN AN ISSUE: https://github.com/feross/webtorrent/issues

DEBUG INFO: webtorrent-cli 1.1.3, webtorrent 0.91.1, node v5.11.0, win32 x64, exit 1
fs.js:620
  binding.read(fd, buffer, offset, length, position, req);
          ^

RangeError: Length extends beyond buffer
    at RangeError (native)
    at Object.fs.read (fs.js:620:11)
    at onread (C:\Users\bb_hakimov\AppData\Roaming\npm\node_modules\webtorrent-cli\node_modules\random-access-file\index.js:84:8)
    at FSReqWrap.wrapper [as oncomplete] (fs.js:614:17)

For some files i get RangeError: Length extends beyond buffer on the same line.

@rom1504

This comment has been minimized.

Copy link
Member

@rom1504 rom1504 commented Apr 25, 2016

How did you create that torrent ? Do you have an example of such torrent ? (without copyrighted content)

@green13

This comment has been minimized.

Copy link
Author

@green13 green13 commented Apr 26, 2016

I think problem not in .torrent. May be problem in file: LifeRace.zip

D:\LifeRace Launcher\main_app\resources\app.asar\node_modules\random-access-file\index.js:84 ..\downloads\LifeRace\LifeRace\Saved\Logs\LifeRace.log RangeError: Length extends beyond buffer(…)
onread @ D:\LifeRace Launcher\main_app\resources\app.asar\node_modules\random-access-file\index.js:84
wrapper @ fs.js:614
@rom1504

This comment has been minimized.

Copy link
Member

@rom1504 rom1504 commented Apr 26, 2016

If we can't reproduce your problem, it's harder to fix it ;)

@green13

This comment has been minimized.

Copy link
Author

@green13 green13 commented Apr 26, 2016

I understand and fully agree, but don't know how reproduce error. I attached file from error, but it looks normal.

@rom1504

This comment has been minimized.

Copy link
Member

@rom1504 rom1504 commented Apr 26, 2016

LifeRace.log is the file contained in your torrent ?

Does that error happen in every torrent for you ? If not it looks like the problem is in that torrent.

@green13

This comment has been minimized.

Copy link
Author

@green13 green13 commented Apr 26, 2016

Yes, LifeRace.log contained in my torrent.

Not in every torrent. Yes, it's problem that torrent, but it's not the problem for uTorrent as an example.

For generate torrent I use create-torrent.

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Apr 29, 2016

@green13 Can you share the code or command line arguments you used to create the torrent?

@green13

This comment has been minimized.

Copy link
Author

@green13 green13 commented Apr 29, 2016

create-torrent: 3.22.0

var fs = require('fs');
var createTorrent = require('create-torrent');
var config = require('./config');
var path = require("path");


function create(folder, name, cb) {
    var opts = {
        name: name,                         // name of the torrent (default = basename of `path`)
        comment: 'no',                      // free-form textual comments of the author
        createdBy: 'SuperApp',              // name and version of program used to create torrent
        private: false,                     // is this a private .torrent? (default = false)
        announceList: config.announceList   // custom trackers (array of arrays of strings) (see [bep12](http://www.bittorrent.org/beps/bep_0012.html))
    };

    createTorrent(folder, opts, function (err, torrent) {
        if (err) {
            throw err;
        }

        var file_name = name + '.torrent';
        fs.writeFileSync(path.join(config.torrentDir, file_name), torrent);

        if (typeof cb === 'function') {
            cb(file_name);
        }
    });
}

module.exports = create;
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented May 4, 2016

Sorry -- it's just really hard to solve this issue without a minimal code example that can reliably reproduce it.

If you can produce a minimal test case that exhibits the issue, I'm happy to look at it in a new issue.

@lock

This comment has been minimized.

Copy link

@lock lock bot commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.