-
Notifications
You must be signed in to change notification settings - Fork 1.3k
File system problems and soft reboot hanging #1643
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
Comments
This sounds familiar. may be linked to #1627. |
Does sound similar but you mention "virtual drive fills up" in the ticket's title. I think people will read that as problems occur if and only if the In my case I don't believe disk fills were part of cause as I have a lot of spare space on CPX. I have been doing a certain amout of power off / power on and have not been diligent about unmounting the file system. I've caused a mess with Windows delayed writes in the past (https://forums.adafruit.com/viewtopic.php?f=52&t=125927 and #111 ) but that wasn't as bad or as weird as the mess I had the other day. |
Some additional observations: |
I can confirm I saw something similar to what @jerryneedell saw. Not sure if it was on a CPX or a Metro M4 (I was using both today). I had just plugged it in. |
I also saw something similar; I believe it was on my feather m4. I'll do some more testing this weekend. |
@kevinjwalters What I wanted to say is, the fuller the drive gets, the more likely those errors appear. |
@kevinjwalters What I wanted to say is, the fuller the drive gets, the more likely those errors appear. To repeat this behaviour:
|
Based on @uhrheber comments it suggests the file system code is one canidate here, has it changed? Also interesting to note that it doesn't appear to depend on what the application is doing as such a trivial tiny Does the whole code base go through static code/dynamic analysis checks for buffer overflows and the like? I'm just wondering if this could be some bug that's been around for a while but one hasn't trashed anything important in the past. I've been problem free over last few days on |
I tested all official releases since 4.0.0 Beta 1, and they all behave like that. The thing is, it's somewhat of a hit and miss, I have one pca10059 dongle, that I use as a USB password typer, and it uses both the USB HID and the TouchIO library. It was originally on Beta 1, and I later updated it to Beta 2. I'm using it on my PC since about 2 months, plugging it several times a day, and it runs rock stable. When I put code on this very stick, that uses BLE, the drive gets wiped after a few plug cycles. Weird. |
@uhrheber Thanks for that observation. That's interesting, because it's on nrf as well as atmel-samd, and, because BLE does tasks at a higher priority than anything else. The combination suggests that the problem may be in the common code, not the chip-specific code, and that it's some kind of timing or interrupt problem. |
If you want to test it yourself, here's my code (needs the libs adafruit_ble and adafruit_bluefruit_connect).
|
What I also observed: |
Another observation: |
An observation I’ve noticed that may or may not be related is sometimes just going into a folder in finder causes the PyPortal to reset. I’ve not had corruption yet. I had noticed similar symptoms on other boards previously, but it seems to be fine now. I’ve only noticed this lately on PyPortal. |
In the #1639 comments there's mention of a change in a USB library for 4.x. Could that be doing something different at soft reboot time compared to the previous releases? Given that writing files to the CPX triggers automatic reboots if that new USB stack does something different which ends up preventing the final writes (#111) to the file system from being applied that might explain this? |
Yes, this is definitely the kind of thing we'd be looking at, but also whether filesystem operations before that were not completed or were incorrect. |
I'm definitely noticing File System problems much more on a Feather M4 Express with CircuitPython 4.0-Beta4. The RGB LED goes red and it can't read files. Resetting puts it in safe mode. I had a file disappear as well and had to recopy. |
On my feather_nrf52840_express with beta4 doing a Soft Reboot after copying a file to the board results in a disconnect of the screen session followed by a boot to safe mode (HardFaultHandler). This is reproducible: If I instead always Eject the CIRCUITPY Drive and then RESET the board - is seems to be OK |
I have reproduced @jerryneedell 's crash on Feather 840 with a simple main.py just printing out something every second, and then I do Stack is messed up:
|
Scenario is:
Sorry for the blow-by-blow, but I might not be able to finish the debugging session, and want to record what I found so far. |
I was using a variant of CircuitPython 4.0.0 beta 3 (
4.0.0-beta.3-25-g2169a6240-dirty
) which initially looked good and then started seriously misbehaving with a lot of things disappearing from the file system and it failing to soft reboot, i.e. control-D from the REPL over serial over USB.The first thing I noticed from a Win8.1 host was that the application on the Circuit Playground Express board I was using (it reads MIDI over USB and changes PWMOut properties) which had worked earlier no longer worked. I then wanted to check its health so tried to connect over
COM9
but surprisingly that would not let me connect. I thought I'd check theCIRCUITPY
drive associated with it and that was misbehaving too.The following is from my notes which I initially put into comments in #1626.
The drive (on Windows) was no longer showing up with the typical spaced used but just marked as
FAT
and opening it in explorer showed it as empty. It responded to reset button but that's left me with anCIRCUITPY
drive that's missing my code! I've only got some wavs, aREADME
,.fseventsd
and.Trashes
. I did a power cycle and file system still looks the same, no sign of my code.py or massivelib
directory etc.I think we can rule out user error here because the whole
lib
directory has gone AWOL and that takes ages to delete so I would have noticed if I'd done this accidentally.After that the wavs disappeared and a
.metadata_never_index
has appeared. (Minor chance this is related to Patch Tuesday but that's even more frightening.)My boot_out currently has the contents:
but earlier it had a large hex number with some hypens with braces on either end.
I've also noted that if i leave the CPX doing not much in REPL (I had a for loop printing the time every 10 seconds) then if I control-c that ten minute later then control-D for a soft reset the soft reset doesn't complete.
On going back to 4.0.0 beta 3, this popped out on the serial console (over USB):
boot_out currently contains:
and has a date of 1-Jan-2000 which is a bit odd (date may not be off, these things dont have battery backed clocks on them, of course). I'm going to storage.erase_filesystem() to ensure I've got a clean slate.
The text was updated successfully, but these errors were encountered: