Skip to content

Sanitize ExUnit formatters against invalid UTF-8 - #15821

Merged
josevalim merged 9 commits into
elixir-lang:mainfrom
kidq330:kidq330/fix_exunit_logger_crash
Sep 1, 2026
Merged

Sanitize ExUnit formatters against invalid UTF-8#15821
josevalim merged 9 commits into
elixir-lang:mainfrom
kidq330:kidq330/fix_exunit_logger_crash

Conversation

@kidq330

@kidq330 kidq330 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor
  • Describe here the reasons behind the pull request.
    This is a fix for a crash in ExUnit that I came across while debugging missing logs for a test suite that turned out to hit the already-fixed diff crashing the formatter: 0055f2fe53. Nevertheless it is reproducible as shown in this minimal mix project. I believe ExUnit fails on Ecto exception error #11108 might be related

  • Make sure you have read the CONTRIBUTING.md file.

  • Make sure any relevant documentation and tests have been added/updated.
    N/A

  • Do not submit Draft pull requests unless previously asked/agreed.
    N/A

  • AI assistance
    The tests were AI generated, I applied the fixes

@josevalim

Copy link
Copy Markdown
Member

I propose for us to first change only the cli formatter to escape logs indeed. Can you please amend accordingly? For the tests, we have an integration suite where we already check for capture logs, so we can add a single new test there. Thanks!

@kidq330

kidq330 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Done, I wasn't able to find any path through which the regular captured logs wind up invalid, so I only added sanitization to the failure messages

@josevalim

Copy link
Copy Markdown
Member

Looks very clean now!

@josevalim
josevalim merged commit 4d242a8 into elixir-lang:main Sep 1, 2026
14 of 15 checks passed
@josevalim

Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants