Increase the length of trampoline #11
Open
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.
I recently ran into a issue where the client may seg fault when doing IO outside of
/myfs
. By turning on the debugging prints, we can see that it errored out in calling thereal_write
function which is essentially the trampoline.One most linux system, the
__read
and__write
functions has the following code at the beginning:but on some others, it got:
The original
MAX_JMP_LEN (5)
will truncate the code at the lea instruction, and by increasing it to 8 will include the mov. I still don't quite understand how that made a difference because the additional jmp should still be able to restore the original flow of instruction, but the change here did fix the seg fault. Maybe it means that we need to investigate more on what can or cannot be truncated in x86 instructions.