-
Notifications
You must be signed in to change notification settings - Fork 802
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
assert block != LFS_BLOCK_NULL in lfs_bd_read failing in lfs_ctz_traverse #295
Comments
I have a very similar issue. |
I get the same assertion at lfs_bd_read : LFS_ASSERT(block != LFS_BLOCK_NULL); but with a different call. It just happens some times when my system reboots and inspect a file directory after mounting the file system without problem: lfs_bd_read (ASSERT) Once I get the assertion and my system reboots, I don't get the problem anymore. I will update this message with the value of block, as I can't intentionally reproduce the failure as it happens just some times after booting (with a previous use of creation/deletion of files regularly) |
I am going to test it, I will post again with more info then, thank u Ralim for referencing it. EDIT: |
Hi guys, thanks for creating an issue. Some notes on this: This assertion is the same as Both Unfortunately this is sort of like a hard fault, there's not much info to go on without more context. This stack trace should help quite a bit, and if you are able to get a filesystem dump that would help. Especially if you're able to consistently trigger the assertion through mounting the same image. It's also entirely possible your issues are unrelated even though you're both hitting the same assert. |
Hi all, an update. These asserts are unfortunately very generic, and power-loss bug require the entire of the filesystem work correctly, so they can be difficult to track down. My current plan is to take a step-back and rework the testing infrastructure to more aggressively cover these sort of power-resilience bugs. Once that is in place, it should be much easier to build reproducible test cases and work through these sort of bugs. Hopefully most of the bugs will just fall out with the additional coverage. Anyways, sorry I don't have much immediate help. I just wanted to give an update so you all know these issues aren't being ignored. All of these issues are valuable, I've just had to prioritize issues based on the time I have. |
Thank you for your help! I understand that it is a very generic (and hard to reproduce as it is the case in my environment). thanks a lot again for your work. |
@raulmcriado have you invoked lfs_rename in your code, i have reproduce the assertion, it's caused by lfs_rename, see 343 |
Ok, sorry about the wait. I think I've been able to hammer out most of the LFS_ASSERT(block != LFS_BLOCK_NULL) issues. The fixes should be on this branch: #372, which I will be working on merging. If you all find cases where littlefs is still failing, please let me know. The benefit of the wait is that the testing framework on that branch is now quite a bit more powerful, so I should be better prepared to find these sort of power-loss bugs. |
Very impressed with the new testing framework. I'll be keen to deploy this to a few test units to see if it performs better :) Will let you know if I run into any more issues. Currently also chasing winbond nand failing in odd ways 😢 |
Hi,
Currently working on getting Littlefs running on a NAND flash.
The flash is 256MB, with erase pages of 128K and and read/write sizes of 2048 bytes.
Running into an issue, were after a long running series of reads and writes to the flash, something is becoming unhappy and the assert here is failing.
When this assert fails, this is the current call stack:
Looking in
lfs_ctz_traverse
, at the time of the read call before the one that fails the assert, the read is from block 1820 (head
), and the result that is read into the buffer is all 0xFF (validated read is correct by manually reading this block as well).Any ideas on what could have lead to this?
This appears to be showing up on all units after a decent number of file actions, (around 100 files created and then deleted). Files are mix of small (2k) and large (25MB).
I can look into dumping the entire flash memory out if that would be of use?
This is the config structure:
The text was updated successfully, but these errors were encountered: