C_Lib 32bit
Pages: 1 2
Rick Murray (539) 13840 posts |
Is this idea to be followed for every bug fix that may break programs that make assumptions based upon incorrect behaviour? Remember – not so long ago we were talking about the side effects of fixing a time bug.
There used to be such a thing as not depending upon behaviour either known to be incorrect or otherwise undocumented (as it’ll bite you in the end…). |
Rick Murray (539) 13840 posts |
Of course, given our unique situation of using old software; it may be worth making special provisions if circumstances demand it. So… Where d’you draw the line? |
Colin (478) 2433 posts |
I like the idea – fixes my problem without me having to get a swi chunk for my own personal use. Hopefully clib is now completely bug free and we won’t have this problem again. |
Steve Fryatt (216) 2105 posts |
Unplugging the ROM version could be a bad idea. I can’t remember if any ROM clients of the library are statically linked, or whether they register each time the machine boots, but unplugging the SCL could do bad things to your OS.
How would that work if I need the fixed version on RISC OS 4, 5 and 6 then?
Really? Anything in C that isn’t statically linked to UnixLib will use the SCL, and other things could too since the API is language-independent.
Er, no. It doesn’t work like that. Apps which register with the SCL are given a jump table into routines contained in the module’s code space. That’s it. While the ROM’s library is active, those jumps are into ROM. When you load your first copy of the library from disc into RAM, anything that’s registered with the ROM library up to that point is OK as the routines in ROM remain where they always were. Anything registering after that point gets pointers into the RAM copy of the SCL. Thus you can softload one copy OK. If you softload another copy, it replaces the previous RAM copy and almost certainly moves in memory. Thus anything that has previously registered with the RAM copy now has a jump table into nowhere and things unravel quite quickly. You could have two copies of the module with different names, but that sounds like a sledgehammer approach to the problem of some buggy software. |
Steve Fryatt (216) 2105 posts |
…and…
The trouble is, this isn’t just a RISC OS library in isolation: it’s a standard C library that’s standard across platforms. Stuff ported from other platforms (which is becoming more common now as we find ways to do more with fewer people) expects the calls within it to work in a standard way. The options seem to be to fix the SCL and fix buggy RISC OS software once, or not fix it and fix ported software every time the code it’s based on is updated. |
Steve Fryatt (216) 2105 posts |
Just so that people are aware of all the pitfalls, note that newer libraries don’t just fix bugs: they also add new features. The big one was C99 support; there might be others. New software is likely to expect that these facilities will be available from the default library that is loaded (and not one with a different name). |
Pages: 1 2