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

SIGBUS sometimes when running bun install and nx postscript runs #14207

Closed
ffMathy opened this issue Sep 27, 2024 · 13 comments
Closed

SIGBUS sometimes when running bun install and nx postscript runs #14207

ffMathy opened this issue Sep 27, 2024 · 13 comments
Assignees
Labels
atw bug Something isn't working

Comments

@ffMathy
Copy link

ffMathy commented Sep 27, 2024

What version of Bun is running?

1.1.29+6d43b3662

What platform is your computer?

Linux 6.10.4-linuxkit aarch64 unknown

What steps can reproduce the bug?

N/A - it happens inconsistently. We're running inside a DevContainer.

What is the expected behavior?

Bun install succeeds.

What do you see instead?

error: postinstall script from "nx" terminated by SIGBUS (Misaligned address error)
93 Bus error               (core dumped) bun install -y

Additional information

No response

@ffMathy ffMathy added bug Something isn't working needs triage labels Sep 27, 2024
@ffMathy ffMathy changed the title SEGBUS sometimes when running bun install and nx postscript runs SIGBUS sometimes when running bun install and nx postscript runs Sep 27, 2024
@190n
Copy link
Contributor

190n commented Sep 27, 2024

Are you able to share an nx workspace that the issue reproduces in? I haven't been able to trigger this in a new workspace.

@ffMathy
Copy link
Author

ffMathy commented Sep 30, 2024

Unfortunately not. The code is under NDA, and I tried spending several hours creating a repro.

Since it's flaky, I have no idea what triggers it.

However, it always complains about the NX post install scripts. So must have something to do with whatever NX is trying to run after install.

@ffMathy
Copy link
Author

ffMathy commented Sep 30, 2024

Is there a way to create a memory dump of some sorts that doesn't contain sensitive information?

@Leolainen
Copy link

I'm facing this issue too within my org. We're building private npm packages with nx & bun.

The error only shows up when running bun install in the CI. I've not faced the error locally.
I created a repro: here:https://github.com/Leolainen/sigbus-repro

Here's a failing workflow:
https://github.com/Leolainen/sigbus-repro/actions/runs/11101969512/job/30840735737?pr=1

I hope it's something trivial. :) 🤞

@Leolainen
Copy link

I forgot to add that, like in @ffMathy's case, the issue is flaky. Rerunning the workflow may or may not result in a complete run without issues.

@190n
Copy link
Contributor

190n commented Sep 30, 2024

Thanks a lot for the repro, I can start looking into this.

I'm noticing the CI machine is x86_64 Linux -- @ffMathy is that the kind of machine that you got this on, too? You said it's a dev container; what was the host platform?

@ffMathy
Copy link
Author

ffMathy commented Sep 30, 2024

For me, the host platform is a MacBook M1. But it happens on my GitHub Actions build too, which is an ubuntu-latest that is also running Bun commands inside a devcontainer via the official "devcontainers/ci" action.

@ffMathy
Copy link
Author

ffMathy commented Sep 30, 2024

The base image of the devcontainer is node:lts.

@190n
Copy link
Contributor

190n commented Sep 30, 2024

For me, the host platform is a MacBook M1.

And is the container also running ARM, or is it emulated x86?

@ffMathy
Copy link
Author

ffMathy commented Sep 30, 2024

The container is also running ARM. But in the CI environment where it's also happening in ubuntu-latest, both host and container is in X86.

@190n
Copy link
Contributor

190n commented Oct 1, 2024

Thanks again for the repro @Leolainen, that was invaluable. After some debugging I think this is a duplicate of nrwl/nx#26517. In the meantime, a workaround that worked for me and for a few people in that issue thread is forcing the install scripts to run sequentially. You can do that in Bun by passing --concurrent-scripts 1 to bun install. Does that resolve the issue on your production codebases?

@Jarred-Sumner
Copy link
Collaborator

Pretty confident this is an upstream bug in nx that we are unable to help with much on our end

If you think there's anything we can do to help, please leave a comment and we'll re-open this

@Jarred-Sumner Jarred-Sumner closed this as not planned Won't fix, can't repro, duplicate, stale Oct 3, 2024
@Leolainen
Copy link

Sorry, I never responded. @190n Your suggestion seems to have solved the issue. Thanks a lot. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
atw bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants