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 two bit syntax bugs when running OTP-24 compiled code with the AArch64 JIT #8248

Merged

Conversation

bjorng
Copy link
Contributor

@bjorng bjorng commented Mar 11, 2024

This pull request eliminates the crash introduced in OTP-26.2.3 on AArch64 when running code compiled for OTP 24. It also fixes another bit syntax bug that I found when I extended the test suite.

On AArch64, when constructing a binary using the bit syntax, using a
unit greater than 16 and not being a power of two would, would cause
erroneous results. For example, given this module compiled with
Erlang/OTP 24:

    -module(t).
    -export([bar/2]).

    bar(Contents, Size) ->
        <<Contents:Size/unit:31>>.

only the first two bytes would be correctly set:

    1> t:bar(-1, 1).
    <<255,255,0,0:7>>
    2> t:bar(-1, 1).
    <<255,255,149,35:7>>
    3> t:bar(-1, 1).
    <<255,255,0,0:7>>
    4> t:bar(-1, 1).
    <<255,255,3,0:7>>
@bjorng bjorng added team:VM Assigned to OTP team VM fix testing currently being tested, tag is used by OTP internal CI labels Mar 11, 2024
@bjorng bjorng requested a review from jhogberg March 11, 2024 11:49
@bjorng bjorng self-assigned this Mar 11, 2024
@bjorng bjorng linked an issue Mar 11, 2024 that may be closed by this pull request
Copy link
Contributor

github-actions bot commented Mar 11, 2024

CT Test Results

    3 files    143 suites   46m 48s ⏱️
1 571 tests 1 521 ✅ 50 💤 0 ❌
2 114 runs  2 040 ✅ 74 💤 0 ❌

Results for commit 3ab2cc6.

♻️ 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

@bjorng bjorng merged commit ebf5661 into erlang:maint Mar 13, 2024
18 checks passed
@csrl
Copy link

csrl commented Mar 14, 2024

Any chance of getting this into maint-26?

@jhogberg
Copy link
Contributor

jhogberg commented Mar 15, 2024

Yes. This PR got merged into maint "instead of" maint-26 as our patch release workflow includes merging branches to maint (which is then merged into master) before the versioned branches. This simplifies merging fixes that are targeted at several versions, such as this one which will be released in the next 24, 25 and 26 patches.

@acrogenesis
Copy link

When/how is this patch released in docker images? Using elixir:1.16-slim fails to retrieve deps?

@csrl
Copy link

csrl commented Mar 18, 2024

@jhogberg I understand that if merged to maint it will go out in 26.2.4. However, It would be great to see this sooner in a 26.2.3.x release. Thanks!

@sergchernata
Copy link

When can we expect to see this released for docker?

@bjorng bjorng deleted the bjorn/erts/bs-construction/GH-8238/OTP-19021 branch April 25, 2024 03: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.

mix deps.get crashes on 26.2.3 - M2 Mac
5 participants