Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Idol calls returning a
Complex
error type return a non-zero error code of1
, but also serialize their error into the buffer provided by the caller. Right now, we're not necessarily sizing that buffer correctly when making HIF and RPC calls! If theok
type is smaller than theerror
type, then the buffer will be undersized and bytes will be dropped on the floor during thesys_reply
call.sys_reply
does not report errors, but it expects the server to check the buffer size itself. A separate issue in Idol (oxidecomputer/idolatry#36) means that the generated server code makes the same mistake in checking the buffer size; otherwise, we would have seen this error much sooner!(Luckily, this all works correctly in task-to-task calls, because Idol's generated client API correctly computes the maximum
REPLY_SIZE
and passes correctly-sized buffers)This PR correctly computes the
reply_size()
for Idol operations usingComplex
error types. It also fixes an error in computing serialized size forenum
types (we were taking the sum of variant sizes instead of the max, which is wrong).