Skip to content

Lots of Serial Monitor content without line break causes IDE to become unresponsive #934

Open
@per1234

Description

@per1234

Describe the problem

If the Arduino board prints a large amount of data without a line break to Serial Monitor, the IDE becomes unresponsive.

To reproduce

Equipment

  • Any Arduino board

Steps

  1. Upload the following sketch to the Arduino board:
    void setup() {
      Serial.begin(115200);
    }
    void loop() {
      Serial.print("hello");
    }
  2. Open the "Serial Monitor" view.
  3. Select "115200 baud" from the dropdown baud rate menu at the top right corner of the "Serial Monitor" view.
  4. Wait a couple minutes.
    It will likely occur much sooner than that, especially with a board that has native USB capability
  5. Try to use the Arduino IDE UI.

🐛 The UI is unresponsive.

Expected behavior

Arduino IDE handles this condition gracefully.

That could even be a limit on the line length that will be displayed, since it is more likely that problematic line lengths would be caused by a missing line break in the sketch than intentionally formatting.

Arduino IDE version

Original report

2.0.0-rc5-snapshot-c9b498f

Last verified with

2.0.0-rc5-snapshot-df8658e (was not fixed by #982)

Operating system

Windows

Operating system version

10

Additional context

There were similar reports of Serial Monitor impact on CPU performance, but those were resolved by #524

Additional reports

Workaround

Adjust your sketch code so that it will produce line breaks as appropriate to avoid the output of excessively long lines.

For the sketch in the demo above, this would be accomplished by changing the Serial.print call to Serial.println:

void setup() {
  Serial.begin(115200);
}
void loop() {
  Serial.println("hello");
}

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details

Metadata

Metadata

Assignees

Labels

topic: codeRelated to content of the project itselftopic: serial monitorRelated to the Serial Monitortype: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions