Error decoding object with large buffer
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 43/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, node.js
調査の方向性
The report reproduces the failure with cbor.encode and cbor.decode on an object containing a large buffer, and includes a stack trace pointing to lib/decoder.js. Start by checking the decoder path around decodeFirstSync and reproduce with the supplied snippet, varying buffer size and property order. Done means the encoded object decodes correctly across the reported cases, with a regression test covering the size and ordering behavior.
索引モデルが issue の本文から書いたものです。
説明
The following snippet fails with error at decode:
let buffer = fs.readFileSync('some_large_file');
buffer = buffer.slice(0, 16377);
let object = {
a: buffer,
b: 1
};
let encoded = cbor.encode(object);
let decoded = cbor.decode(encoded);
Error: Insufficient data
at Object.decodeFirstSync (/*****/node_modules/cbor/lib/decoder.js:131:15)
at /******/index.js:24:24
at Object.<anonymous> (/*****/index.js:181:1)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:456:32)
at tryModuleLoad (module.js:415:12)
at Function.Module._load (module.js:407:3)
at Function.Module.runMain (module.js:575:10)
at startup (node.js:159:18)
The size of buffer for which the error occurs depends on the name of the object properties a and b. That is, if the names are longer then shorter buffers produce the error.
With property names a and b, the error does not occur if I reduce the size of buffer to 16376 bytes, like:
buffer = buffer.slice(0, 16376);
The error does not occur if I switch the order of a and b in object, like:
let object = {
b: 1,
a: buffer
};
Reproduced with 2.0.0 and 3.0.0
- 主要言語
- JavaScript
- スター
- 379
- フォーク
- 73
- 平均マージ
- 7分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
hildjj/node-cbor のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 36/100
hildjj/node-cbor の issue をすべて見る
似ている issue
-
Out of order / duplicate key error shows the key bytes as decimal or UTF-8, not hex対応中かも @bardrop が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
メンテナーはふだん 3 日以内に返信
-
`remix-hook-form/middleware` imports `unstable_createContext`, breaking on `react-router` >= 7.9.0オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
code-forge-io/remix-hook-form#189 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100