Repository navigation
buffer.toString fails for buffers larger than 192MB #4266
Description
Activity
- addedbufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.
on Dec 14, 2015 Probably a dupe of #3175
Slightly more representative tests:
Buffer(268435440).toString('binary'); // ok Buffer(268435441).toString('binary'); // crashes in v0.12
Nominally a V8 bug due to the use of
.ToHandleChecked()indeps/v8/src/api.cc. We could work around it by checking thatlength < 268435441before callingv8::String::NewExternal()insrc/string_bytes.cc.I'm not going to work on it but if someone wants to pick it up, I'll review the patches.
- addedgood first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
on Dec 15, 2015 @bnoordhuis
I'll work on it.- added a commit that references this issue
on Dec 15, 2015 Is v4 also affected?
Yes. but it doesn't crash the process.
Unable to read a 40MB xlsx due to this.
mongod 3.0.6
Node 0.12.7@RohanGada Mind opening another issue with test case we can look at? Your issue will probably go unnoticed within an already closed issue.
EDIT: This isn't a closed issue yet. Don't know why I thought so.
Okay
Is this fixed ?
#4394 has yet to land.
- removedgood first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
on May 5, 2016 Curious to know if there's been any progress on this yet? I'm running v5.6.0 and still seeing this behavior.
Best I can figure this is a v8 bug. Unfortunately my v8 foo isn't good enough to track this down. /cc @indutny want to track down a v8 crash? :)
I had to bypass node and use bash with
jqto parse large base64 objects throughbash.This issue is a duplicate of #3175
@davidrapin It's not duplicate.
This is about an unhanded exception which breaks the process.Ok got it, just found out what the
v0.12tag meant ;)- added a commit that references this issue
on Nov 4, 2016 Closing this given that support for v0.12 is coming to a close in two days and there will not be any further updates to the v0.12 branch.
- added a commit that references this issue
on Nov 16, 2017
buffer.toString with
base64encoding fails for any buffer larger than or equal to201326581bytes (~192 MB).See the following piece of code:
For older node versions (like v0.12.2) this cause the process to crash with this error:
For newer versions (like v5.2.0), it gives the following error: