identified one cause of data faults

Stefan Sperling stsp at stsp.in-berlin.de
Wed Jul 26 02:41:28 CEST 2006


Hello,

As you've probably read in a recent commit mail, the "data fault"
in dbclient came from the function __udivdi3 that was inserted
into the binary by gcc. Apparently the function does not run
on our arm CPU.

I have found out one situration where __udivdi3 is used.
It seems to be called for divide operations on unsigned
64bit integers (unsigned long long).

For example, this code:

        unsigned long long a, b;
        a = 12;
        b = 3;
        a /= b;

results in a call to __udivdi3 so if a program uses unsigned
64bit integers and does division on them it is very likely
to crash with a data fault.

The "slow" division function in dropbear that we are now using
uses 32bit ints, hence it does not crash.
The "fast" one we used to use uses unsigned 64 bit integers.

Just for the record.

-- 
stefan
http://stsp.in-berlin.de                                 PGP Key: 0xF59D25F0



More information about the dslinux-devel mailing list