Troubles with the floating point emulator

This page describes the rather significant problems that people have had with the floating point emulator, and why you should care. As of the 2.0.35 kernel series, you no longer need to worry about this issue, but there are still many NetWinders that are not updated to the 2.0.35 kernel (which was released 981211).

The problem

The important thing to know is that in the NetWinder's startup scripts, there is a line that says (something like) insmod -f fpem. This line will cause you lots of grief if you happen to have the old a.out version of insmod, and you decided to upgrade to then ELF version so that you can load all the fancy new modules.

What we recommend you do is to move the existing (a.out) version of insmod over to /lib/modules/misc since that is where the fpem.o module also resides. Then you can install the ELF insmod into the /sbin directory in place of the a.out version you just removed from there. (No, you can't just rename them because insmod is actually the same program as rmmod and it will have an "identity crisis" if you call it by any other name.)

Now for the really important part: you must find the place in your initialization files where fpem is loaded, and to change that line so that it uses /lib/modules/misc/insmod instead of simply calling insmod (which would get you the ELF version). The line you must change will normally be near the top of either the /etc/inittab or the /etc/rc.d/rc.sysinit files, just look for a line containing the word fpem and replace the call to insmod.

Why is this so important?

The NetWinder does not have a floating point co-processor. So it relies on software emulation, which is handled by (you guessed it) the fpem.o module. If this module doesn't load, the vast majority of programs will fail (anything linked against glibc, actually) when they attempt to do any floating-point operation. The usual symptom when this happens is that everything core dumps as you boot your machine up. Eventually you'll get a login prompt, only to have the machine dump core once again the moment you enter your login name.

The only way to rescue things is to boot via the network (which is a whole other topic) and to fix the bootup scripts as described above.

How could Corel let this happen?

It's a long story, and you really don't want to go there. But the good news is that thanks to the efforts of Scott Bambrough we now have our own fpem module, with the big difference being that we can compile it into the kernel so that it is always there. And suddenly the whole problem with insmod failing to load the fpem vanishes, or at least is greatly diminuished.

The first kernel that included Scott's floating point emulator was the one called vmlinux.rescue, released on Nov 6 1998 (see the pages on installing kernels for more information) and the emulator will be included in all future kernels.

We are currently aware of one security hole in Scott's emulator, by which a malicious use could gain access to data that should not be available. I don't know more details about it but I expect a patch to be available by the time the next kernel goes out. For all I know this bug might be present in the other fpem.o module too. Personally I'm not worried about it :)


Ralph Siemsen / ralphs@netwinder.org