Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
cmaglie merged 4 commits intoarduino:masterfromcmaglie:unbound-recursion
May 12, 2025

Conversation

@cmaglie
Copy link
Member

Please check if the PR fulfills these requirements

Seehow to contribute

  • The PR has no duplicates (please search among thePull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • 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?

$ cat sketch.ino#include <a.h>$ cat a.h#include <a.h>#include <a.h>#include <a.h>$ arduino-cli compile -b arduino:avr:uno

The process never terminates, and it's killed for OOM later by the kernel.

What is the new behavior?

$ cat sketch.ino#include <a.h>$ cat a.h#include <a.h>#include <a.h>#include <a.h>$ arduino-cli compile -b arduino:avr:uno[...a lot of output truncated...]In file included from /home/cmaglie/sketch/a.h:1:0,                 from /home/cmaglie/sketch/a.h:2,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:2,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/a.h:1,                 from /home/cmaglie/sketch/sketch.ino:1:/home/cmaglie/sketch/a.h:1:15: error: #include nested too deeply/home/cmaglie/sketch/a.h:2:15: error: #include nested too deeplyCompiler error output has been truncated.Used platform Version Patharduino:avr   1.6.22  /home/cmaglie/.arduino15/packages/arduino/hardware/avr/1.6.22Error during build: signal: killed$

Does this PR introduce a breaking change, and istitled accordingly?

A legitimate sketch may produce a lot of warningsfrom 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

@cmagliecmaglie self-assigned thisApr 10, 2025
@cmagliecmaglie added type: enhancementProposed improvement topic: CLIRelated to the command line interface labelsApr 10, 2025
@cmagliecmaglie requested a review froma teamApril 10, 2025 16:08
@cmagliecmaglieforce-pushed theunbound-recursion branch 4 times, most recently from1b77a2b to48d4e84CompareApril 29, 2025 17:34
@codecov
Copy link

codecovbot commentedApr 29, 2025
edited
Loading

Codecov Report

Attention: Patch coverage is89.28571% with3 lines in your changes missing coverage. Please review.

Project coverage is 67.84%. Comparing base(2617149) to head(87f2935).
Report is 3 commits behind head on master.

Files with missing linesPatch %Lines
...ernal/arduino/builder/internal/preprocessor/gcc.go89.28%2 Missing and 1 partial⚠️
Additional details and impacted files
@@            Coverage Diff             @@##           master    #2883      +/-   ##==========================================+ Coverage   67.82%   67.84%   +0.01%==========================================  Files         238      238                Lines       22419    22442      +23     ==========================================+ Hits        15206    15226      +20- Misses       6012     6014       +2- Partials     1201     1202       +1
FlagCoverage Δ
unit67.84% <89.28%> (+0.01%)⬆️

Flags with carried forward coverage won't be shown.Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cmagliecmaglieforce-pushed theunbound-recursion branch 2 times, most recently from8957e58 to4e2a650CompareApril 30, 2025 15:00
@cmagliecmaglie requested a review froma teamApril 30, 2025 15:15
@cmagliecmaglie merged commit5e10879 intoarduino:masterMay 12, 2025
101 checks passed
@cmagliecmaglie deleted the unbound-recursion branchMay 12, 2025 10:34
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@alessio-peruginialessio-peruginialessio-perugini approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

@cmagliecmaglie

Labels

topic: CLIRelated to the command line interfacetype: enhancementProposed improvement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@cmaglie@alessio-perugini

[8]ページ先頭

©2009-2025 Movatter.jp