max-mapper / max-mapper/torrent

Error: not part of int at:6

Open
#44 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
630
Forks
78
PR merge metrics
No merged PRs in 30d

Description

Very often, in the middle of a torrent download, I get:

/Users/nathanh/.npm-packages/lib/node_modules/torrent/node_modules/bncode/bncode.js:222
            throw new Error('not part of int at:'+pos.toString(16))
                  ^
Error: not part of int at:6
    at BdecodeSMachine.parse (/Users/nathanh/.npm-packages/lib/node_modules/torrent/node_modules/bncode/bncode.js:222:19)
    at Bdecode.decode (/Users/nathanh/.npm-packages/lib/node_modules/torrent/node_modules/bncode/bncode.js:322:14)
    at Object.decode (/Users/nathanh/.npm-packages/lib/node_modules/torrent/node_modules/bncode/bncode.js:444:11)
    at null.<anonymous> (/Users/nathanh/.npm-packages/lib/node_modules/torrent/node_modules/torrent-stream/lib/exchange-metadata.js:22:23)
    at g (events.js:199:16)
    at emit (events.js:110:17)
    at Wire._onextended (/Users/nathanh/.npm-packages/lib/node_modules/torrent/node_modules/peer-wire-protocol/index.js:306:7)
    at onmessage (/Users/nathanh/.npm-packages/lib/node_modules/torrent/node_modules/peer-wire-protocol/index.js:112:16)
    at Wire._write (/Users/nathanh/.npm-packages/lib/node_modules/torrent/node_modules/peer-wire-protocol/index.js:355:8)
    at doWrite (_stream_writable.js:301:12)
    at writeOrBuffer (_stream_writable.js:288:5)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with bncode.js:222 and trace the decode call from torrent-stream/lib/exchange-metadata.js:22 through peer-wire-protocol. Reproduce the error during a torrent download, then verify the behavior for the metadata input that triggers the parser failure and add or update a regression test if the repository provides one.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.