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

Fix heap allocation for matching out short bitstrings #7581

Merged

Conversation

bjorng
Copy link
Contributor

@bjorng bjorng commented Aug 23, 2023

The runtime system could underestimate the amount of heap space needed for matching out short bitstrings with a size not divisble by 8. That could lead to the runtime system terminating with an "Overrun heap and stack" error.

Fixes #7292

@bjorng bjorng added team:VM Assigned to OTP team VM fix testing currently being tested, tag is used by OTP internal CI labels Aug 23, 2023
@bjorng bjorng requested a review from sverker August 23, 2023 04:23
@bjorng bjorng self-assigned this Aug 23, 2023
@bjorng bjorng linked an issue Aug 23, 2023 that may be closed by this pull request
@github-actions
Copy link
Contributor

github-actions bot commented Aug 23, 2023

CT Test Results

       3 files     133 suites   48m 37s ⏱️
1 557 tests 1 506 ✔️ 51 💤 0
1 980 runs  1 910 ✔️ 70 💤 0

Results for commit a9ed6ec.

♻️ 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 runtime system could underestimate the amount of heap space needed
for matching out short bitstrings with a size not divisble by 8. That
could lead to the runtime system terminating with an "Overrun heap and
stack" error.

Fixes erlang#7292
@bjorng bjorng force-pushed the bjorn/jit/small-bitstrings/GH-7292/OTP-18733 branch from c2f575e to a9ed6ec Compare August 23, 2023 13:10
@bjorng bjorng merged commit 8d41073 into erlang:maint Aug 25, 2023
16 checks passed
bjorng added a commit to bjorng/otp that referenced this pull request Aug 30, 2023
Normally, all BEAM files created by OTP 25 and later have a "Type"
chunk that contains type information. `beam_lib:strip/1` will not
discard the "Type" chunk, but build/release scripts that do their own
custom stripping could accidentally delete the chunk.

Make sure to test that loading and executing BEAM files without type
information works. Since there was an overrun-heap-and-stack
bug (reported in erlang#7292, fixed in erlang#7581) when using the bit syntax, the
bit syntax test suites seems to appropriate to clone to new BEAM files
without types.
@bjorng bjorng deleted the bjorn/jit/small-bitstrings/GH-7292/OTP-18733 branch September 18, 2023 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overrun stack and heap OTP-26.0
2 participants