-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
buffer.toString fails for buffers larger than 192MB #4266
Comments
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 I'm not going to work on it but if someone wants to pick it up, I'll review the patches. |
@bnoordhuis |
workaround for possible V8 bug (due to the use of .ToHandleChecked() in deps/v8/src/api.cc) @bnoordhuis please review
Is v4 also affected? |
Yes. but it doesn't crash the process. |
Unable to read a 40MB xlsx due to this. |
@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. |
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 |
This issue is a duplicate of #3175 |
@davidrapin It's not duplicate. |
Ok got it, just found out what the |
* Workaround for Buffer.toString failure caused by exceeding the maximum supported length in V8. * See issue nodejs/node#4266 and PR nodejs/node#4394 Fixes #22
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. |
* Workaround for Buffer.toString failure caused by exceeding the maximum supported length in V8. * See issue nodejs/node#4266 and PR nodejs/node#4394 Fixes #22
buffer.toString with
base64
encoding fails for any buffer larger than or equal to201326581
bytes (~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:
The text was updated successfully, but these errors were encountered: