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

Display file is blocked or not. #2185

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

Conversation

lonicerae
Copy link
Contributor

Showing the result can help isolating some memory consuming issue.

@@ -1807,6 +1807,7 @@ bool probe_path_is_blocked(const char *path, struct oscap_list *blocked_paths)
}
}
oscap_iterator_free(it);
dD("Path:%s, res:%d", path, res);
Copy link
Contributor

Choose a reason for hiding this comment

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

That's a very generic message. I'd suggest something like

Suggested change
dD("Path:%s, res:%d", path, res);
dD("Path: %s, blocked (res): %d", path, res);

Copy link
Contributor

Choose a reason for hiding this comment

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

And maybe it makes sense to only output the message if the path is blocked? Otherwise it'd be very noisy IMHO. What are you debugging actually?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @evgenyz , your modification also looks good. In practice, OpenSCAP is very easy to trigger OOM issue and make other critical processes being killed. About 80% of these issues are due to unbridled rules that accessing lots of files of unwanted folder. This debug message can help to show the paths already be blocked.

Copy link
Contributor

Choose a reason for hiding this comment

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

The thing is, there will be a lot of Path: /foo/bar/, blocked (res): 0 messages in the output, they will litter the log while not really helping any investigation (since these files will be processed and will popup somewhere else in the logs anyways).

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