Skip to content

cc.arduino.cli.commands.v1.ArduinoCoreService.Compile gRPC method call hangs when there is a large quantity of stderr output #2169

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

Closed
3 tasks done
per1234 opened this issue May 4, 2023 · 0 comments · Fixed by #2171
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself topic: gRPC Related to the gRPC interface type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented May 4, 2023

Describe the problem

The compilation operation never returns under the following conditions:

To reproduce

Setup

$ arduino-cli version

arduino-cli.exe  Version: git-snapshot Commit: 2a5c83a8 Date: 2023-05-04T04:31:10Z

$ mkdir /tmp/ManyWarningsSketch

$ i=0; while [ "$i" -lt 2500 ]; do i=$(( i + 1 )); echo "#warning foo" >> /tmp/ManyWarningsSketch/ManyWarningsSketch.ino; done  # Make code produce a large quantity of stderr compilation output

$ printf "void setup() {}\nvoid loop() {}\n" >> "/tmp/ManyWarningsSketch/ManyWarningsSketch.ino"

$ arduino-cli daemon

Daemon is now listening on 127.0.0.1:50051

Demo

run the following grpcurl commands in another terminal:

$ grpcurl \
  -plaintext \
  -import-path ./rpc \
  -proto cc/arduino/cli/commands/v1/commands.proto \
  127.0.0.1:50051 \
  cc.arduino.cli.commands.v1.ArduinoCoreService.Create

{
  "instance": {
    "id": 1
  }
}

$ grpcurl \
  -plaintext \
  -import-path ./rpc \
  -proto cc/arduino/cli/commands/v1/commands.proto \
  -d '{"instance": {"id": 1}}' \
  127.0.0.1:50051 \
  cc.arduino.cli.commands.v1.ArduinoCoreService.Init

$ grpcurl \
  -plaintext \
  -import-path ./rpc \
  -proto cc/arduino/cli/commands/v1/commands.proto \
  -d '{"instance": {"id": 1}, "fqbn": "arduino:avr:uno", "sketch_path": "/tmp/ManyWarningsSketch", "warnings": "all"}' \
  127.0.0.1:50051 \
  cc.arduino.cli.commands.v1.ArduinoCoreService.Compile

[...]

{
  "progress": {
    "percent": 100
  }
}
{
  "outStream": "U2tldGNoIHVzZXMgNDQ0IGJ5dGVzICgxJSkgb2YgcHJvZ3JhbSBzdG9yYWdlIHNwYWNlLiBNYXhpbXVtIGlzIDMyMjU2IGJ5dGVzLgpHbG9iYWwgdmFyaWFibGVzIHVzZSA5IGJ5dGVzICgwJSkgb2YgZHluYW1pYyBtZW1vcnksIGxlYXZpbmcgMjAzOSBieXRlcyBmb3IgbG9jYWwgdmFyaWFibGVzLiBNYXhpbXVtIGlzIDIwNDggYnl0ZXMuCg=="
}

🐛 The command never returns.

Expected behavior

cc.arduino.cli.commands.v1.ArduinoCoreService.Compile method call always returns.

Arduino CLI version

2a5c83a

Operating system

Windows

Operating system version

11

Additional context

I bisected the regression to eece582


I'm not able to reproduce the fault when I add the --debug flag to the arduino-cli daemon invocation.


I can also reproduce the fault using Arduino IDE, so it is not specific to grpcurl.

I am not able to reproduce the fault using the Arduino CLI command line interface (with either text output or json output).

I am not able to reproduce the fault when compiling sketches the produce a large quantity of stdout compilation output.


Originally reported by @KurtE at https://forum.arduino.cc/t/build-with-lots-of-errors-hangs-arduino-process/1116008

Additional reports

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the nightly build
  • My report contains all necessary details
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project topic: gRPC Related to the gRPC interface labels May 4, 2023
@cmaglie cmaglie added this to the Arduino CLI 0.33.0 milestone May 5, 2023
@per1234 per1234 added the conclusion: resolved Issue was resolved label Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself topic: gRPC Related to the gRPC interface type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants