Repository navigation
Parcel 2.12.0 malloc(): corrupted top size in Node 22.7.0 #54573
Description
Activity
I found the function that triggers this error in Nodejs. It seems it was changed last week in a commit to update V8:
nodejs/node@
4f1c27a/deps/v8/src/ic/ic.cc#L251 (blame)This is where the error actually happens: nodejs/node@
4f1c27a/deps/v8/src/objects/feedback-vector.cc#L1125 (blame)Reported it upstream: nodejs/node#54573
Quote from @aminya in the other thread. CC @nodejs/v8
While we wait for them to respond, do you happen to have a reproduction without the use of dependencies like
parcel?If not, could you run the same code with the
NODE_DEBUG=*environment variable, and provide the output?- addedv8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.regressionIssues related to regressions.Issues related to regressions.v22.xIssues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.Issues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.
on Aug 26, 2024 No, I don't have a simpler reproduction. Parcel also uses Nodejs Add-on API, so @devongovett should be able to help add a reproduction with a debug build of Parcel
No worries!
A few things to help narrow this down:
NODE_DEBUG=*will enable debug logging in Node.js, could you try running the same command with that in your environment?- If parcel has a debug logging system, It'd really help to narrow down where this is coming from.
Here's the log with
NODE_DEBUG=*node ./node_modules/parcel/bin/parcel.jsLooks like Parcel's caching code triggers this.
@parcel+cache@2.0.0-canary.1719_@parcel+core@2.0.0-canary.1717_@swc+helpers@0.5.12_/node_modules/@parcel/cache/lib/FSCache.js]I get errors in
v8::internal::StringTable::OffHeapStringHashSet::KeyIsMatch. These occur in multiple different call stacks, e.g. innapi_set_named_property:* thread #13, stop reason = EXC_BAD_ACCESS (code=1, address=0xa5fa) * frame #0: 0x000000010077e3f4 node`bool v8::internal::StringTable::OffHeapStringHashSet::KeyIsMatch<v8::internal::Isolate, v8::internal::SequentialStringKey<unsigned char> >(v8::internal::Isolate*, v8::internal::SequentialStringKey<unsigned char>*, v8::internal::Tagged<v8::internal::Object>) + 32 frame #1: 0x000000010077b0ac node`v8::internal::Handle<v8::internal::String> v8::internal::StringTable::LookupKey<v8::internal::SequentialStringKey<unsigned char>, v8::internal::Isolate>(v8::internal::Isolate*, v8::internal::SequentialStringKey<unsigned char>*) + 128 frame #2: 0x000000010045f640 node`v8::internal::FactoryBase<v8::internal::Factory>::InternalizeString(v8::base::Vector<unsigned char const>, bool) + 176 frame #3: 0x000000010046fbdc node`v8::internal::Factory::InternalizeUtf8String(v8::base::Vector<char const>) + 76 frame #4: 0x00000001002dc950 node`v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int) + 128 frame #5: 0x0000000100094210 node`napi_set_named_property + 208 frame #6: 0x00000001194c5130 parcel-node-bindings.darwin-arm64.node`napi::js_values::_$LT$impl$u20$napi..js_values..object..JsObject$GT$::set_named_property::h5084994e2531749c + 88 frame #7: 0x00000001194d0e34 parcel-node-bindings.darwin-arm64.node`parcel_resolver::_::_$LT$impl$u20$serde..ser..Serialize$u20$for$u20$parcel_resolver..Resolution$GT$::serialize::h904a07a7bb6368f1 + 392 frame #8: 0x00000001194bccc4 parcel-node-bindings.darwin-arm64.node`parcel_node_bindings::resolver::Resolver::resolve_result_to_js::h68ad0611506b3f03 + 488 frame #9: 0x00000001194cb620 parcel-node-bindings.darwin-arm64.node`parcel_node_bindings::resolver::__napi_impl_helper__Resolver__1::__napi__resolve::h830643ec2ac2f150 + 648Or in the
v8.deserializeAPI:* frame #0: 0x000000010077e308 node`bool v8::internal::StringTable::OffHeapStringHashSet::KeyIsMatch<v8::internal::Isolate, v8::internal::InternalizedStringKey>(v8::internal::Isolate*, v8::internal::InternalizedStringKey*, v8::internal::Tagged<v8::internal::Object>) + 28 frame #1: 0x000000010077d2f4 node`v8::internal::Handle<v8::internal::String> v8::internal::StringTable::LookupKey<v8::internal::InternalizedStringKey, v8::internal::Isolate>(v8::internal::Isolate*, v8::internal::InternalizedStringKey*) + 132 frame #2: 0x000000010077d0e8 node`v8::internal::StringTable::LookupString(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>) + 324 frame #3: 0x000000010079c148 node`v8::internal::ValueDeserializer::ReadJSObjectProperties(v8::internal::Handle<v8::internal::JSObject>, v8::internal::SerializationTag, bool) + 604 frame #4: 0x000000010079894c node`v8::internal::ValueDeserializer::ReadJSObject() + 268 frame #5: 0x0000000100797674 node`v8::internal::ValueDeserializer::ReadObjectInternal() + 820 frame #6: 0x000000010079725c node`v8::internal::ValueDeserializer::ReadObject() + 64 frame #7: 0x000000010079c440 node`v8::internal::ValueDeserializer::ReadJSObjectProperties(v8::internal::Handle<v8::internal::JSObject>, v8::internal::SerializationTag, bool) + 1364 frame #8: 0x000000010079894c node`v8::internal::ValueDeserializer::ReadJSObject() + 268 frame #9: 0x0000000100797674 node`v8::internal::ValueDeserializer::ReadObjectInternal() + 820 frame #10: 0x000000010079725c node`v8::internal::ValueDeserializer::ReadObject() + 64 frame #11: 0x000000010079c1f8 node`v8::internal::ValueDeserializer::ReadJSObjectProperties(v8::internal::Handle<v8::internal::JSObject>, v8::internal::SerializationTag, bool) + 780 frame #12: 0x000000010079894c node`v8::internal::ValueDeserializer::ReadJSObject() + 268 frame #13: 0x0000000100797674 node`v8::internal::ValueDeserializer::ReadObjectInternal() + 820 frame #14: 0x000000010079725c node`v8::internal::ValueDeserializer::ReadObject() + 64 frame #15: 0x000000010079c440 node`v8::internal::ValueDeserializer::ReadJSObjectProperties(v8::internal::Handle<v8::internal::JSObject>, v8::internal::SerializationTag, bool) + 1364 frame #16: 0x000000010079894c node`v8::internal::ValueDeserializer::ReadJSObject() + 268 frame #17: 0x0000000100797674 node`v8::internal::ValueDeserializer::ReadObjectInternal() + 820 frame #18: 0x000000010079725c node`v8::internal::ValueDeserializer::ReadObject() + 64 frame #19: 0x000000010079718c node`v8::internal::ValueDeserializer::ReadObjectWrapper() + 32 frame #20: 0x00000001002cc358 node`v8::ValueDeserializer::ReadValue(v8::Local<v8::Context>) + 268 frame #21: 0x0000000100172e70 node`node::serdes::DeserializerContext::ReadValue(v8::FunctionCallbackInfo<v8::Value> const&) + 100 frame #22: 0x0000000100d4f118 node`Builtins_CallApiCallbackGeneric + 184Or just in the parser:
* frame #0: 0x000000010077caf8 node`v8::internal::OffHeapHashTableBase<v8::internal::StringTable::OffHeapStringHashSet>::RehashInto(v8::internal::PtrComprCageBase, v8::internal::StringTable::OffHeapStringHashSet*) + 124 frame #1: 0x000000010077b340 node`v8::internal::StringTable::EnsureCapacity(v8::internal::PtrComprCageBase, int) + 268 frame #2: 0x000000010077b104 node`v8::internal::Handle<v8::internal::String> v8::internal::StringTable::LookupKey<v8::internal::SequentialStringKey<unsigned char>, v8::internal::Isolate>(v8::internal::Isolate*, v8::internal::SequentialStringKey<unsigned char>*) + 216 frame #3: 0x00000001002f07fc node`void v8::internal::AstValueFactory::Internalize<v8::internal::Isolate>(v8::internal::Isolate*) + 152 frame #4: 0x00000001007a468c node`v8::internal::Parser::ParseFunction(v8::internal::Isolate*, v8::internal::ParseInfo*, v8::internal::Handle<v8::internal::SharedFunctionInfo>) + 1688 frame #5: 0x00000001007c51c0 node`v8::internal::parsing::ParseFunction(v8::internal::ParseInfo*, v8::internal::Handle<v8::internal::SharedFunctionInfo>, v8::internal::Isolate*, v8::internal::parsing::ReportStatisticsMode) + 276 frame #6: 0x000000010035c14c node`v8::internal::Compiler::Compile(v8::internal::Isolate*, v8::internal::Handle<v8::internal::SharedFunctionInfo>, v8::internal::Compiler::ClearExceptionFlag, v8::internal::IsCompiledScope*, v8::internal::CreateSourcePositions) + 828 frame #7: 0x000000010035ca88 node`v8::internal::Compiler::Compile(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Compiler::ClearExceptionFlag, v8::internal::IsCompiledScope*) + 236 frame #8: 0x000000010085b230 node`v8::internal::Runtime_CompileLazy(int, unsigned long*, v8::internal::Isolate*) + 136Could this be a v8 bug? The stack traces above make me think it isn't specific Parcel's native addons.
- addednode-apiIssues and PRs related to Node-API.Issues and PRs related to Node-API.
on Aug 31, 2024 CC @nodejs/v8 @nodejs/node-api
It appears that worker_threads may also be involved here. I cannot reproduce when I disable multi-threading in Parcel. Haven't managed to produce a smaller reproduction yet unfortunately...
Reacted by Aviv Keller👋 Hey, v22.8.0 was just released, is this reproducible in that version?
I have same error while building project made with
npx create-instantsearch-app$ npm start > ui@1.0.0 start > parcel index.html --port 3000 (node:57375) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. (Use `node --trace-deprecation ...` to show where the warning was created) Server running at http://localhost:3000 ⠸ Building favicon.png... malloc(): invalid size (unsorted) Aborted (core dumped)It still works at 22.6
29 remaining items
You seem to have much more experience in this domain, take it from here :)
- removednode-apiIssues and PRs related to Node-API.Issues and PRs related to Node-API.
on Oct 4, 2024 - added a commit that references this issue
on Oct 7, 2024
Version
22.7.0
Platform
Subsystem
No response
What steps will reproduce the bug?
Mirror of parcel-bundler/parcel#9926
More information available in parcel-bundler/parcel#9926
🐛 bug report
In Node 22.7.0 (not older versions), parcel now fails with this error
I get more info here:
https://github.com/aminya/assemblyscript-template/actions/runs/10531888327/job/29184908856#step:7:51
gdb stacktrace
🎛 Configuration (.babelrc, package.json, cli command)
https://github.com/aminya/assemblyscript-template/tree/453edd38314835246c692319b6ae53c430a8010f
💻 Code Sample
https://github.com/aminya/assemblyscript-template/tree/453edd38314835246c692319b6ae53c430a8010f
🌍 Your Environment
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
There should not be a difference between Node 22.6.0 and 22.7.0
What do you see instead?
Segfault in 22.7.0
Additional information
No response