[linux-cirrus] Re: Yet another MaverickCrunch hardware bug?

  • From: Ryan Mallon <ryan@xxxxxxxxxxxxxxxx>
  • To: linux-cirrus@xxxxxxxxxxxxx
  • Date: Mon, 16 Feb 2009 14:04:47 +1300

Martin Guy wrote:
> On 2/15/09, Ryan Mallon <ryan@xxxxxxxxxxxxxxxx> wrote:
>>  When I run the binary, I consistently get a crash on an illegal
>>  instruction. Running in gdb I get:
>>
>>  (gdb) r
>>  Starting program: /paranoia
>>
>>  Program received signal SIGILL, Illegal instruction.
>>  0x0000950c in main ()
> 
> That's strange. 950c is the first Maverick insn in the binary,
> 
> $ objdump -d -z paranaoia2-crunch-ieee-O2 | less
> ...
> 00009508 <main>:
>     9508:       e92d4ff0        push    {r4, r5, r6, r7, r8, r9, sl, fp, lr}
>     950c:       ed6df402        cfstrd  mvd15, [sp, #-8]!
>     9510:       e1a00000        nop                     (mov r0,r0)
> 
> Is the Maverick enabled in your kernel?

Oops. It is now :-).

Running multiple times does cause different output/errors. I only get
segfaults and illegal instructions though. I also have the changing
binary problem.

Interestingly, after running several times I start getting the same
output repeatedly, where it dies on an illegal instruction. Full output
is below:

 (gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /paranoia
Lest this program stop prematurely, i.e. before displaying

    `END OF TEST',

try to persuade the computer NOT to terminate execution when an
error like Over/Underflow or Division by Zero occurs, but rather
to persevere with a surrogate value after, perhaps, displaying some
warning.  If persuasion avails naught, don't despair but run this
program anyway to see how many milestones it passes, and then
amend it to make further progress.

Answer questions with Y, y, N or n (unless otherwise indicated).


Diagnosis resumes after milestone Number 0          Page: 1

Users are invited to help debug and augment this program so it will
cope with unanticipated and newly uncovered arithmetic pathologies.

Please send suggestions and interesting results to
        Richard Karpinski
        Computer Center U-76
        University of California
        San Francisco, CA 94143-0704, USA

In doing so, please include the following information:
        Precision:      double;
        Version:        10 February 1989;
        Computer:

        Compiler:

        Optimization level:

        Other relevant compiler options:

Diagnosis resumes after milestone Number 1          Page: 2

Running this program should reveal these characteristics:
     Radix = 1, 2, 4, 8, 10, 16, 100, 256 ...
     Precision = number of significant digits carried.
     U2 = Radix/Radix^Precision = One Ulp
        (OneUlpnit in the Last Place) of 1.000xxx .
     U1 = 1/Radix^Precision = One Ulp of numbers a little less than 1.0 .
     Adequacy of guard digits for Mult., Div. and Subt.
     Whether arithmetic is chopped, correctly rounded, or something else
        for Mult., Div., Add/Subt. and Sqrt.
     Whether a Sticky Bit used correctly for rounding.
     UnderflowThreshold = an underflow threshold.
     E0 and PseudoZero tell whether underflow is abrupt, gradual, or fuzzy.
     V = an overflow threshold, roughly.
     V0  tells, roughly, whether  Infinity  is represented.
     Comparisions are checked for consistency with subtraction
        and for contamination with pseudo-zeros.
     Sqrt is tested.  Y^X is not tested.
     Extra-precise subexpressions are revealed but NOT YET tested.
     Decimal-Binary conversion is NOT YET tested for accuracy.

Diagnosis resumes after milestone Number 2          Page: 3

The program attempts to discriminate among
   FLAWs, like lack of a sticky bit,
   Serious DEFECTs, like lack of a guard digit, and
   FAILUREs, like 2+2 == 5 .
Failures may confound subsequent diagnoses.

The diagnostic capabilities of this program go beyond an earlier
program called `MACHAR', which can be found at the end of the
book  `Software Manual for the Elementary Functions' (1980) by
W. J. Cody and W. Waite. Although both programs try to discover
the Radix, Precision and range (over/underflow thresholds)
of the arithmetic, this program tries to cope with a wider variety
of pathologies, and to say how well the arithmetic is implemented.

The program is based upon a conventional radix representation for
floating-point numbers, but also allows logarithmic encoding
as used by certain early WANG machines.

BASIC version of this program (C) 1983 by Prof. W. M. Kahan;
see source comments for more history.

Diagnosis resumes after milestone Number 3          Page: 4

Program is now RUNNING tests on small integers:
-1, 0, 1/2, 1, 2, 3, 4, 5, 9, 27, 32 & 240 are O.K.

Searching for Radix and Precision.
Radix = 2.000000 .
Closest relative separation found is U1 = 1.1102230e-16 .

Recalculating radix and precision
 gets better closest relative separation U1 = 1.1102230e-16 .
Radix confirmed.
The number of significant digits of the Radix is 53.000000 .

Program received signal SIGILL, Illegal instruction.
0x0000aa30 in main ()

Several runs of the program all have the crash in that same place. The
binary appears to stay in the same altered state with each run also:

 root@snapper:~$ cmp -l paranoia
/home/ryan/download/paranoia2-crunch-ieee-O2    10602   0  60
10603   0 240
10604   0 341
10785   1  42
10786   0  34
10788   0 353
10794   0  60
10795   0 240
10796   0 341
10797   0   4
10799 360 240
10800  77 341
10809   0  20
10810   0   4
10811   0   1
10812   0 356
10813   0  60
10814   0  24
10815 360   1
10816  77 356
10829   1   5
10832   0 152
31441   0   6
31443   0 240
31444   0 341
31445   0 164
31446   0 151
31447   0  37
31448 100 345

Hope that helps,
~Ryan

-- 
Bluewater Systems Ltd - ARM Technology Solution Centre

       Ryan Mallon                              Unit 5, Amuri Park
       Phone: +64 3 3779127                     404 Barbadoes St
       Fax:   +64 3 3779135                     PO Box 13 889
       Email: ryan@xxxxxxxxxxxxxxxx             Christchurch, 8013
       Web:   http://www.bluewatersys.com       New Zealand
       Freecall Australia  1800 148 751         USA 1800 261 2934

Other related posts: