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

Workaround segfault with old glibc versions #7457

Merged
merged 1 commit into from
Dec 16, 2021
Merged

Conversation

devongovett
Copy link
Member

@devongovett devongovett commented Dec 16, 2021

Fixes #7408. #5961

This is a workaround for rust-lang/rust#91979. This manifests as a segmentation fault that occurs on CentOS 7 systems when Parcel exits (after a successful build). It occurs due to the thread local variables used by SWC.

We can workaround this by preventing the library from being unloaded until process exit rather than when worker threads exit. This is done by also loading SWC on the main thread in addition to workers. For performance reasons, this is only done on linux when the glibc version is <= 2.17. In glibc 2.18+, this crash does not occur because unloading dynamic libraries is already deferred until process exit if there are TLS destructors registered.

@height
Copy link

height bot commented Dec 16, 2021

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@parcel-benchmark
Copy link

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 1.71s -107.00ms 🚀
Cached 347.00ms +36.00ms ⚠️

Cold Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 470.00ms -41.00ms 🚀
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 471.00ms -41.00ms 🚀
dist/modern/parcel.7cdb0fad.webp 102.94kb +0.00b 470.00ms -42.00ms 🚀
dist/legacy/index.0a5c751e.js 1.59kb +0.00b 718.00ms -45.00ms 🚀
dist/legacy/index.8aaa89c9.js 1.20kb +0.00b 718.00ms -46.00ms 🚀
dist/modern/index.6be20f01.js 1.13kb +0.00b 717.00ms -46.00ms 🚀
dist/legacy/index.html 826.00b +0.00b 829.00ms -49.00ms 🚀
dist/modern/index.html 749.00b +0.00b 830.00ms -48.00ms 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 477.00ms -70.00ms 🚀
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 477.00ms -71.00ms 🚀
dist/modern/parcel.7cdb0fad.webp 102.94kb +0.00b 477.00ms -70.00ms 🚀
dist/legacy/index.0a5c751e.js 1.59kb +0.00b 736.00ms -72.00ms 🚀
dist/legacy/index.8aaa89c9.js 1.20kb +0.00b 737.00ms -71.00ms 🚀
dist/modern/index.6be20f01.js 1.13kb +0.00b 736.00ms -72.00ms 🚀
dist/legacy/index.html 826.00b +0.00b 863.00ms -66.00ms 🚀
dist/modern/index.html 749.00b +0.00b 864.00ms -66.00ms 🚀

React HackerNews ✅

Timings

Description Time Difference
Cold 9.00s +462.00ms ⚠️
Cached 426.00ms -8.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/index.js 487.90kb +0.00b 4.75s +248.00ms ⚠️
dist/PermalinkedComment.73f689ea.js 4.21kb +0.00b 4.75s +248.00ms ⚠️
dist/UserProfile.1b7befb5.js 1.57kb +0.00b 4.75s +248.00ms ⚠️
dist/NotFound.e6c89571.js 429.00b +0.00b 4.75s +247.00ms ⚠️
dist/logo.c5bb83f1.png 246.00b +0.00b 4.71s +248.00ms ⚠️

Cached Bundles

Bundle Size Difference Time Difference
dist/index.js 487.90kb +0.00b 5.04s +444.00ms ⚠️
dist/PermalinkedComment.73f689ea.js 4.21kb +0.00b 5.04s +444.00ms ⚠️
dist/UserProfile.1b7befb5.js 1.57kb +0.00b 5.04s +444.00ms ⚠️
dist/NotFound.e6c89571.js 429.00b +0.00b 5.04s +443.00ms ⚠️
dist/logo.c5bb83f1.png 246.00b +0.00b 4.99s +434.00ms ⚠️

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 59.80s -621.00ms
Cached 1.49s +34.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/editorView.af442747.js 594.92kb +0.00b 44.55s +10.32s ⚠️
dist/popup.64bc9a82.js 209.67kb +0.00b 44.55s +10.32s ⚠️
dist/Toolbar.1af0e801.js 107.23kb +0.00b 44.55s +10.32s ⚠️
dist/Modal.cd71eaf3.js 45.33kb +0.00b 44.55s +10.32s ⚠️
dist/ui.5d3f7adc.js 14.94kb +0.00b 44.55s +10.32s ⚠️
dist/smartMediaEditor.48c8cf63.js 13.25kb +0.00b 44.55s +10.32s ⚠️
dist/dropzone.39132d0c.js 12.16kb +0.00b 44.55s +10.32s ⚠️
dist/EmojiPickerComponent.0482d6c0.js 3.73kb +0.00b 44.55s +10.32s ⚠️
dist/dropzone.55bef257.js 3.29kb +0.00b 44.55s +10.33s ⚠️
dist/clipboard.df70240c.js 2.93kb +0.00b 44.55s +10.32s ⚠️
dist/ResourcedEmojiComponent.667554b4.js 2.12kb +0.00b 44.55s +10.32s ⚠️
dist/browser.4e039ed7.js 1.69kb +0.00b 44.55s +10.32s ⚠️
dist/media-card-analytics-error-boundary.c718a9a7.js 1.12kb +0.00b 44.55s +10.32s ⚠️
dist/media-picker-analytics-error-boundary.8b2547e5.js 966.00b +0.00b 44.55s +10.33s ⚠️
dist/simpleHasher.fc0d6100.js 643.00b +0.00b 44.55s +10.32s ⚠️

Cached Bundles

Bundle Size Difference Time Difference
dist/editorView.124f5fc0.js 594.92kb +0.00b 44.83s +10.80s ⚠️
dist/popup.64bc9a82.js 209.67kb +0.00b 44.83s +10.81s ⚠️
dist/Toolbar.1af0e801.js 107.23kb +0.00b 44.83s +10.80s ⚠️
dist/Modal.cd71eaf3.js 45.33kb +0.00b 44.83s +10.81s ⚠️
dist/ui.5d3f7adc.js 14.94kb +0.00b 44.83s +10.81s ⚠️
dist/smartMediaEditor.48c8cf63.js 13.25kb +0.00b 44.83s +10.80s ⚠️
dist/dropzone.39132d0c.js 12.16kb +0.00b 44.83s +10.81s ⚠️
dist/EmojiPickerComponent.0482d6c0.js 3.73kb +0.00b 44.83s +10.81s ⚠️
dist/dropzone.55bef257.js 3.29kb +0.00b 44.83s +10.81s ⚠️
dist/clipboard.df70240c.js 2.93kb +0.00b 44.83s +10.80s ⚠️
dist/ResourcedEmojiComponent.667554b4.js 2.12kb +0.00b 44.83s +10.81s ⚠️
dist/browser.4e039ed7.js 1.69kb +0.00b 44.83s +10.80s ⚠️
dist/media-card-analytics-error-boundary.c718a9a7.js 1.12kb +0.00b 44.83s +10.81s ⚠️
dist/media-picker-analytics-error-boundary.8b2547e5.js 966.00b +0.00b 44.83s +10.81s ⚠️
dist/simpleHasher.fc0d6100.js 643.00b +0.00b 44.83s +10.81s ⚠️

Three.js ✅

Timings

Description Time Difference
Cold 6.21s +152.00ms
Cached 380.00ms +1.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Click here to view a detailed benchmark overview.

@devongovett devongovett merged commit 588bf4c into v2 Dec 16, 2021
@devongovett devongovett deleted the segfault-workaround branch December 16, 2021 18:33
bhovhannes pushed a commit to bhovhannes/parcel that referenced this pull request Dec 23, 2021
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

Successfully merging this pull request may close these issues.

Segmentation file on parcel build when png file is included
3 participants