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

Canceling compilation or upload doesn't kill tool process #2517

Open
3 tasks done
per1234 opened this issue Sep 26, 2024 · 0 comments
Open
3 tasks done

Canceling compilation or upload doesn't kill tool process #2517

per1234 opened this issue Sep 26, 2024 · 0 comments
Assignees
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 Sep 26, 2024

Describe the problem

When a compile, upload, or burn bootloader operation is triggered by the Arduino IDE user, command line tool(s) (e.g., avr-gcc, AVRDUDE) are invoked. It is these tools that actually perform the compilation, upload, or burn the bootloader.

A "CANCEL" button was added to the compile, upload, and burn bootloader progress notifications (#2334 / 2a325a5). Clicking this button cancels the operation in the Arduino IDE GUI, but doesn't kill the tool process. The tool process continues to run just as it would have done if the button had not been pressed

🐛 The button is misleading, since the user is sure to have the reasonable expectation that the tool process will be canceled.
🐛 This can cause very confusing problems when the user triggers a new operation and it has a collision with the process that was still running from the canceled operation. Normally the existence and status of an ongoing process would be communicated to the user via the Arduino IDE UI, but after using the "cancel" feature, there is no such communication. So it will be difficult for the user (and those who support their report) to understand why this is happening.

To reproduce

Equipment

  • Any board or other hardware that produces a serial port.

Demo

  1. Select File > New Sketch from the Arduino IDE menus.
  2. Select the port from Arduino IDE's Tools > Port menu.
  3. Select Tools > Board > Arduino AVR Boards > Arduino Duemilanove or Diecimila from the Arduino IDE menus.
    This board was chosen arbitrarily as one that is installed by default and likely to produce a relatively long duration upload process (in order to ensure it will still be running when the second upload is triggered). But the fault is not limited to this board.
  4. Select Sketch > Upload from the Arduino IDE menus.
  5. Wait for the "Uploading..." notification to appear.
  6. Click the "CANCEL" button in the notification.
  7. Select Sketch > Upload from the Arduino IDE menus.

🐛 The upload fails with an unexpected "Access is denied." error. The reason is that the avrdude process from the first upload operation that was triggered at step (4) was still running, even though that operation was canceled.

Expected behavior

The process is killed when the "CANCEL" button is clicked.

- OR -

If it is not possible to kill the process, then remove the misleading "CANCEL" button.

Arduino IDE version

2.3.3

Operating system

  • Linux
  • Windows

Operating system version

  • Ubuntu 24.04
  • Windows 11

Additional context

I used the collision of port usage in the demo as a simple and dramatic way to show that the avrdude process from the "canceled" upload was still running. However, you can also use a tool such as ps -e on POSIX systems or Windows Task Manager to verify that the process continues running even after the operation is canceled.


Related: #1199

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 Sep 26, 2024
@giacomocusinato giacomocusinato self-assigned this Sep 27, 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

2 participants