bugfix: Kill compile processes that generates too much output #2883
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.
Please check if the PR fulfills these requirements
See how to contribute
before creating one)
our contributing guidelines
UPGRADING.md
has been updated with a migration guide (for breaking changes)configuration.schema.json
updated if new parameters are added.What kind of change does this PR introduce?
Previously, compiling a sketch containing an include loop could generate a lot of output and crash the Arduino CLI with an out-of-memory error. This is due to the library-discovery process that buffers the stderr output of the compiler for analysis after the process exits.
To fix this problem, a limit to the compiler output has been set to 100KB of data.
What is the current behavior?
The process never terminates, and it's killed for OOM later by the kernel.
What is the new behavior?
Does this PR introduce a breaking change, and is titled accordingly?
A legitimate sketch may produce a lot of warnings from a single file, going over 100KB. In that extreme case, the sketch could not be compiled anymore with Arduino CLI.
100KB looks like a reasonable limit. By the way, there are no specific stats available about this, so we have to deploy this fix, get feedback from the user, and be ready to increase this limit if needed.
Other information