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 assertion in prim_tty #8503

Merged
merged 1 commit into from
May 24, 2024
Merged

Fix assertion in prim_tty #8503

merged 1 commit into from
May 24, 2024

Conversation

dszoboszlay
Copy link
Contributor

The reader updates the Unicode state right before checking the input's encoding, but the assertion that encoding errors are only possible when using utf8 was done against the original state.

Sorry for not writing any test cases, but this is a trivial bugfix for a hard to reproduce race condition.

Copy link
Contributor

github-actions bot commented May 22, 2024

CT Test Results

    2 files     67 suites   1h 4m 24s ⏱️
1 533 tests 1 288 ✅ 245 💤 0 ❌
1 734 runs  1 441 ✅ 293 💤 0 ❌

Results for commit 07f80c6.

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

@dszoboszlay
Copy link
Contributor Author

Some tests failed in pg_SUITE, but I don't see how would these be related to my change. For example this one:

=== Ended at 2024-05-22 23:40:30
=== Location: [{test_server,read_std,2888},
              {test_server,peer_compile,2869},
              {test_server,start_peer,2823},
              {pg_SUITE,spawn_disconnected_node,[981](file:///home/dszoboszlay/Downloads/make_test_dir/ct_logs/ct_run.test_server@e258d1fa7691.2024-05-22_22.54.30/make_test_dir.kernel_test.logs/run.2024-05-22_22.55.03/pg_suite.src.html#981)},
              {pg_SUITE,spawn_node,[964](file:///home/dszoboszlay/Downloads/make_test_dir/ct_logs/ct_run.test_server@e258d1fa7691.2024-05-22_22.54.30/make_test_dir.kernel_test.logs/run.2024-05-22_22.55.03/pg_suite.src.html#964)},
              {pg_SUITE,process_owner_check,[209](file:///home/dszoboszlay/Downloads/make_test_dir/ct_logs/ct_run.test_server@e258d1fa7691.2024-05-22_22.54.30/make_test_dir.kernel_test.logs/run.2024-05-22_22.55.03/pg_suite.src.html#209)},
              {test_server,ts_tc,1794},
              {test_server,run_test_case_eval1,1303}]
=== === Reason: {exit,1,
                       ["/usr/local/lib/erlang-27.0/bin/erlc"," ","-o"," ",
                        "/buildroot/otp/lib/kernel/make_test_dir/ct_logs/ct_run.test_server@e258d1fa7691.2024-05-22_22.54.30/make_test_dir.kernel_test.logs/run.2024-05-22_22.55.03/log_private/process_owner_check",
                        " ",
                        <<47,98,117,105,108,100,114,111,111,116,47,111,116,
                          112,47,69,114,108,97,110,103,32,226,136,133,226,138,
                          164,226,132,158,47,108,105,98,47,115,116,100,108,
                          105,98,45,54,46,48,47,115,114,99,47,112,101,101,114,
                          46,101,114,108>>],
                       <<47,98,117,105,108,100,114,111,111,116,47,111,116,112,
                         47,69,114,108,97,110,103,32,226,136,133,226,138,164,
                         226,132,158,47,108,105,98,47,115,116,100,108,105,98,
                         45,54,46,48,47,115,114,99,47,112,101,101,114,46,101,
                         114,108,58,53,49,58,50,58,32,99,97,110,39,116,32,102,
                         105,110,100,32,109,111,100,117,108,101,100,111,99,32,
                         102,105,108,101,32,34,46,46,47,100,111,99,47,115,114,
                         99,47,112,101,101,114,46,109,100,34,10,37,32,32,32,
                         53,49,124,32,45,109,111,100,117,108,101,100,111,99,
                         40,123,102,105,108,101,44,32,34,46,46,47,100,111,99,
                         47,115,114,99,47,112,101,101,114,46,109,100,34,125,
                         41,46,10,37,32,32,32,32,32,124,32,32,94,10,10>>}

The last binary is the output of the command and it reads like this:

/buildroot/otp/Erlang ∅⊤℞/lib/stdlib-6.0/src/peer.erl:51:2: can't find moduledoc file "../doc/src/peer.md"
%   51| -moduledoc({file, "../doc/src/peer.md"}).
%     |  ^

@garazdawi garazdawi changed the base branch from master to maint May 23, 2024 15:15
@garazdawi
Copy link
Contributor

Would you mind rebasing on maint so that we can get the fix out a little bit earlier?

Some tests failed in pg_SUITE, but I don't see how would these be related to my change.

That failure is not related to your fix, but something else.

The reader updates the Unicode state right before checking the input's encoding, but the assertion that encoding errors are only possible when using utf8 was done against the original state.
@dszoboszlay
Copy link
Contributor Author

Would you mind rebasing on maint so that we can get the fix out a little bit earlier?

Oops, sorry! Fixed now.

@garazdawi garazdawi self-assigned this May 24, 2024
@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label May 24, 2024
@garazdawi garazdawi merged commit aac32ce into erlang:maint May 24, 2024
16 checks passed
@garazdawi
Copy link
Contributor

Thanks!

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.

None yet

3 participants