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

[Profiler] Limit files loaded in the coverage profiler to 128k #1823

Merged
merged 1 commit into from
May 20, 2015

Conversation

iainx
Copy link

@iainx iainx commented May 20, 2015

Place an upper limit on files loaded in the coverage profiler to 128k. If the
system suppression file exceeds that (it is currently only 3k), then there's
some problem and the profiler will exit. For other user files passed on the
commandline, we print a warning message and ignore them.

@@ -3054,6 +3056,11 @@ get_file_content (FILE *stream)

while ((bytes_read = fread (buffer, 1, LINE_BUFFER_SIZE, stream)) > 0) {
g_string_append_len (builder, buffer, bytes_read);

if (builder->len > MAX_FILE_SIZE) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it'd be best to get the file size with fseek / ftell. Then you could also pre-size the string with the right size.

Place an upper limit on files loaded in the coverage profiler to 128k. If the
system suppression file exceeds that (it is currently only 3k), then there's
some problem and the profiler will exit. For other user files passed on the
commandline, we print a warning message and ignore them.
alexrp added a commit that referenced this pull request May 20, 2015
[Profiler] Limit files loaded in the coverage profiler to 128k
@alexrp alexrp merged commit 134c7af into mono:master May 20, 2015
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
[Profiler] Limit files loaded in the coverage profiler to 128k

Commit migrated from mono/mono@134c7af
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.

3 participants