Skip to content

Fatal Error (Abort) creating string larger than 268435440 bytes #1374

Closed
@juliangruber

Description

@juliangruber

Given this script:

var kMaxLength = process.binding('smalloc').kMaxLength;
console.log(kMaxLength, 'kMaxLength');

var len = 268435440;
var blob = new Buffer(len).toString('utf8');
console.log(len, 'ok');

len = 268435441;
blob = new Buffer(len).toString('utf8');
console.log(len, 'ok');

The output should be:

1073741823 'kMaxLength'
268435440 'ok'
268435441 'ok'

But it actually is:

1073741823 'kMaxLength'
268435440 'ok'


#
# Fatal error in ../deps/v8/src/handles.h, line 48
# CHECK(location_ != NULL) failed
#

==== C stack trace ===============================

 1: ??
 2: ??
 3: ??
 4: ??
 5: ??
 6: ??
 7: ??
 8: ??
 9: ??
Illegal instruction: 4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bufferIssues and PRs related to the buffer subsystem.v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions