Ask questionsAssertion `(parser->current_buffer_len_) == (0)' failed
<!-- Thank you for reporting an issue.
This issue tracker is for bugs and issues found within Node.js core. If you require more general support please file an issue on our help repo. https://github.com/nodejs/help
Please fill in as much of the template below as you're able.
Version: output of node -v
Platform: output of uname -a (UNIX), or version and 32 or 64-bit (Windows)
Subsystem: if known, please specify affected core module name
If possible, please provide code that demonstrates the problem, keeping it as simple and free of external dependencies as you are able. -->
Hi,
I get the following crash from time to time (randomly, it seems):
/usr/local/bin/node[26969]: ../src/node_http_parser.cc:420:static void node::{anonymous}::Parser::Execute(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `(parser->current_buffer_len_) == (0)' failed.
Main process exited, code=killed, status=6/ABRT
1: node::Abort() [/usr/local/bin/node]
2: node::Assert(char const* const (*) [4]) [/usr/local/bin/node]
3: 0x14135d1 [/usr/local/bin/node]
4: 0xcc6de636c65
I'm not entirely sure where this comes from as there is no JS stack trace, but I believe it happens when processing the response of a HTTP request. This bug has been around for a long time, but it's very inconsistent. It might have already been reported here, at least it seems to be related.
Answer
questions
himanshu-singh1995
I got the following error in node v10.16.0 while uploading a 1GB file on S3 using putObject method provided by the aws-sdk. By the uploading a file size of 1GB to S3 using putObject of aws-sdk, I was able to reproduce this error every time.
Note: Upload string(not Buffer) to S3.
node[10695]: ../src/node_http_parser.cc:442:static void node::{anonymous}::Parser::Finish(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `parser->current_buffer_.IsEmpty()' failed.
1: 0x8f9d10 node::Abort() [node]
2: 0x8f9de5 [node]
3: 0x9638b2 [node]
4: 0xb8dfef [node]
5: 0xb8eb59 v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [node]
6: 0x154a4c55be1d
Aborted (core dumped)
Code to reproduce this error
const fs = require('fs');
const AWS = require('aws-sdk');
AWS.config.update(/* creds */);
let data = null
fs.readFile('filename','utf8', (err, _data) => data = _data) // this file should be >= 1GB
const params = {
ACL: 'public-read',
Body: data,
Bucket: '<bucket>',
Key: '<key>',
ContentType: 'text/plain',
};
const s3 = new AWS.S3({ apiVersion: '2006-03-01' });
s3.putObject(params).promise().then(console.log, console.log);
Related questions