out of index range bug in AosFATFiles ?
Hi There appears to be an error in index computation in AosFATFiles.Mod resulting in a negative idx in Procedure TailFinder: [1] TRAP 7 PL 3 index out of range Aos 18.8.06 CS:=0000001B DS:=00000020 ES:=00000020 SS:=0000002B CR0=80040031 FPU=00000000 EIP=011CB891 ESI=011C5BE8 EDI=8479F6C0 ESP=8479F6D0 CR2=8479DD9C PID=00000000 EAX=000022B9 EBX=011DAFB8 ECX=00000000 EDX=FFFFFFFC CR3=07FFE000 LCK=00000000 EBP=8479F6FC FS:=00000000 GS:=00000000 ERR=00000000 CR4=00000200 TMR=18479A53 EFLAGS: cPazStIdo iopl3 {1..2, 7, 9, 12..13} Process: 96 run 0 3 00EF0B70:WebHTTPServer.HTTPAgent AosATADisks.Interrupt.Wait pc=250 {} AosFATFiles.Directory.TailFinder pc=21001 p=00E04CC0H tail=0 @Self=011C5810H delta=10000 i=282 idx=-4 l=4 ofs=18 offset=-1110 rlow=1000 t=-110 State AosFATFiles: @Self=006B6C90H AosFATFiles.Directory.TailGeneration pc=21242 shortname="AMISA683XML" TailNeeded=TRUE @Self=011C5810H tp=00E04CC0H l=5 len=0 max=0 pos=0 tail=0 AosFATFiles.Directory.GetShortName pc=22359 name="AmisA683161929.xml"... shortname="AMISA683XML" checksum=00X @Self=011C5810H extPos=15 i=3 k=18 ascii="AMISA683161929.XML"... lossy=FALSE l=FALSE sameName=FALSE AosFATFiles.Directory.WriteFileHeaderX pc=24235 f=011C5230H @Self=011C5810H data="" b=FALSE ro=TRUE writeLast=TRUE ofs=105024 (00019A40H) i=0 k=0 len=3 numFree=3 s=0 ucs=0 unicode=0, 0, 0, 0, 0, 0, 0, 0... r=Rec.00000280H c=00X chksum=00X AosFATFiles.Directory.WriteFileHeader pc=23225 f=011C5230H @Self=011C5810H AosFATFiles.File.UpdateX pc=15051 @Self=011C5230H dir=011C5810H AosFATFiles.File.Register0 pc=14651 res=0 @Self=011C5230H dir=011C5810H old=00000000H s=00000000H Greetings Pat ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
An updated version of Bluebottle's FAT filesystem driver can be downloaded from http://aces.snu.ac.kr/~bernhard/bluebottle/AosFATFs.zip The index bug reported by Patrick a couple of days ago has been fixed. At the same location, a simple filesystem stress test module can be found http://aces.snu.ac.kr/~bernhard/bluebottle/FStress.zip Open the module source and scroll to the end of the file to see examples on how to use it. As for the error with duplicate filenames: I have not been able to reproduce it (FStress contains a command to trigger it, but it works fine for me). Maybe somebody who actually encounters the error can show me the source related to the FS handling that triggers the incorrect behavior. Note: I strongly advise against using thousands of files in one directory. VFAT, that is FAT with long file names, still uses the old 8.3 filenames for backwards compatibility. For each filename, AosFATFiles therefore has to generate an appropriate and unique 8.3 filename. FAT solves the problem by using "~x" suffixes, for example ThisIsALongFileName.Text ==> THISIS~1.TEX ThisIsAlsoALongFileName.Text ==> THISIS~2.TEX If you have many of those, you'll end up with something like ThisIsALongFileName7777.Text ==> TH~12345.TEX Whenever a 8.3 filename has to be generated, the FAT FS driver has to enumerate the whole directory, compare each files short name, extract the tail (the "~xxx" part), and remember that this tail number has been taken. After enumerating all files and extracting all relevant tails values, a free tail number is searched and the short name can be generated. Inevitably, the performance of this algorithm degrades quite much the more files you have in one directory. I used the FStress.Filename test on Bluebottle in VMWare to create 11'000 files in one directory. Below I list the time to create x files: Files Time (delta) Time/file [#] [s] [s] 100 1 0.01 1000 19 0.02 2000 82 0.08 3000 156 0.16 5000 412 0.21 10000 2188 0.44 11000 1046 1.05 --Bernhard PS: Bluebottle maintainers, please update the FAT driver in the release!
participants (2)
-
Bernhard Egger -
Patrick.Hunziker@unibas.ch