gatsby: Node buffer allocation crash

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

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22 (18 by maintainers)

Most upvoted comments

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