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

Update on Miri coverage #2438

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Update on Miri coverage #2438

wants to merge 2 commits into from

Conversation

bakaq
Copy link
Contributor

@bakaq bakaq commented Jul 5, 2024

Recently a lot of the unsafe code in Scryer was improved in #2393, so I did another pass with Miri on the tests that were previously blocked on arena.rs and streams.rs (which were improved since then). All tests that were previously blocked by UB in streams.rs are now blocked by UB in arena.rs instead (with the exception of pstr_iter_tests which is now blocked on atom_table.rs UB). All of the tests that are blocked on arena.rs UB are blocked on the transmute in the ptr_to_allocated() function, in every case trying to allocate a stream, usually when creating an instance of Machine.

This is good because if this is resolved then all of those tests will go deeper and maybe even pass. I don't know what exactly is the reason for Miri pointing UB here, but it's probably because somewhere in all the transmutes and casts back and forth between AllocSlab and TypedAllocSlab it's losing provenance information.

Skgland added a commit to Skgland/scryer-prolog that referenced this pull request Jul 6, 2024
- removed some unsafe
- added some safety comments
- add explicit types to transmute calls
- reworked UntypedArenaPtr -> TypedArenaPtr conversion

might help with mthom#2438, I noticed fewer complains from miri after changing the default impl for `ArenaAllocated::alloc`
Skgland added a commit to Skgland/scryer-prolog that referenced this pull request Jul 6, 2024
Skgland added a commit to Skgland/scryer-prolog that referenced this pull request Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant