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
nrf52840 feather: crash on file write #2338
Comments
@tannewt I'm happy to work on this but I'll need a little guidance on what angle you'd like me to look at it from. I viewed it as a problem with being able to reenter the filesystem code at a time when it's apparently not fully initialized(?) and tried to address it in #2319 but I totally get your urge to do more analysis before adding a band-aid fix. |
This is a really interesting backtrace because it is a mass storage write ( On SAMD we don't have this issue because Another solution I can think of is to add a lock around the flash cache that allows you to "flush, release cache, create heap" atomically so that there is always a place to put the cache. A simpler form of this would be to never release a supervisor allocated cache once it is created and just place the heap after it. This means we'd take 4k up forever more even off usb but that is likely ok. The only case we'd need to worry about then is freeing a VM allocated cache in favor of a supervisor allocated one. Those are some options. Let me know if they make sense. Thanks! |
It's extremely dubious that we have these handles that we think are to GC'd memory at a time when the gc pool may not be initialized. Hopefully, they WERE valid GC memory and are undisturbed by the teardown of the interpreter that can lead to this state. In this case, don't try to m_free them, the memory will become free when the GC heap is reinitialized. Closes: adafruit#2338 (together with previous commit)
When writing to CIRCUITPYTHON, especially with dd, a reset-to-safe-mode event can occur. When it does, the stack looks like this:
How to reproduce: **with the board sitting at
Press any key to enter the REPL. Use CTRL-D to reload
, bulk copy some data to flash:dd if=/dev/zero bs=512 count=200 of=zero
The status LED will change to yellow and USB connectivity will stop until you reset the board.
The text was updated successfully, but these errors were encountered: