Sketch corruption in the IDE Editor

Spontaneously, I get files with the [conflicted] suffix for no apparent valid reason. The file name is valid and there no issues with it. At the same time - my sketch gets corrupted - usually a few lines at end of the sketch, but occasionally I can also get junk added in the middle of the file.

The workaround is to copy the displayed file to the clipboard (which is usually correct), delete the conflict file restart, the ide and fix the corruption using the clipboard version as comparison. The file then compiles and I can continue on for a short time (30 minutes? an hour?) until the problem occurs again. I can find no common action that causes this - it "seems" to happen spontaneously.

I am using the 2.3.2 appImage on the latest MX Linux, and have tried the latest nightly fix with no success. The sketch on is the large size (1577 lines - 52kb file size).

Any suggestions?

SSD/Hard drive malfunction.

Unlikely to be hardware. Laptop passes all tests, is used extensively and heavily everyday - virtual box for windows, lots of multimedia etc, without any problems. If I had to guess, as it happens spontaneously, maybe a timed or asynchronous action (daemon?), like an autosave happening in the background (pure guesswork - no evidence yet). It consistently generates the [conflicted] file error, further suggesting hardware error unlikely.

You could have lead with your explanation... anything else missing? Are you using PlatformIO?

Screen Shot 2019-06-22 at 12.59.57 pm

2.3.2 a clue? No - not Platform IO - Arduino 2.3,2 base, and the latest nightly build. using esp8266 (wemos mini pro), ssd1306 and sht31 and libraries. Nothing fancy or unusual. No extensions etc. Have many variations of sensors and displays. behaviour is IDE related. Have used large sketches before with 1.x, but never had problems like this previously.

Hi @pcumberworth.

Please provide the non-corrupted sketch in a reply here on the forum thread. I'll see if I am able to reproduce the problem on my computer. If so, that will greatly facilitate the investigation and resolution.

In case the sketch is longer than the forum software will allow to be added to a post, you can instead attach the file(s) to a reply here:

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a forum reply here by clicking the "Reply" button.
  5. Click the "Upload" icon (Upload icon) on the post composer toolbar:
    Upload icon on toolbar
    The "Open" dialog will open.
  6. Select the .txt file you saved from the "Open" dialog.
  7. Click the "Open" button.
    The dialog will close.
  8. Click the "Reply" button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.


We did receive a report about some sort of corruption of large sketches:

https://github.com/arduino/arduino-ide/issues/1614#issuecomment-1301668189

(note that the corruption problem is reported tangentially in that comment and is completely unrelated to the original subject of the issue, which is only about the IDE's syntax highlighting being disabled when a sketch contains an extremely long line)

Unfortunately the person who reported that problem didn't provide us with enough information to reproduce the fault so it was not possible to do any investigation.

Please excuse the delay. As Murphy would have it, I have had no problems since lodging the fault, and the sketch has grown in size :frowning: When it happens next I will do some screen grabs of the errors, and bundle it all up for you. On closer view, it does seem to occur when the autosave function is operates.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.