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

Parcel Build Crashes Due To Segmentation Faults #7598

Closed
an0nusr opened this issue Jan 23, 2022 · 11 comments
Closed

Parcel Build Crashes Due To Segmentation Faults #7598

an0nusr opened this issue Jan 23, 2022 · 11 comments

Comments

@an0nusr
Copy link

an0nusr commented Jan 23, 2022

🐛 bug report

When running Parcel 2.2.1, the build fails with one of several error messages:

  • free(): invalid pointer
  • Segmentation fault
  • free(): double free detected in tcache 2

All of these errors occurred running the exact same command (parcel build) one after the other with no changes to the code.

🎛 Configuration (.babelrc, package.json, cli command)

Package.json:

{
  "name": "furryfont",
  "version": "1.0.0",
  "source": "index.html",
  "browserslist": "> 0.5%, last 2 versions, not dead",
  "author": "anonusr",
  "license": "AGPL-3.0-only",
  "scripts": {
    "start": "parcel",
    "build": "parcel build",
    "deploy": "echo 'furryfont.anonusr.org' > ./dist/CNAME && gh-pages -d dist"
  },
  "devDependencies": {
    "gh-pages": "^3.2.3",
    "parcel": "^2.2.0"
  }
}

🤔 Expected Behavior

Parcel does not crash.

😯 Current Behavior

Parcel crashes. Here is one of the possible errors:

yarn run v1.22.5
$ parcel build --log-level verbose
✨ Built in 1.27s

dist/index.html    5.13 KB    783ms
free(): double free detected in tcache 2
Aborted

💻 Code Sample

The issue is happening for me with this code here: an0nusr/furryfont@7e279a6

The code is pretty simple - there's no modules to bundle - just simple inline js in HTML.

Note: the yarn lockfile in that commit was using Parcel 2.2.0 - the issue occurs in 2.2.1

🌍 Your Environment

Software Version(s)
Parcel 2.2.1
Node v12.22.7
npm/Yarn yarn 1.22.5
Operating System Ubuntu 18.04
@provegard
Copy link

Related: #7590

@mischnic
Copy link
Member

What version of lmdb is installed in your project? If you have 2.1.6 installed, try rolling back to 2.1.5 (e.g. via yarn resolutions)

@jdanyow
Copy link
Contributor

jdanyow commented Jan 24, 2022

@mischnic we've tried with lmdb 2.1.6 and 2.1.5.

Linking some dupes: #7590 #7603

@an0nusr
Copy link
Author

an0nusr commented Jan 25, 2022

@mischnic - manually setting the lmdb version to 2.1.5 does not appear to have an effect, I still see a free(): invalid pointer error when running parcel build.

@jdanyow
Copy link
Contributor

jdanyow commented Jan 25, 2022

Confirming both git bash and powershell, on the following windows versions:

Win 10: 2022-01 Cumulative Update for Windows 10 Version 21H2 for x64-based Systems (KB5010793)
Win 11 - 22000.434

@devongovett
Copy link
Member

Does it work for anyone if you set the PARCEL_WORKER_BACKEND=process environment variable?

@devongovett
Copy link
Member

devongovett commented Jan 27, 2022

I think we narrowed this down to an upgrade of napi-rs in the @parcel/source-map package, which was released sometime after Parcel 2.2.1. I still don't know the exact root cause, but for now I've reverted this upgrade and published @parcel/source-map v2.0.2. See parcel-bundler/source-map#91.

You'll need to remove @parcel/source-map 2.0.1 from your lock file and re-install to get the upgrade. Please comment whether this works for you. Apologies again for the issue, and thanks for your patience while we track it down.

@dailypixie
Copy link

dailypixie commented Jan 27, 2022

I works on my side with 2.1.1. Purging and updating to 2.2.1.
It works with 2.2.1.
I noticed a minor issue, pressing CTRL+C does not automatically close the process, you have to press multiple times.

@jg185366
Copy link

You'll need to remove @parcel/source-map 2.0.1 from your lock file and re-install to get the upgrade.

This worked for me. Thanks!

@maxackerman
Copy link

maxackerman commented Feb 11, 2022

Using the latest Parcel v2.3.1 I'm running into segmentation fault errors on my local machine and when deploying to Netlify.

Here is a stripped down example that has been consistently causing errors: https://github.com/maxackerman/deploy-test

node: v17.0.1

I just tried PARCEL_WORKER_BACKEND=process and that does seem to work as a temp fix!

@LeoniePhiline
Copy link

LeoniePhiline commented Aug 26, 2024

This is again the case with NodeJS 22.7.

The breakage occurs when upgrading https://hub.docker.com/r/amd64/node from 22.6.0-alpine to 22.7.0-alpine

Edit: I see, that's #9926

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

9 participants