Repository navigation
Fatal Error (Abort) creating string larger than 268435440 bytes #1374
Description
Activity
this is ~256mb
@trevnorris @chrisdickinson and I are already working on this FWIW
If your file is just using ascii, you can work around this currently by specifying
'ascii'as encodingReacted by Jose- addedbufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.
on Apr 8, 2015 I feel like this has already been reported, but I can't find the issue..
here is a stacktrace i get on linux:
==== C stack trace =============================== 1: V8_Fatal 2: v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::String::NewStringType, int) 3: node::StringBytes::Encode(v8::Isolate*, char const*, unsigned long, node::encoding) 4: node::Buffer::Utf8Slice(v8::FunctionCallbackInfo<v8::Value> const&) 5: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) 6: ?? 7: ?? Illegal instruction (core dumped)- changed the title
[-]Fatal Error creating buffer larger than 268435440 bytes[/-][+]Fatal Error creating string larger than 268435440 bytes[/+]on Apr 8, 2015 updated the title, the issue is obviously the
.toString()@juliangruber ah. Is this related to #649?
- addedv8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.and removed
on Apr 8, 2015 @Fishrock123 yes, there is even a same issue reported deep in the comments.
It's not a v8 issue, while v8 does have a smallish limit for strings allocated in the js-heap (the 268mb or so), it is our fault for trying to allocate the string in js-heap in the first place.
This doesn't seem to be an issue with the new Buffer rewrite / removal of smalloc:
brendanashworth in ~ $ node -v v2.1.0 brendanashworth in ~ $ node test 1073741823 'kMaxLength' 268435440 'ok' FATAL ERROR: invalid array length Allocation failed - process out of memory Abort trap: 6
brendanashworth in ~ $ node -v v3.0.0 brendanashworth in ~ $ node test 268435440 'ok' 268435441 'ok'
Closing this for now, feel free to reopen if I'm wrong! :)
5 remaining items
@rvagg Adding this to the v4.0.0 milestone because it's a patch that prevents a possible segfault.
- added 2 commits that reference this issue
on Sep 3, 2015 I believe this should be reopened. Output under v4.1.1 is:
268435440 'ok' buffer.js:378 throw new Error('toString failed'); ^ Error: toString failed at Buffer.toString (buffer.js:378:11) at Object.<anonymous> (/Users/michael/github/rss/data/test.js:6:24) at Module._compile (module.js:434:26) at Object.Module._extensions..js (module.js:452:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Function.Module.runMain (module.js:475:10) at startup (node.js:117:18) at node.js:951:3
@mhart This issue is about node aborting on large strings. It no longer does, it throws a catchable exception.
OK, I was going by the expected output in the issue description.
- changed the title
[-]Fatal Error creating string larger than 268435440 bytes[/-][+]Fatal Error (Abort) creating string larger than 268435440 bytes[/+]on Oct 4, 2015 i am getting the same issue ,
buffer.js:378 throw new Error('toString failed');^ Error: toString failed at Buffer.toString (buffer.js:378:11)
Given this script:
The output should be:
But it actually is: