-
-
Notifications
You must be signed in to change notification settings - Fork 400
bugfix: Kill compile processes that generates too much output #2883
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
base: master
Are you sure you want to change the base?
Conversation
cancel() | ||
fmt.Fprintln(stderr, i18n.Tr("Compiler error output has been truncated.")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cancel() | |
fmt.Fprintln(stderr, i18n.Tr("Compiler error output has been truncated.")) | |
fmt.Fprintln(stderr, i18n.Tr("Compiler error output has been truncated.")) | |
cancel() |
Probably I'd swap just in case the context cancellation unblocks the WaitWithinContext
and returns the stderr bytes, before we appended the error string.
a9e78c2
to
5d085c9
Compare
db92bd5
to
1b77a2b
Compare
This patch fixes how process are killed on MacOS and Windows
1b77a2b
to
48d4e84
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2883 +/- ##
=======================================
Coverage 67.83% 67.84%
=======================================
Files 238 238
Lines 22419 22442 +23
=======================================
+ Hits 15209 15226 +17
- Misses 6010 6014 +4
- Partials 1200 1202 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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