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

[Windows] Beam crash related to DETS or persistent_term #9222

Open
lukaszsamson opened this issue Dec 19, 2024 · 4 comments
Open

[Windows] Beam crash related to DETS or persistent_term #9222

lukaszsamson opened this issue Dec 19, 2024 · 4 comments
Assignees
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM

Comments

@lukaszsamson
Copy link
Contributor

Describe the bug
When ElixirLS test suite is run on Windows on OTP 27, beam crashes. When run from PowerShell terminal it corrupts the terminal.

[process exited with code 2 (0x00000002)]
You can now close this terminal with Ctrl+D, or press Enter to restart.

When run from git bash it crashes and writes

Segmentation fault

No crash dump file is produced

To Reproduce
Unfortunately I was not able to isolate this crash to a simple erl script. The below steps require elixir 1.17 install with hex

  1. Checkout elixir-lsp/elixir-ls@5b43ee2
  2. run mix deps.get
  3. change dir to apps/language_server
  4. run tests mix test test/server_test.exs or mix test test/providers/workspace_symbols_test.exs

Beam crashes almost on every run

Here's an example crash from ElixirLS CI
https://github.com/elixir-lsp/elixir-ls/actions/runs/12369438492/job/34521367766

Expected behavior
No crash

Affected versions
27 on windows
The bug was not present on earlier version
Linux and mac is not affected

Additional context
The bug seems to be some weird combination of DETS and/or persistent_term usage. Removing DETS makes the crash much harder to reproduce. Removing both makes the crash go away.

@lukaszsamson lukaszsamson added the bug Issue is reported as a bug label Dec 19, 2024
@lukaszsamson
Copy link
Contributor Author

I can provide windows crash dumps but I'd need guidance on how to set up windows for OTP debugging

@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label Dec 19, 2024
@garazdawi
Copy link
Contributor

Which specific 27 versions have you tried? I assume 26 works?

@lukaszsamson
Copy link
Contributor Author

Which specific 27 versions have you tried?

This crash has been failing CI since I added OTP 27 to the matrix 5 months ago https://github.com/elixir-lsp/elixir-ls/actions/runs/9817589619. The newest I tried locally was 27.2. I guess all versions are affected

I assume 26 works?

Yes, I run mostly the same test suite on 22-27. Only 27 on windows is affected

@garazdawi
Copy link
Contributor

I managed to reproduce it locally, the crash happens when garbage collecting literals, which would point to something related to persistent_term deletion, or just literal GC in general.

I will continue to dig today, but Christmas holidays is coming so it will probably be a couple of weeks before I have time to find out what is going on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM
Projects
None yet
Development

No branches or pull requests

4 participants