caveh@garfield.UUCP (Caveh Jalali) (10/30/85)
unofficial os9 bug report Theme: bugs in system calls Note: These bugs were discovered on os9 Level1 (CoCo) Bug #1: F$unlink does not behave properly when unlinking device descrip- tors, device drivers, and file managers. The problem is that these are IO type modules, therefore unlink calls i$iodel to re- move the resources associated with these devices if they are no longer needed. A pointer to the module to be unlinked is sup- posed to be passed to i$iodel in the X register, however, f$link uses the Y register instead. The consequences won't be noticed unless you try to unlink the aforementioned module types, and then probably only if they were loaded up manually. ie. if they weren't loaded as part of os9boot. I wish i could say the fix was as simple as changing a few values, but you really would have to disassemble os9p2 to make the changes, reassemble it, then rebuild the kernel on track 35. I have made too many changes to my kernel, so the only way i could post a patch would be to post complete sources to my ker- nel, but that isn't going to happen. Let's hope Microware is still listening to us... maybe they'll actually do something about this bug, as it's about a half hour's work if you have any form of assembler listings for os9p2. bug #2: F$chain does strange things if the argument list is in the module that is doing the f$chain. Picture this: Module A is running. A then does a f$chain, calling module B, with some argument to B located in module A. Now if A has a link count of 1, and was not loaded as part of os9boot, will be unlinked before B is loaded. Now, if B isn't already in memory, it will be loaded, which can be dangerous, as this may very well write over module A. As the argument to module B is still in Module A, it gets overwritten by B. I haven't had a good look at what is going on, but it seems to me that the solution is a matter of collecting the argument to the new program on the stack before it is loaded. Microware, please confirm that you have either already fixed these bugs, or are at least looking into them. caveh@garfield.uucp