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 send_recv_slice when U != u8 #1620

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

nategraf
Copy link
Contributor

@nategraf nategraf commented Apr 2, 2024

send_recv_slice, which is used to allow the host to define "custom syscalls" has a bug which means that it only works when the generic type U is u8. This is because the host returns to the guest a length for how many bytes it will send to the guest on the next call. The guest code currently interprets this number of bytes to be a number of elements of type U. So when mem::size_of::<U> != 1, the length will be incorrect and the second read will fail.

Copy link

vercel bot commented Apr 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
reports ✅ Ready (Inspect) Visit Preview Apr 17, 2024 10:44am
website ✅ Ready (Inspect) Visit Preview Apr 17, 2024 10:44am

Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-1620.d1uc3c4lom8wx5.amplifyapp.com

@flaub
Copy link
Member

flaub commented Apr 4, 2024

@hashcashier did this fix your issue?

@hashcashier
Copy link
Contributor

@nategraf @flaub this seems to now break the case where U = u8 and doesn't work when U = u32

@flaub flaub self-assigned this Apr 24, 2024
@flaub
Copy link
Member

flaub commented Apr 25, 2024

Is there a test we can write which shows the issue?

@SchmErik
Copy link
Contributor

Is there a test we can write which shows the issue?

friendly ping! @hashcashier could you answer this question?

@flaub flaub assigned SchmErik and unassigned flaub Apr 29, 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

4 participants