Node: Updating to node 12.19.0 from 12.18.4 crashes my application

Created on 9 Oct 2020  Â·  9Comments  Â·  Source: nodejs/node

  • 12.19.0:
  • Darwin Brandons-MacBook-Pro.local 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64:

What steps will reproduce the bug?

I am not entirely sure what is using 12.19.0 but after updating from 12.18.4 my app crashes with the following error in node:

/Users/brandonroberts/.nvm/versions/node/v12.19.0/bin/node[46808]: ../src/node_http_parser_impl.h:529:static void node::(anonymous namespace)::Parser::Initialize(const FunctionCallbackInfo<v8::Value> &): Assertion `args[3]->IsInt32()' failed.
 1: 0x1011f40c5 node::Abort() (.cold.1) [/Users/brandonroberts/.nvm/versions/node/v12.19.0/bin/node]
 2: 0x1000a5749 node::Abort() [/Users/brandonroberts/.nvm/versions/node/v12.19.0/bin/node]
 3: 0x1000a55b1 node::Assert(node::AssertionInfo const&) [/Users/brandonroberts/.nvm/versions/node/v12.19.0/bin/node]
 4: 0x1000c6e1b node::(anonymous namespace)::Parser::Initialize(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/brandonroberts/.nvm/versions/node/v12.19.0/bin/node]
 5: 0x100259838 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/Users/brandonroberts/.nvm/versions/node/v12.19.0/bin/node]
 6: 0x100258df9 v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/Users/brandonroberts/.nvm/versions/node/v12.19.0/bin/node]
 7: 0x100258562 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/Users/brandonroberts/.nvm/versions/node/v12.19.0/bin/node]
 8: 0x100a02b19 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit [/Users/brandonroberts/.nvm/versions/node/v12.19.0/bin/node]

How often does it reproduce? Is there a required condition?

This happens any time my app is started and a request is made.

Additional information

I tried to search for what is using the node_http_parser_impl in my application but there seems to be a good amount of possibilities (like express, fs-events, etc...). I am opening this because I think it is node related. Keeping my same node_modules and only switching from 12.18.4 to 12.19.0 causes the breakage.

http wrong repo

Most helpful comment

@MylesBorins maybe we should add undici to CITGM?

All 9 comments

I suspect you are using unidici somewhere in your dependencies. This was fixed in https://github.com/nodejs/undici/pull/449 and released in 2.0.7.

@MylesBorins maybe we should add undici to CITGM?

https://github.com/nodejs/undici/blob/master/lib/node/http-parser.js#L3-L4 — caused by using the internal API directly.
Usage of that API should be fixed in [email protected]: https://github.com/nodejs/undici/issues/448#issuecomment-706070229

@special-character could you confirm that updating/resolving undici to 2.0.7 helps?

I think we can close this. Please let us know if there are any further questions.

Using 2.0.7 fixes the issue, thanks for the info!

I think I may have been incorrect about undici 2.0.7 fixing this issue. I am running into this again with:

node v12.19.0
undici v2.0.7

It is possible I though it was "working" because I use nvm and it switched to the default version I had set which worked fine.

CleanShot 2020-10-20 at 11 40 43

@special-character There may be other modules in the wild using the internal HTTPParser API which changed.
You could search for binding('http_parser') or binding("http_parser") in your node_modules folder to find who is actually loading it.

I think I may have been incorrect about undici 2.0.7 fixing this issue. I am running into this again with:

@special-character Do you have a repro?

I don't have a repro yet but can look into making a minimal one.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

filipesilvaa picture filipesilvaa  Â·  3Comments

akdor1154 picture akdor1154  Â·  3Comments

jmichae3 picture jmichae3  Â·  3Comments

srl295 picture srl295  Â·  3Comments

willnwhite picture willnwhite  Â·  3Comments