"ghost"-lines at the end of the sketch

Hi, i'am new in this forum.
But i have the following behavior with Arduino IDE 2.2.1 (also with other 2.x versions).

Yesterday, a sketch (1709 lines) gives no compilation error.

Today i compile the same sketch (with no change), i get error in the line 1726.
Line 1726 in a sketch with 1709 lines?

Scolling to the end of sketch:
I found out, there are 76 line copied and several empty lines are added at the end of the "original" sketch. The "new" sketch has now 1862 lines, but with only rubbish.

I delete these lines (so my sketch has the original 1709line, store this sketch and ...
... when i open it in IDE, there is the same: the same copied and added lines at the end of the sketch?

Has someone same behavior with Arduino IDE?
How can i solve this (in best case without new installation ...) ?

Thanks for help and info

BR Carsten

Welcome to the forum

I have not seen this behaviour nor do I recall having seen it reported before, but it may well have been. However, I cannot find it in the list of IDE issues Issues · arduino/arduino-ide · GitHub

@ptillisch

Which Operating System are you using ?

Personally I would simply uninstall the IDE and install it again

additional Info:

on other PC, i have IDE1.8.x, here i could open and delete the "too much" lines, and store this sketch
(now 104kB instead of 106 bevor delating the lines).

and now, also in IDE2.2.1 the sketch is also ok and with no compilation error

but the question is: who add the lines in the sketch?

both pc are win10Pro

You by mistake / bug in the IDE / your Windows is hacked / can't come up with more suggestions....

1 Like
  1. addtitional test:

i delete nearly 300 lines with comments at the beginning of the sketch (only release-infos).
So then last line is now 1428,

i store the file: i has the same 104kB , i wonder why?

So i open it, and the last line is know: 1961
The lines after the "original last" line at 1428 until the line 1961 is a copy of the last 533 lines.

I can reproduce this behavior.

You went this road yet?

If the mysterious behavior is still present, we need @ptillisch here, he can help you to log this in depth for the Arduino 2.x team to look at.

I uninstalled and reinstalled IDE 2 multiple times before it was released as new versions became available

Why are you reluctant to do it ?
I assume that you have backups of your system

No, not yet, but will do it as next step.

If i see the same behavior after new install, i will answer here.

ok, last test i do for this:

i store the sketch normaly on my NAS-Server
there is the behavior that the sketch becomes bigger when storing

now i test with storing on local path: and no problem with additional line in the sketch

is there a limitation for using network-storage with IDE 2.x, because i didn't recognize this with 1.8.x?

my solution: working on sketch on local drive an then copying them to NAS for Backup
(not fine by helpful :wink: )

BR Carsten

Ah yes, there's some issues with Onedrive as well, there are many threads here that involves Onedrive. It's not farfetched to conclude local filesharing can have issues too.

Edit: Good troubleshooting there. :+1:

1 Like

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