Skip to content
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

Some stdout colored as stderr in Output view #1303

Open
3 tasks done
per1234 opened this issue Aug 7, 2022 · 2 comments
Open
3 tasks done

Some stdout colored as stderr in Output view #1303

per1234 opened this issue Aug 7, 2022 · 2 comments
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Aug 7, 2022

Describe the problem

Arduino IDE receives two types of streams from Arduino CLI for display in the "Output" view, which are given distinct coloration to allow them to be visually differentiated by the user (#1064):

  • stdout - printed in white
  • stderr - printed in red

🐛 Some of the text from the stdout stream is given the stderr coloration.

To reproduce

Equipment

I encountered this during a "Burn Bootloader" operation with an AVR board. This adds a hardware prerequisite to the reproduction procedure.

  • AVR-based Arduino board (e.g., Uno, Mega, Leonardo)
  • ISP programmer (e.g., "Arduino as ISP", USBasp)

Steps

  1. Select File > Preferences... from the Arduino IDE menus.
  2. Check the box next to Show verbose output during > ☐ compile.
  3. Click the OK button.
  4. Connect the ISP programmer to the Arduino board and to your computer.
  5. Select the board, programmer and port (if applicable) in the Arduino IDE.
  6. Select Tools > Burn Bootloader from the Arduino IDE menus.
  7. Wait for the "Burn Bootloader" process to finish.
  8. Check the coloration of the command from the second step of the "Burn Bootloader" process.

🐛 The command, which is always printed to stdout, is colored red instead of the expected white.

image

Expected behavior

Output from stdout stream is always printed in white (or whatever color the theme dictates) in the "Output" view.

Arduino IDE version

Original report

2.0.0-rc9.1-snapshot-0b33b51

Last verified with

2.0.1-snapshot-bc264d1

Operating system

Windows

Operating system version

10

Additional context

I bisected the introduction of the bug to a54d7c8 (does not occur when using the build from the previous commit 84109e4).


I can see from the logs (the Burn Bootloader process was done with the arduino.cli.daemon.debug setting enabled) that the text with the unexpected coloration was indeed in the out_stream field of the response from Arduino CLI, not the err_stream field:

2022-08-07 00:13:54 daemon INFO 75 |  RESP: {
75 |    "out_stream": "IkM6XFVzZXJzXHBlclxBcHBEYXRhXExvY2FsXEFyZHVpbm8xNVxwYWNrYWdlc1xhcmR1aW5vXHRvb2xzXGF2cmR1ZGVcNi4zLjAtYXJkdWlubzE3L2Jpbi9hdnJkdWRlIiAiLUNDOlxVc2Vyc1xwZXJcQXBwRGF0YVxMb2NhbFxBcmR1aW5vMTVccGFja2FnZXNcYXJkdWlub1x0b29sc1xhdnJkdWRlXDYuMy4wLWFyZHVpbm8xNy9ldGMvYXZyZHVkZS5jb25mIiAtdiAtcGF0bWVnYTMyOHAgLWN1c2Jhc3AgLVB1c2IgIi1VZmxhc2g6dzpDOlxVc2Vyc1xwZXJcQXBwRGF0YVxMb2NhbFxBcmR1aW5vMTVccGFja2FnZXNcYXJkdWlub1xoYXJkd2FyZVxhdnJcMS44LjUvYm9vdGxvYWRlcnMvb3B0aWJvb3Qvb3B0aWJvb3RfYXRtZWdhMzI4LmhleDppIiAtVWxvY2s6dzoweDBGOm0K"
75 |  }

This is the Base64 encoding of the command:

"C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -patmega328p -cusbasp -Pusb "-Uflash:w:C:\Users\per\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5/bootloaders/optiboot/optiboot_atmega328.hex:i" -Ulock:w:0x0F:m

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
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Aug 7, 2022
@kittaakos kittaakos self-assigned this Aug 8, 2022
@per1234
Copy link
Contributor Author

per1234 commented Oct 12, 2022

An occurrence of the bug in the compilation output using 2.0.1-snapshot-bc264d1:

image

The miscolored output occurred after a long list (280 lines, 36835 characters) of warnings (which are expected to be on stderr). Before those warnings, the output contains mixed stdout and stderr content colored appropriately.

I didn't check the gRPC messages to see whether or not it is the same problem where the gRPC data is correctly classified, but incorrectly colored by the IDE.

The output is reproducible by compiling the "ArduinoIoTCloud-Advanced" example of the "ArduinoIoTCloud" library with verbose compilation output enabled and "Compiler warnings" preference set to "All".

The bug did not occur when I compiled the sketch again, even after clearing the library compilation cache to ensure the same warnings would be shown again (compiler warnings from cached code will not be shown since it isn't compiled).

@sterretjeToo
Copy link

Just to let you know that I encountered this issue today as well on 2.0.3; it confused the ... out of me so I can imagine what it does to a beginner when he/she sees the reported memory usage (AVR) displayed in red.

I know it's still open (and I haven't checked against nightly builds, no time at the moment).

@kittaakos kittaakos removed their assignment Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

3 participants