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

ora@7 dependency causes seg fault (was seg fault on mac m1 arm) #229

Open
ahgittin opened this issue Sep 3, 2023 · 1 comment
Open

ora@7 dependency causes seg fault (was seg fault on mac m1 arm) #229

ahgittin opened this issue Sep 3, 2023 · 1 comment

Comments

@ahgittin
Copy link

ahgittin commented Sep 3, 2023

I'm working on a large TS project which builds a CLI with spinners and when we tried upgrading our deps this month, the CLI started giving seg faults. We identified this as the dependency which caused it; reverting it to v6.3.1 and the problem went away.

I've no idea why; it doesn't look like much changed in this project to cause such a problem, so it could be something in one of the upstream strip ansi or string width libraries, or some other quirk of CLI builds which always seem a dark magic. But since presumably CLIs are a common environment for this library I thought I'd note this.

The key elements of our CLI build are tsc, esbuild, and pkg:

npx tsc
npx esbuild ./src/main.js --bundle --platform=node --outfile=target/esb/esb.js --external:shelljs
npx pkg target/esb/esb.js -t node16-macos-arm64 --output target/pkg/maeztro-macos-arm64

Apologies I've not had time to investigate why; if I do I'll add details.

@kanadgupta
Copy link

Hi there, our team is also running into this. We've been able to reproduce the segmentation fault with ora@7 on multiple operating systems/architectures, whether compiling using esbuild or rollup. I've also confirmed that the seg fault doesn't appear when downgrading to ora@6.

I haven't been able to figure out the root cause but my theory is that a recent change to the ora dependency tree isn't playing nicely with the way pkg builds binaries. I create a minimal example repository that demonstrates the issue and documents my findings: https://github.com/kanadgupta/ora-seg-fault-bug

@ahgittin mind renaming this issue so it's not specific to macOS? I've been keeping a running list of affected platforms here: https://github.com/kanadgupta/ora-seg-fault-bug#platform-info

@ahgittin ahgittin changed the title v7 causes seg fault on mac m1 arm ora@7 dependency causes seg fault (was seg fault on mac m1 arm) Jan 30, 2024
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

2 participants