-
Notifications
You must be signed in to change notification settings - Fork 76
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
Code on external storage deleted in certain situations #24
Comments
Note: the app crash may well have been caused by outdated code, so I'm not so worried about that. The main issue to focus on is the code being deleted on compilation. |
I'm sorry that your code was deleted. This is a definitely a critical bug. Thank you for reporting it through a medium other than Google Play with sufficient detail so that I can actually figure out what is causing the problem. I am currently trying to reproduce the bug with the following steps:
Code:
I have not been able to reproduce it on my phone - an Galaxy S6 running 6.0 - but am currently trying other devices and emulator configurations. Can you possibly provide any more information about the bug? I understand that you don't want to reproduce this bug with your own sketches, but it would be greatly appreciated if you could try to reproduce it on new sketches (as I have done above) and after backing up your sketchbook folder. It may be the case the bug only occurs randomly or under certain conditions beyond those described above, meaning that I need to do more steps to reproduce it. |
I am unable to reproduce the bug on my ASUS Nexus 7 (2012) running Android 6.0. |
I am unable to reproduce this bug in emulators running Android 6.0, 5.0, or 4.4... I am beginning to think that there must be additional steps necessary to reproduce beyond the orientation changes and crash described above, especially considering that your device runs Android 6.0, which I have now tested three different times. Edit: I should probably mention @Techy4198 |
Here's another important question: Where do your store your sketches - on the internal storage or the external storage? You can see from Settings > General > Sketchbook Location. Edit: I am unable to reproduce the bug on my S6 with the sketchbook in either the internal or external storage. |
There was no exception in the console, probably because of the app rotating (that seems to clear the console - is that another bug?), so I have no idea what caused the crash unfortunately. The code did involve shaders though, and I have a large portion of the same code in another sketch. Once that sketch is in a state where it can hopefully be compiled, I'll upload it here. Sketches are stored on external storage, but I didn't get the "can't access external storage" issue that others are getting. |
Thank you. It does sound as though the console output being hidden after rotation is a bug. I am going to try looking into this as it may be connected to code-deletion bug. |
Another minor bug I noticed that I doubt needs its own report, there is no longer a 'Save sketch' button in the menu. |
I managed to catch the crash exception - it's just complaining about where I've been using size(). Interestingly though, now my phone is refusing to auto-rotate back to portrait after an app crash, making it difficult to know if this will reproduce it. |
The missing "Save Sketch" is intentional because the sketch saves automatically when APDE closes. However, it does seem that it could be useful in situations such as this... Interestingly, another review for v0.4.0 mentioned something about the size() function. I will look into this. |
I have successfully reproduced it with the attached sketch on external storage and orientation set to landscape, although it took about six tries and the results were different each time. |
Thank you! |
Does the sketch crash for you? It is not crashing on my phone. |
Hmm, strange. Maybe something weird happened when I installed 0.4.0 over the top of 0.3.3. Technically it should crash though, because I'm using displayWidth and displayHeight variables in size(), and the "no variables in size()" thing came to APDE with this update right? |
The "no variables in size()" error message shouldn't happen under these circumstances. It is normally called by the preprocessor, meaning it should report an error before the sketch is run, and displayWidth and displayHeight should be allowable variables in size() anyway. Perhaps there is an issue with the version of the Processing library. If there is such an issue with the version of the library, then that is likely a separate issue from the one causing the code to be deleted. Are you able to replicate the bug with the sample crashing code that I had above? If you can then these are definitely two separate issues and I think it is necessary to focus on the code-deleting bug first. If you can't then something really fishy is going on... |
Tried on a fresh install of the app and still doing the same, here is the console output:
|
Interesting. I don't know why it thinks that, but it is most likely caused by the update to Android mode packaged with v0.4.0. That should be separate from the code-deletion bug though. Are you able to reproduce the code-deletion bug with a stripped-down crashing sketch, such as the one that I included in my initial response to this thread? |
Yep, again took about five tries but it certainly happened. |
I thought that this might have something to do with the available memory so I tested it on an emulator with only 128MB of RAM but was still unable to reproduce. If I can't reproduce this then I may have to take some shots in the dark and ask you to test out a custom APK to see if they resolve the bug or not. |
I'd certainly be willing to do that if necessary, though I won't be available much tomorrow. |
I was just able to replicate the code deletion. It happened randomly and not as the result of a sketch crashing. I'm going to investigate further. |
Bear in mind that, on my end at least, the rotation thing increases the chance a lot. I feel like the conditions involve the way the app loads its previous state when rotating and when another app that was in front closes. Possibly something strange happening when the screen rotates while in the middle of loading a file, causing some background exception somewhere which nulls out the file? |
Did not mean to close, please ignore. |
Yes, that is very nearly exactly what I think is happening. When APDE is no longer in the foreground, the currently open files are saved to temporary storage. Then when the app is re-opened the files are loaded from temporary storage. This instance state change also occurs when the screen orientation changes, meaning that this process can occur twice when switching from an app with a different orientation - exactly as you describe. Problems arise when, for some reason, the state information isn't loaded correctly, resulting in empty files and all of the code being deleted. The code isn't actually deleted from disk, however, until you close APDE again, overwriting the existing files with the new empty ones. This means that, theoretically, you should be able to access your soon-to-be-deleted sketch files from your computer with a USB cable if you keep APDE open after experiencing the bug. That is, assuming that the deletion has not already occurred the first time that the state was restored (i.e. before the screen rotated back). An interesting consequence of this should be that not all of your tabs are actually deleted. APDE only stores the current tab and the two adjacent tabs in memory (one to the left and one to the right), and the rest of the tabs are unloaded. If you create four tabs, all containing code, and then reproduce the code deletion bug, then the one tab that was unloaded should still keep its code while the other tabs have their code deleted. How do I know this? APDE has had similar code-deletion issues before, but I thought that they had all been resolved in v0.2.3. Obviously this is not the case and the Material design changes have brought the bug back to light in all of its ugliness. Also, just because I roughly know the cause of the issue does not mean that I can solve it. I need to be able to replicate it consistently on my end in order to see if the changes that I am making have any effect. |
It happens on my phone when I use the PVector class objects. |
@StinkyVoid this shouldn't change based on what classes are used, but if it somehow does then it might reveal something new about the bug. Are you able to reproduce it clearing tabs when using PVector and not clearing them when not using it? |
Yes. For sure. But it isn't about some code vanishing. First my app said it
has stopped, then I downloaded APDE again from
https://www.dropbox.com/s/aurd10i2rage28u/APDE-bugfix-2017-12-08.apk?dl=0
to find out that the code worked properly. BUT sadly, my app works properly
only it back is pressed. Then it says that it has stopped unfortunately.
Now I stopped using PVectors.
…On Jan 11, 2018 3:09 PM, "1icri" ***@***.***> wrote:
@StinkyVoid <https://github.com/stinkyvoid> this shouldn't change based
on what classes are used, but if it somehow does then it might reveal
something new about the bug. Are you able to reproduce it clearing tabs
when using PVector and not clearing them when not using it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AfDeEpVLxAKAOVCWhOctEipOj9TZCKhFks5tJdbWgaJpZM4LkU6g>
.
|
@StinkyVoid I am confused by what you are describing. Did you mean to post this on #32 instead of here? |
No. It happens on my new phone and isn't #32 -ish at all. I just wanted to
help...
Now the thing is that, on Back Key, the program shows *unfortunately, xmpl
has stopped *when using PVectors.
…On Jan 11, 2018 7:15 PM, "William Smith" ***@***.***> wrote:
@StinkyVoid <https://github.com/stinkyvoid> I am confused by what you are
describing. Did you mean to post this on #32
<#32> instead of here?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AfDeEiSzLjquOndGN45Eev3_AIUxzzNiks5tJhBlgaJpZM4LkU6g>
.
|
So my understanding is that you are experiencing the following problems:
Do I understand you correctly? I am aware of a bug that causes static mode sketches (without Can you provide a minimal code sample that still reproduces the PVector problem you are describing? The sketch crashing shouldn't cause code to be deleted in the latest bugfix APK - if it is then something is going very wrong. Is this actually what you are experiencing? |
@StinkyVoid I forgot to @ mention you in my last comment. |
Hi, i had the same deletion issue happen to me either yesterday while quitting, or today while starting up. I "quit" by pressing the home button and "started" by selecting the app on the recent apps screen. Last thing i tried before quitting was compiling the sketch, which failed (had to leave so i put the phone away). |
@WGG25 Please try the bugfix APK. This should fix most, and hopefully all, code deletion bugs: https://www.dropbox.com/s/aurd10i2rage28u/APDE-bugfix-2017-12-08.apk?dl=0 Your storage location is labelled as "primary external" as opposed to the internal storage, which maps to APDE's private storage (in |
@william Smith
I am currently working with the budfix version.
I found another bug which can only be explained by screenshots.
…On Jan 12, 2018 10:57 PM, "William Smith" ***@***.***> wrote:
@WGG25 <https://github.com/wgg25> Please try the bugfix APK. This should
fix most, and hopefully all, code deletion bugs:
https://www.dropbox.com/s/aurd10i2rage28u/APDE-bugfix-2017-12-08.apk?dl=0
Your storage location is labelled as "primary external" as opposed to the
internal storage, which maps to APDE's private storage (in /data/data/).
The Android system provides APDE with the list of internal and external
storage drives. On the S5, the first external storage drive maps to the
public partition of what you refer to as the internal storage.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AfDeErh16Y1qi76oZ-RYIuTYadC7LDfSks5tJ5M-gaJpZM4LkU6g>
.
|
@Calsign Tried the version you linked, but it happened again. I was looking at references for processing so i switched apps, then i noticed a tab - that i haven't visited for a bit - was "gone" (contents deleted). |
@WGG25 Code being deleted in an unused tab sounds like a variation of the bug that I haven't seen before. The bug so far seems to deal with either all of the tabs or just the three tabs centered about the currently selected one. This might indicate that deletion of the current tab, but not that of other tabs, has been fixed, but it's a little early to speculate that far. It would be very useful if you could provide me with the debug logs for your code deletion. If you go to Settings > General and enable "Code Deletion Debug Logs", the debug logs will get saved to a file in the sketchbook. You need to reproduce the deletion again in order to record it in the log. The logs will be added to the end of the file each time you run the app. The timestamp is saved with the logs so please note at approximately what time you are able to reproduce the bug so that I can narrow down what could potentially be a very large file. You don't need to try to reproduce the bug but I would certainly be very grateful and I am unable to fix the bug without these debug logs. |
@StinkyVoid Do you have the screenshots for this bug? You can upload screenshots if you comment through the web page rather than through email. If this bug only exists in the bugfix version then it is reasonable to discuss it here for now, but if it can also be reproduced in v0.4.0 (currently released on Google Play) then you should make a separate issue. |
Wait a bit... I will soon send the screenshots. Currently I am on a serious
project on the normal version so I can't take any risk to install the APK
again.
…On Jan 19, 2018 3:44 AM, "William Smith" ***@***.***> wrote:
@StinkyVoid <https://github.com/stinkyvoid> Do you have the screenshots
for this bug? You can upload screenshots if you comment through the web
page rather than through email.
If this bug only exists in the bugfix version then it is reasonable to
discuss it here for now, but if it can also be reproduced in v0.4.0
(currently released on Google Play) then you should make a separate issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AfDeEpd4E5QNuvXKoC1oB6BpXvihOc3iks5tL8IogaJpZM4LkU6g>
.
|
Yeah, it's most likely that triple-tab-deletion issue, i had three tabs open, was working on the rightmost one and the middle tab was deleted. I might try reproducing it when i have time. |
Hi. |
Well, I think I have to apologize. I hadn't read all comments and saw right after writing my last comment that there was a fix. I work all day long with this app and I have to report that never again my code was deletted with the last fix. Also the console keeps its text after going from vertical to horizontal e viceverca. |
I can also confirm that I've not seen any more deletions. I also can't reproduce the issue via the method in #28. Even if it turns out to not be fully fixed but just extremely rare now, I think it's still ready for release. |
@1icri You are right, I need to push these changes to the main release channel. I should be able to do this next weekend. |
@1icri @nking07049925 @Friedolin2000 @ShreerangV @EmmanuelPil @WGG25 I have pushed v0.4.1-pre1 to the APDE Preview Channel, with all of the fixes so far: https://plus.google.com/communities/117703520591262292626 If you want to get this release, then please join the community above and click the link in the pinned comment. You could also wait until it gets rolled out to you, probably some time in the next week and a half, and then install from Google Play like normal. In addition to the code deletion bugfixes in the last Dropbox APK I posted above, I have re-implemented undo/redo history (it used to get deleted when you closed the app due to the bugfixes) and merged in several improvements from the master branch. If there are no major difficulties I will start rolling out the release to everyone this week. Thank you all for your help in debugging this issue so far. I know that there are still some rare instances of the code deletion occurring, but there are now mechanisms in place to (hopefully) prevent loss of data when this happens and tools for logging information that will be useful for debugging the code deletion when it does occur. |
I haven't gotten any reports of code deletion since the release of v0.4.1, and this is available to all users, not just the preview channel. I am assuming that the issue is fixed, but if any issues re-emerge then please re-open this issue. |
Good to hear. |
Confirming; working on daily basis did not have any issue with code deletion. |
Is this happening again in a new version? I don't see any actual reference to this in #49 though it did accidentally reference a lot of issue numbers in the log. |
(As of 0.4.0) I really don't know what happened here but I'm lucky to have tested on an older copy of a sketch first. The compilation process seemed to go okay without throwing any errors, but when trying to launch the app it crashes (the code was fully working in 0.3.3, besides I do a lot of my own exception handling in it). When it crashed back to APDE I was greeted with no code at all. It's not scrolled off screen, does not return after fully restarting the app. I have also checked the sketchbook in a file explorer and that file is zero bytes in size. I consider this to be a critical bug, although I'm not sure if it triggers every time (and am not really willing to find out as I have no backups). If it is relevant, the app would have been locked to landscape orientation, so APDE would have been loading and changing orientation at the same time.
The text was updated successfully, but these errors were encountered: