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

erts: Fix crash in ETS compressed tables #8683

Conversation

jhogberg
Copy link
Contributor

@jhogberg jhogberg commented Jul 23, 2024

The compression was a bit too good, converting ErlSubBits to ErlHeapBits whenever that resulted in a smaller result, breaking an assumption that ETS compressed tables made (size_object(original) == size_object(decompressed)).

This commit fixes it by not being as clever, naively encoding ErlSubBits and the likes as-is regardless of size.

(Edit: the PR currently lacks a test for this bug, but it's late and I want CI to run overnight, I'll add one tomorrow)

@jhogberg jhogberg added the team:VM Assigned to OTP team VM label Jul 23, 2024
@jhogberg jhogberg self-assigned this Jul 23, 2024
@jhogberg jhogberg linked an issue Jul 23, 2024 that may be closed by this pull request
Copy link
Contributor

github-actions bot commented Jul 23, 2024

CT Test Results

    4 files    227 suites   1h 20m 41s ⏱️
3 601 tests 3 508 ✅  93 💤 0 ❌
4 668 runs  4 547 ✅ 121 💤 0 ❌

Results for commit 36dd893.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

The compression was a bit too good, converting ErlSubBits to
ErlHeapBits whenever that resulted in a smaller result, breaking
an assumption that ETS compressed tables made:

    size_object(original) == size_object(decompressed)

This commit fixes it by not being as clever, naively encoding
ErlSubBits and the likes as-is regardless of size.
@jhogberg jhogberg force-pushed the john/erts/fix-compressed-ets-crash/OTP-19176 branch from 9639403 to 36dd893 Compare July 24, 2024 08:16
@hauxir
Copy link

hauxir commented Aug 4, 2024

I'm running into this issue in production and am looking forward to the fix. Any updates on the status?

@jhogberg
Copy link
Contributor Author

jhogberg commented Aug 5, 2024

The fix will be included in the next patch for the 27 track. In the meantime, you can include this branch in your builds. :-)

@hauxir
Copy link

hauxir commented Aug 5, 2024

The fix will be included in the next patch for the 27 track. In the meantime, you can include this branch in your builds. :-)

Fair enough, was just wondering how solid this fix is as you mentioned adding a test for the bug.
Either way, will use this branch until next release 👍

@jhogberg
Copy link
Contributor Author

jhogberg commented Aug 5, 2024

I added a test the morning after, it appears solid so far. :-)

@proxyles proxyles merged commit 991d2d6 into erlang:maint-27 Sep 18, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segfault during traversal of ETS table when compressed (OTP 27)
3 participants