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

terminal/kitty: shared memory size may be larger than expected for pages #2070

Merged
merged 1 commit into from
Aug 10, 2024

Conversation

mitchellh
Copy link
Contributor

The shared memory segment size must be a multiple of page size. This means that it may be larger than our expected image size. In this case, we trim the padding at the end.

The shared memory segment size must be a multiple of page size. This
means that it may be larger than our expected image size. In this case,
we trim the padding at the end.
log.warn("unable to fstat shared memory {s}: {}", .{ path, err });
return error.InvalidData;
// The size from stat on may be larger than our expected size because
// shared memory has to be a multiple of the page size.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit, this appears to be a macOS only problem. Linux fstat returns the correct size without padding to the next page size. Doesn't really affect the code, though. It'll work in both.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's why I said may. I don't fully understand the full scope of it and I'm not sure if this is client specific...

@mitchellh mitchellh merged commit 6cb85ef into main Aug 10, 2024
35 of 36 checks passed
@mitchellh mitchellh deleted the kitty-shm branch August 10, 2024 03:55
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.

2 participants