parcel: Segmentation Fault building with nightlies 56x

๐Ÿ› bug report

When building our project using the latest nightlies (Tried 562 - 566), the build fails on segmentation fault 11.

๐ŸŽ› Configuration (.babelrc, package.json, cli command)

parcel build src/index.html --dist-dir ./dist --public-url=$$PUBLIC_PATH --cache-dir ./.parcel-cache --detailed-report

๐Ÿค” Expected Behavior

The build should complete successfully.

๐Ÿ˜ฏ Current Behavior

The build fails with a segmentation fault as follows:

PID 29707 received SIGSEGV for address: 0x10
0   segfault-handler.node               0x0000000104de1fe0 _ZL16segfault_handleriP9__siginfoPv + 304
1   libsystem_platform.dylib            0x00007fff7289a5fd _sigtramp + 29
2   ???                                 0x0000000000000013 0x0 + 19
3   node.napi.glibc.node                0x0000000106f5adac _ZN16SourceMapBinding18findClosestMappingERKN4Napi12CallbackInfoE + 404
4   node.napi.glibc.node                0x0000000106f5cfa4 _ZN4Napi12InstanceWrapI16SourceMapBindingE29InstanceMethodCallbackWrapperEP10napi_env__P20napi_callback_info__ + 176
5   node.napi.glibc.node                0x0000000106f5cf1a _ZN4Napi12InstanceWrapI16SourceMapBindingE29InstanceMethodCallbackWrapperEP10napi_env__P20napi_callback_info__ + 38
6   node                                0x000000010007b82a _ZN6v8impl12_GLOBAL__N_123FunctionCallbackWrapper6InvokeERKN2v820FunctionCallbackInfoINS2_5ValueEEE + 122
7   node                                0x00000001002a2718 _ZN2v88internal25FunctionCallbackArguments4CallENS0_15CallHandlerInfoE + 616
8   node                                0x00000001002a1cac _ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEESA_NS8_INS0_20FunctionTemplateInfoEEENS8_IS4_EENS0_16BuiltinArgumentsE + 524
9   node                                0x00000001002a13b7 _ZN2v88internalL26Builtin_Impl_HandleApiCallENS0_16BuiltinArgumentsEPNS0_7IsolateE + 263
10  node                                0x0000000100ac53b9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 57
11  node                                0x0000000100a5e522 Builtins_InterpreterEntryTrampoline + 194
make: *** [dist] Segmentation fault: 11

๐Ÿ’ Possible Solution

Not sure, but perhaps this is the code responsible? https://github.com/parcel-bundler/source-map/blob/2fba112dc6b29095aea1af052469d33ec6601c78/src/wasm/SourceMap.cpp#L140

๐Ÿ”ฆ Context

We have a large mono repo with about 12 sub packages. We use lerna and babel. Some packages are Typescript, some are Javascript.

๐Ÿ’ป Code Sample

๐ŸŒ Your Environment

Software Version(s)
Parcel ^2.0.0-nightly.566
Node 14.15.4 / 15.2.1
Yarn 1.22.10
Operating System Centos 7.5 / Mac OS Catalina

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 31 (30 by maintainers)

Most upvoted comments

Thanks for the fix @DeMoorJasper !

@ittaibaratz Iโ€™m gonna close this issue as thereโ€™s already an issue for the minification/babel issue you encountered and the original seems to be resolved. Maybe continue the conversation there

About the error not showing the file, it should, Iโ€™ll create a PR in a bit to add this.

Regarding the โ€œunreachable codeโ€ one: https://github.com/nodejs/node/issues/34506

@danieltroger looks very similar indeed. Is there a way for me to find out what code is being minified so I can try to workaround this? Lines 13997-14000 above donโ€™t reveal much.

Sounds good @DeMoorJasper - Will test it once the next nightly comes out.