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

Mac: Don't assert/panic when we fail to read attributes during a FileOp operation #451

Merged
merged 2 commits into from
Nov 1, 2018

Conversation

nickgra
Copy link
Member

@nickgra nickgra commented Nov 1, 2018

Historically, many of us have seen a panic on reading the attempting to read the attributes on some path outside of our virtualization root (Most reports of this have been when no virtualization root is attached). For now, let's avoid the panic here and log the path where the failure occurred.

assert(TryGetFileIsFlaggedAsInRoot(currentVnode, context, &fileFlaggedInRoot));
if (!TryGetFileIsFlaggedAsInRoot(currentVnode, context, &fileFlaggedInRoot))
{
KextLog_Info("Failed to read attributes when handling FileOp operation. Path is %s", path);
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a // Mac(TODO) comment here that this KextLog_Info should be added to the kext log file?

Copy link
Member

Choose a reason for hiding this comment

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

(I suspect that once we have a log file implementation we won't want to include all events in it, but this seems like one we will want)

Copy link
Contributor

Choose a reason for hiding this comment

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

I would argue that we do want to capture all kext log statements into the log file. Why else would we record them?

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree with Saeed, if you look at our existing use of KextLog, we log all those messages today and I can't imagine when we wouldn't want all of these messages to go to the logger.
If it ends up being problematic down the line, we could always revisit.

Copy link
Member

Choose a reason for hiding this comment

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

Why else would we record them?

If we wanted to take the same approach as ProjFS on Windows a subset of our logging calls would always be written to file and the rest would be disabled unless a user enables verbose logging (to track down specific issues they might have encountered).

we log all those messages today and I can't imagine when we wouldn't want all of these messages to go to the logger.

Perhaps we start with only logging error and\or critical events?

I think there's going to be a balance between log file size, and how far back we can go in log file history (assuming we do circular logging).

Copy link
Member

Choose a reason for hiding this comment

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

(All this logging discussion is outside the scope of this PR, so I don't think there's any need to block on it)

@nickgra nickgra merged commit 97ea58c into microsoft:master Nov 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants