parcel: Segmentation fault (core dumped)

I have a consistant segfault on cold builds, it’s reproducible: https://github.com/GauBen/gauben.github.io/runs/2025608512

When the cache folder exists, there is no such problem: https://github.com/GauBen/gauben.github.io/runs/2025668435

How to reproduce

Versions: node v15.11.0, yarn v1.22.5, parcel v2.0.0-nightly.612

git clone git@github.com:GauBen/gauben.github.io.git
yarn
yarn build

Current workaround

git clone git@github.com:GauBen/gauben.github.io.git
yarn
yarn build || yarn build

(Only the first one segfaults)

Package.json: https://github.com/GauBen/gauben.github.io/blob/source/package.json

_Originally posted by @GauBen in https://github.com/parcel-bundler/parcel/issues/5773#issuecomment-790521457_

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 5
  • Comments: 40 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Btw, another workaround is to use PARCEL_WORKER_BACKEND=process which uses processes instead of threads for workers. I confirmed this works on Vercel.

The fix in #7001 appears to work on Vercel without any workaround. 🥳 It’s available in the latest nightly release. Hope it works for other setups as well.

Ubuntu 20.04.1 LTS

Thread 12 "node" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffdddb9700 (LWP 9066)]
0x00007fffc74d2cd0 in ?? ()
(gdb) bt
#0  0x00007fffc74d2cd0 in ?? ()
#1  0x00007ffff7c4d5a1 in __nptl_deallocate_tsd () at pthread_create.c:301
#2  0x00007ffff7c4e62a in __nptl_deallocate_tsd () at pthread_create.c:256
#3  start_thread (arg=<optimized out>) at pthread_create.c:488
#4  0x00007ffff7b75293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Doesn’t happen with PARCEL_WORKERS=0

Segmentation Fault happened here when i added image resizing:

<source srcset="url:./img/img.jpg?as=webp&width=634" type="image/webp" />

PARCEL_WORKERS=0 npm start solved it.

I’ve reduced this to a bug in Rust, combined with a bug in glibc. It is fixed in newer versions, but it is impossible to upgrade on CentOS 7 without upgrading the whole OS. I’m hoping the bug in Rust can be fixed to support older glibc versions. In the meantime, I am trying to find a workaround. See https://github.com/rust-lang/rust/issues/91979.

We upgraded sharp to the latest version in #6565. Should be released in the next nightly in about 18 hours. Perhaps that will help. Please report back if you test it.

I have not seen this issue again after I set PARCEL_WORKERS=0

Same issue here when building on Vercel