├── .gitignore ├── src ├── index.css └── index.html ├── package.json ├── multiple.sh ├── multiple.bat └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .parcel-cache 2 | dist 3 | -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: blue; 3 | } 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "parcel-segfault-repro", 3 | "version": "1.0.0", 4 | "license": "ISC", 5 | "dependencies": { 6 | "parcel": "2.6.2" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /multiple.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | rm -rf .parcel-cache 3 | for (( i=1; i<3; i++)) 4 | do 5 | rm -rf dist 6 | npx parcel build --no-cache --no-content-hash src/index.html & 7 | npx parcel build --no-cache --no-content-hash src/index.html & 8 | npx parcel build --no-cache --no-content-hash src/index.html & 9 | npx parcel build --no-cache --no-content-hash src/index.html || exit 1 10 | done -------------------------------------------------------------------------------- /multiple.bat: -------------------------------------------------------------------------------- 1 | start /B npx parcel build --no-cache --no-content-hash src/index.html 2 | start /B npx parcel build --no-cache --no-content-hash src/index.html 3 | start /B npx parcel build --no-cache --no-content-hash src/index.html 4 | start /B npx parcel build --no-cache --no-content-hash src/index.html 5 | start /B npx parcel build --no-cache --no-content-hash src/index.html 6 | start /B npx parcel build --no-cache --no-content-hash src/index.html 7 | start /B npx parcel build --no-cache --no-content-hash src/index.html 8 | start /B npx parcel build --no-cache --no-content-hash src/index.html 9 | start /B npx parcel build --no-cache --no-content-hash src/index.html 10 | npx parcel build --no-cache --no-content-hash src/index.html -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Segfault whenever the dist directory doesn't exist yet. If caching is enabled, 2 | it'll segfault on the first run and sporadically afterward. Caching is disabled 3 | here to make the case easily reproducible. 4 | 5 | ```bash 6 | rm -rf dist 7 | npx parcel build --no-cache --no-content-hash src/index.html 8 | ``` 9 | 10 | Workaround is to not use threaded workers: 11 | 12 | ```bash 13 | rm -rf dist 14 | PARCEL_WORKER_BACKEND=process npx parcel build --no-cache --no-content-hash src/index.html 15 | ``` 16 | 17 | Here is the output from segfault-handler: 18 | 19 | ``` 20 | PID 69840 received SIGSEGV for address: 0xb4f8 21 | 0 segfault-handler.node 0x00000001035725f8 _ZL16segfault_handleriP9__siginfoPv + 252 22 | 1 libsystem_platform.dylib 0x00000001a22144e4 _sigtramp + 56 23 | 2 node 0x000000010129c160 _ZN2v811HandleScopeC1EPNS_7IsolateE + 20 24 | 3 node 0x000000010129c160 _ZN2v811HandleScopeC1EPNS_7IsolateE + 20 25 | 4 node.abi102.glibc.node 0x0000000103d70018 _ZN3Nan11AsyncWorker12WorkCompleteEv + 36 26 | 5 node.abi102.glibc.node 0x0000000103d70388 _ZN3Nan20AsyncExecuteCompleteEP9uv_work_si + 32 27 | 6 libuv.1.dylib 0x000000010346b8c0 uv__work_done + 192 28 | 7 libuv.1.dylib 0x000000010346ec38 uv__async_io + 320 29 | 8 libuv.1.dylib 0x000000010347e458 uv__io_poll + 1592 30 | 9 libuv.1.dylib 0x000000010346f058 uv_run + 320 31 | 10 node 0x00000001011dd17c _ZN4node6worker16WorkerThreadDataD2Ev + 212 32 | 11 node 0x00000001011dc914 _ZN4node6worker6Worker3RunEv + 1316 33 | 12 node 0x00000001011dedd0 _ZZN4node6worker6Worker11StartThreadERKN2v820FunctionCallbackInfoINS2_5ValueEEEEN3$_38__invokeEPv + 56 34 | 13 libsystem_pthread.dylib 0x00000001a21fd240 _pthread_start + 148 35 | 14 libsystem_pthread.dylib 0x00000001a21f8024 thread_start + 8 36 | Segmentation fault: 11 37 | ``` 38 | 39 | System info: 40 | 41 | ``` 42 | $ sw_vers 43 | ProductName: macOS 44 | ProductVersion: 12.2.1 45 | BuildVersion: 21D62 46 | 47 | $ node --version 48 | v17.5.0 49 | 50 | $ npx parcel --version 51 | 2.3.1 52 | ``` 53 | --------------------------------------------------------------------------------