- Status Closed
- Percent Complete
- Task Type Bugs
- Category
- Assigned To No-one
- Operating System
- Severity Low
- Priority Very Low
- Reported Version
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
FS#1481 - Possible bug in fat.c
I posted this to the mailing list for comment but got
no response, so I am turning it into an official bug
report.
At line 406 of fat.c, inside of function fat_mount()
is this bit of code :
/* calculate freecount if unset */
if ( fat_bpb.fsinfo.freecount == 0xffffffff )
{
fat_recalc_free();
}
There seems to be something wrong with calling
fat_recalc_free() from this point. When I modified the
if statement so that fat_recalc_free() was always
called, something is amiss.
When fat_recalc_free() gets called during the disk
mount at bootup, the lcd backlight goes off while the
fat recalc is taking place and then comes back on. I
have a long backlight timeout so it’s not the normal
backlight timeout.
When fat_recalc_free() is called during the disk mount
at the end of a USB session it’s even worse. Rockbox
crashes with the following display:
I04:IllInst
at 0002FDA0
Even in the case when it doesn’t crash, the fact that
the lcd backlight goes off and on indicates that
something isn’t right with either execution of this
function.
I know that fat_recalc_free() works when called from
other places because it works OK when it is called
from the debug menu and I also added a call to it from
elsewhere in the code that works OK.
I’m guessing that either this piece of code has never
been exercised and that for some reason there is a
problem with calling fat_recalc_free() from inside
fat_mount() (stack overflow maybe?), or possibly that
I have some strange timing issue with my hardware that
causes the buggy behavior only when called from this
one place in the code.
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task
The settings aren’t read from RTC/disk until after the disk
initialization, hence the short backlight timeout. The crash
when fat_mount() was called from the USB thread was a stack
overflow, as you suspected. I have fixed the crash in CVS,
but I’ll leave the backlight issue for now.