Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault using wildcard in ignore option on Node.js v20.12.x (LTS) #170

Closed
rogerweb opened this issue Apr 8, 2024 · 14 comments
Closed
Assignees

Comments

@rogerweb
Copy link

rogerweb commented Apr 8, 2024

Using * in the ignore option is causing a Segmentation fault when running on Node.js v20.12.x onwards.

const watcher = require("@parcel/watcher")

watcher.subscribe(
    process.cwd(),
    (err, events) => {
        console.log(events)
    },
    { ignore: ["*.bkp"] }
)

It works on Node.js v20.11.1 but not in v20.12.1.

If you negate the expression using ! like in

{ ignore: ["!*.txt"] }

then you get another error:

free(): invalid pointer
Aborted

These apply to @parcel/watcher version 2.4.1 on Linux 5.10.0-28-amd64 #1 SMP Debian 5.10.209-2 (2024-01-31) x86_64 GNU/Linux.

@sakurai-youhei
Copy link

sakurai-youhei commented Apr 10, 2024

I seem to hit the same issue.

I work around it by replacing node_modules/@parcel/watcher-linux-x64-glibc/watcher.node (2.4.1) with locally built prebuilds/linux-x64/node.napi.glibc.node from the master branch (2.4.1) like this.

$ git clone https://github.com/parcel-bundler/watcher.git .
$ npm install prebuildify node-gyp-build
$ yarn prebuild
$ ls -l prebuilds/linux-x64/node.napi.glibc.node

My env:

$ uname -a
Linux ecf49bcced4d 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 GNU/Linux
$ cat /etc/debian_version
12.5

vvv ADDED vvv

  • node --version is v20.12.1 and ldd --version is ldd (Debian GLIBC 2.36-9+deb12u4) 2.36 in my environment.
  • Running yarn rebuild in node_modules/@parcel/watcher with @parcel/watcher@2.1.0 also seems to work around the issue. This finding is based on information from one of my colleagues.

@azasypkin
Copy link

azasypkin commented Apr 10, 2024

I and quite a few of my colleagues are experiencing these segfaults as well. We had to resort to a workaround from #170 (comment)

@parcel/watcher version 2.4.1
---
$ uname -a
Linux azarch 6.8.4-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 05 Apr 2024 00:14:23 +0000 x86_64 GNU/Linux

$ ldd --version
ldd (GNU libc) 2.39

$ node --version
v20.12.1

@jas7457
Copy link

jas7457 commented Apr 17, 2024

I'm hitting this issue as well, and it is blocking our ability to upgrade our node version to fix the Node CVE that was reported. It would be great if there was a fix made for this issue.

@jas7457
Copy link

jas7457 commented Apr 25, 2024

Hey @yamadapc any update on this? Unfortunately this issue makes it so we can't update our node version due to our graphql-codegen (which uses parcel watcher) breaking.

@jas7457
Copy link

jas7457 commented May 7, 2024

@yamadapc , this should be reproducible on this codesandbox. Thanks for the minimal way to reproduce it, @rogerweb.

@Ikuni17
Copy link

Ikuni17 commented May 14, 2024

Upgrading Node from 20.12.2 to 20.13.1 fixed this for me.

@benmccann
Copy link

Upgrading Node from 20.12.2 to 20.13.1 fixed this for me.

It potentially could be nodejs/node#52349 included in 20.13.0

@lbxa
Copy link

lbxa commented Jun 10, 2024

Upgrading to 20.13 also worked for me. Issues like this remind why its important to keep node on the most active devel version.

@devongovett
Copy link
Member

If anyone is still seeing this, please test @parcel/watcher v2.4.2-alpha.0, which includes #177 to fix some use after free issues and see if it helps.

@IlCallo
Copy link

IlCallo commented Aug 10, 2024

Upgrading Node to latest (20.16 in my case) fixed the issue

@mtsmfm
Copy link

mtsmfm commented Aug 26, 2024

I have the same symptom with Node 22.

Here's the example repo to reproduce.

https://github.com/mtsmfm/parcel-watcher-segv

Shall I file another issue?

@mtsmfm
Copy link

mtsmfm commented Aug 26, 2024

It happens with v2.4.2-alpha.0 as well

@Amplifiyer
Copy link

running into the same issue with latest node22. @mtsmfm can you create a new issue with your example repo?

@mtsmfm
Copy link

mtsmfm commented Aug 26, 2024

Created #184

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests