Skip to content

IDE hangs during "Save As..." operation #922

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

Open
3 tasks done
per1234 opened this issue Mar 20, 2022 · 9 comments
Open
3 tasks done

IDE hangs during "Save As..." operation #922

per1234 opened this issue Mar 20, 2022 · 9 comments
Assignees
Labels
criticality: highest Of highest impact topic: code Related to content of the project itself topic: language server Related to the Arduino Language Server type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Mar 20, 2022

Describe the problem

The IDE hangs permanently during the "Save As..." operation under the following conditions:

  • IDE was last shut down via "File > Quit"
  • Currently selected board is from a different platform than the one selected in the previous window
  • The language server "indexing" process is in progress

To reproduce

  1. Start the Arduino IDE.
  2. Select File > Quit from the Arduino IDE menus.
    ❗ This exact shutdown method is required. The bug does not occur after shutting the IDE down via File > Close or the native window close control on the title bar (i.e., X or 🔴).
  3. Start the Arduino IDE.
  4. Select File > New from the Arduino IDE menus.
  5. Select a board of a different platform from the Tools > Board menu in the Arduino IDE.
    e.g., if you originally had "Arduino Uno" ("Arduino AVR Boards" platform) selected, you could select "Arduino Nano 33 BLE" ("Arduino Mbed OS Nano Boards" platform).
    ❗ The issue is timing sensitive, so you will have a short time window if selecting a board from a lightweight platform such as "Arduino AVR Boards". The boards of any of the "Arduino Mbed OS ____ Boards" platforms are recommended as these provide a large window.
  6. Immediately select File > Save As... from the Arduino IDE menus.
  7. Immediately click the Save button.
    ❗ This must be done while the IDE is still in the state where it shows something like "indexing 42/188" at the left side of the status bar.

🐛 The IDE hangs forever in the state where the window title is "index.html" and contains spinning dots:

image

Expected behavior

The sketch that was produced by the "Save As..." operation is loaded in the Arduino IDE.

Arduino IDE version

2.0.0-rc5-snapshot-f36df02 Date: 2022-03-17T10:22:00.589Z

Operating system

Windows

Operating system version

10

Additional context

The first version I can reproduce this fault with is e6b9d4e. I can not reproduce the fault with 69ac1f4.

The "Save As..." process stopped working correctly at 112153f (#829), so it is possible that the bug was introduced somewhere between 69ac1f4 and e6b9d4e but was not visible due to #829


I see the following output printed on the command line after I do a File > Quit:

root ERROR Uncaught Exception:
root ERROR Error: Connection got disposed.
    at Object.dispose (C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-jsonrpc\lib\main.js:904:25)
    at C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-ws-jsonrpc\lib\socket\connection.js:14:41
    at CallbackList.invoke (C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-jsonrpc\lib\events.js:62:39)
    at Emitter.fire (C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-jsonrpc\lib\events.js:121:36)
    at closeHandler (C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-jsonrpc\lib\main.js:240:26)
    at CallbackList.invoke (C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-jsonrpc\lib\events.js:62:39)
    at Emitter.fire (C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-jsonrpc\lib\events.js:121:36)
    at WebSocketMessageReader.fireClose (C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-jsonrpc\lib\messageReader.js:111:27)
    at WebSocketMessageReader.fireClose (C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-ws-jsonrpc\lib\socket\reader.js:67:19)
    at C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-ws-jsonrpc\lib\socket\reader.js:24:18

I see the same output printed multiple times after the fault occurs.


I suspect it is related to #657


I was only able to reproduce the fault by saving during the language server "indexing" operation triggered by the board selection. The fault did not occur for me when saving during subsequent indexing operation triggered by editing the sketch.


I was not able to reproduce the issue with the "Arduino > Language: Log" setting enabled.


Originally reported at:


Some of the user reports did not match the specific procedure for reproduction I described above, and I have also encountered it occasionally under other conditions.

I believe that the fault can be triggered in other ways, but I wanted to provide a procedure that consistently reproduces the issue and this was the one I happened to discover.

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 topic: language server Related to the Arduino Language Server labels Mar 20, 2022
@fstasi fstasi added the criticality: highest Of highest impact label Mar 24, 2022
@fstasi fstasi added this to the arduino-ide rc6 milestone Mar 24, 2022
@xinkiknix
Copy link

I get this issue (IDE2.0.0-rc6) when creating a new sketch while another one is open. When saving the new one the IDE never returns to working state for the new sketch, the older sketch is still working ok.

@ubidefeo
Copy link

ubidefeo commented May 4, 2022

@xinkiknix

very useful information, it helps digging into it.
Thank you

@kittaakos kittaakos assigned kittaakos and unassigned msujew Jun 3, 2022
@kittaakos
Copy link
Contributor

Excellent job on the step. I could reproduce the bug on my slower Windows machine.

I do not know if it's related, but when I try to open the dev tools in the windows with the spinner, I see such warnings in the logs. I do not know yet if it's related:

Attempting to call a function in a renderer window that has been closed or released.
Function provided here: bundle.js:2:1080768
Attempting to call a function in a renderer window that has been closed or released.
Function provided here: bundle.js:2:1080768
Attempting to call a function in a renderer window that has been closed or released.
Function provided here: bundle.js:2:1080768
Attempting to call a function in a renderer window that has been closed or released.
Function provided here: bundle.js:2:1080768

@per1234 per1234 self-assigned this Jun 9, 2022
@per1234
Copy link
Contributor Author

per1234 commented Jun 11, 2022

I am not able to reproduce this by following the procedure I described above using Arduino IDE 2.0.0-rc7. However, that result is meaningless because I am also no longer able to reproduce it using the 2.0.0-rc5-snapshot-f36df02 build I was using when I submitted this issue. This means something has changed in the environment the IDE runs in on my machine.

The issue was always somewhat intermittent, but I was able to reproduce it >50% of the time, and have done so occasionally with later versions of the IDE, in addition to running into the problem incidentally. However, I have made quite a bit of effort to reproduce it without any luck so I am not in a good position for further investigation or testing.

I do believe the issue still occurs in 2.0.0-rc7 because there is a report of it here:

https://forum.arduino.cc/t/high-contrast-theia-theme-changed-and-other-issues/1001842/10

I getting a lot of white screens that that just rotate a circle of blue balls,
This is occuring quite often when using save file as....
The header [top screen] has small arduin img followed by index.html
the line below it has file edit sketch tools help......

If anyone finds a procedure that can be followed to reliably reproduce the issue, please provide detailed instructions here. That would be very valuable in any efforts to fix this.


UPDATE: additional reports of the hang occurring with recent versions:

@ubidefeo
Copy link

@per1234 @kittaakos
is this still an issue?

@per1234
Copy link
Contributor Author

per1234 commented Jun 13, 2022

It appear the answer is yes. Please see my previous comment for everything I know about the current status.

@ednieuw
Copy link

ednieuw commented Jun 20, 2022

I had the same problem with rc7 on a w11 pc. I opened a sketch in a subfolder in a folder name Arduino in a folder named Files in The default windows Documents. After entering the new name of the sketch and Enter the program locked with the blue wait circle. The sketch was not saved in the subfolder as expected but in the Documents/Files/Arduino folder as set as default folder in Preferences.
Maybe the file name including the folder names exceeds 128 or so characters?

@xinkiknix
Copy link

yesterday (rc7) I had an issue with IDE, I had 2 instances open with the same name, showing the directory name in tha Tab.
image
ptillisch sugested to "View: Reset Workbench Layout" . I executed the command and go the blank screen with :
image
I had to restart the IDE to get back to normal situation. Changes where saved.

@fstasi fstasi removed this from the arduino-ide rc6 milestone Jun 21, 2022
@davegarthsimpson davegarthsimpson self-assigned this Jul 6, 2022
@per1234 per1234 removed their assignment Sep 2, 2022
@Dracwula
Copy link

Reproduceable steps under IDE 2.0.3

  1. Create a new sketch called "ABC", and [SAVE]
  2. Optionally, Edit or Reload this same sketch ABC and [SAVE AS] new sketch name "XYZ"
  3. I think here at this point, it will open a new IDE app instance, notice the duplicated TAB XYZ, the internal contents are identical.

To eliminate the duplication tab under IDE 2.0.3

  1. Close IDE that has XYZ sketch open
  2. Go into where "XYZ.ino" is located via Windows Explorer
  3. Rename XYZ as "XYZ-2.ino"
  4. Double-click "XYZ-2.ino" from here, IDE will open and prompt you with new folder name to match "XYZ-2", [Confirm] it, this will eliminate the duplication tab under IDE 2.0.3

This maybe a quick & dirty method to eliminate the duplicate sketch tabs, unless someone can provide better solution.

@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
criticality: highest Of highest impact topic: code Related to content of the project itself topic: language server Related to the Arduino Language Server type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

10 participants