question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Node buffer allocation crash

See original GitHub issue

Description

Recently a node buffer crash has started occurring, this did not start after a specific Gatsby update, and changing the Gatsby version does not appear to fix it.

This appears to be similar to some previous issues, however those were fixed by lowering the buffer size of the cache when passed to v8.serialize

success run queries - 312.371s - 14100/14100 45.14/s
/Users/madelinemiller/.npm/bin/node[65919]: ../src/node_buffer.cc:455:MaybeLocal<v8::Object> node::Buffer::New(node::Environment *, char *, size_t, bool): Assertion `length <= kMaxLength' failed.
 1: 0x1010285f9 node::Abort() (.cold.1) [/Users/madelinemiller/.npm/bin/node]
 2: 0x10008634d node::FatalError(char const*, char const*) [/Users/madelinemiller/.npm/bin/node]
 3: 0x1000861e2 node::AppendExceptionLine(node::Environment*, v8::Local<v8::Value>, v8::Local<v8::Message>, node::ErrorHandlingMode) [/Users/madelinemiller/.npm/bin/node]
 4: 0x100068aed node::Buffer::New(node::Environment*, char*, unsigned long, bool) [/Users/madelinemiller/.npm/bin/node]
 5: 0x1000e0cb8 node::(anonymous namespace)::SerializerContext::ReleaseBuffer(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/madelinemiller/.npm/bin/node]
 6: 0x1009031ed Builtins_CallApiCallback [/Users/madelinemiller/.npm/bin/node]
 7: 0x10207d868c71 
error Command failed with signal "SIGABRT".

Related issues:

https://github.com/gatsbyjs/gatsby/issues/17233 https://github.com/gatsbyjs/gatsby/pull/21555

It’s worth noting that unlike the prior issue that has 100k+ pages, we only have 14k

Steps to reproduce

Still working on this

Expected result

No node crash

Actual result

Node crashes after queries are run

Environment

System: OS: macOS 10.15.4 CPU: (12) x64 Intel® Core™ i9-8950HK CPU @ 2.90GHz Shell: 3.2.57 - /bin/bash Binaries: Node: 12.16.3 - ~/.npm/bin/node Yarn: 1.22.0 - ~/.npm/bin/yarn npm: 6.14.4 - ~/.npm/bin/npm Languages: Python: 2.7.17 - /usr/local/bin/python Browsers: Firefox: 70.0.1 Safari: 13.1

Gatsby version is 2.21.5

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:22 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
me4502commented, Apr 30, 2020

Yeah I got that it was a joke 😂 It just may not be too far from the truth as some pages do have a lot of GIFs etc

Thanks, yeah - I hadn’t had a chance to actually write it yet but my plan was to do something super similar.

I’ll use patch-package to apply that change until it’s merged. Thanks

0reactions
pvdzcommented, Dec 3, 2020

For one, we’re currently on 2.28.0 and for two, yes it still exists.

Please explain your use case. Do you have a super large sites? >100k pages with lots of content? How do you think the content is triggering this problem?

Read more comments on GitHub >

github_iconTop Results From Across the Web

react development server keeps crashing - node.js
I have uninstalled and re-installed my node js(based on a proposed solution i saw online), but am still getting the error. node.js ·...
Read more >
Porting to the Buffer.from() / Buffer.alloc() API
This guide explains how to migrate to safe Buffer constructor methods. The migration fixes the ... Errors in handling buffers allocated with Buffer....
Read more >
Node crashes periodically
Jan 6 09:34:45 PM FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Read more >
How to Fix JavaScript Heap Out of Memory Error
This error usually occurs when the default memory allocated by your system to Node.js is not enough to run a large project.
Read more >
Using Buffers to share data between Node.js and C++
Note the use of NAN's NewBuffer function, which wraps the dynamically allocated retval array in a Node buffer. Doing so transfers ownership of ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found