Obscure bug in FileCore
Jon Abbott (1421) 2651 posts |
I spotted this serendipitously when mistakenly trying to create a directory on a drive that was reporting “Bad free space in Map”. An Abort is triggered in FindErrBlock line 943 with R0=FFFFFFFE. R14 indicates it was called by OsFunEntry line 144 and that in turn was jumped too from line 70 when OSFunEntry was called with a bad Function number (FFFFFFFF it would seem.) I believe the issue is OSFunBack not setting R0 to a valid FileCore error number or valid error pointer before calling FindErrBlock. I’m not entirely sure how OSFunEntry was called with R0=-1 in the first place, so there’s possibly a further underlying issue. Repro (using RPCEmu) The Abort occurs after Partition Manager has called HDFFS_Remount and Dismounted/Remounted the drive. I don’t see the issue under RO 3.71 but do under RO 5.31 |
Jon Abbott (1421) 2651 posts |
The underlying trigger for the issue above is a “Bad free space map” error. Whilst investigating the cause of that, I’ve noticed the bad map problem starts somewhere between RO5.19 3rd Feb 2012 and RO5.19 9th May 2012. On the face of it, it looks like *Dismount is not completely flushing the map. Repro It is possible to avoid the Bad map error with the following workaround: Workaround There’s two FileCore commits between the two build dates: The first is the most likely candidate as it alters the way the map is read. As this hasn’t been noticed before, its possibly a bug in HDFFS or only HDFFS that’s affected due to FileCore re-entrancy. It possibly needs checking just in case it is a wider issue that’s gone unnoticed. |