The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

wp34s, another shutdown situation
Message #1 Posted by Andrew Nikitin on 15 June 2013, 12:58 p.m.

Here is how to reproduce: 64 MODE DENMAX DENFAC -- fractions of an inch mode
Start 'TRI' solver from library. (I did it trough CAT, select LBL'TRI', XEQ, in case that matters).
"Trigon" : [R/S]
a= : 6.1.2 [R/S]
b= : 4.7.8 [R/S]
c= : 6 [R/S]
alpha= : 0 [R/S]
beta= : 0 [R/S]
gamma= : 0 [R/S]
Solution: [R/S]
-- and calculator shuts down.

This happens on real device every time, did not try on emulator, both my calculators do that. The one with newer firmware blinks "Bye...", so it must be a "proper" shutdown.

It may or may not be related to LINESQ step through bug, which also shuts down the calculator.

      
Re: wp34s, another shutdown situation
Message #2 Posted by Paul Dale on 15 June 2013, 8:59 p.m.,
in response to message #1 by Andrew Nikitin

Thanks for this. We will investigate once Marcus returns from his holiday.

- Pauli

      
Re: wp34s, another shutdown situation
Message #3 Posted by Walter B on 16 June 2013, 2:19 a.m.,
in response to message #1 by Andrew Nikitin

This shutdown doesn't happen on the emulator (3407). AFAICS the program runs flawless there.

d:-)

            
Re: wp34s, another shutdown situation
Message #4 Posted by Paul Dale on 16 June 2013, 2:36 a.m.,
in response to message #3 by Walter B

I suspect this and the earlier one are related to error handling. Further investigation prove this or otherwise, however Marcus is in the best position to determine the root cause at present.

- Pauli

            
Re: wp34s, another shutdown situation
Message #5 Posted by Dieter on 16 June 2013, 1:39 p.m.,
in response to message #3 by Walter B

Here everything also works fine on "the real thing" with firmware 3.2 3405 (incl. printer/timer support).

XEQ"TRI"    TriGon
[R/S]       a=
6.1.2 [R/S] b=
4.7.8 [R/S] c=
6     [R/S] alpha=
      [R/S] beta=
      [R/S] gamma=
      [R/S] Solution:
      [R/S] a= 13/2
      [R/S] b= 39/8
      [R/S] c= 6/1
      [R/S] alpha= 106036/1461 (= 72,57768...)
      [R/S] beta=  455593/9971 (= 45,69180...)
      [R/S] gamma= 444151/7195 (= 61,73050...)
      [R/S] P=  139/8          (= 17,375)
      [R/S] A=  64091/4593     (= 13,95406...)
Calling the program via CAT and XEQ (or ENTER) does not make a difference. No errors here.

Dieter

                  
Re: wp34s, another shutdown situation
Message #6 Posted by Andrew Nikitin on 16 June 2013, 9:59 p.m.,
in response to message #5 by Dieter

Dieter, are you sure you set both DENMAX=64 and DENFAC? From the format of the answers it does not look that way.

The effect can be seen when the above settings are set and not in a "regular" fraction mode.

Edited: 16 June 2013, 10:00 p.m.

                        
Re: wp34s, another shutdown situation
Message #7 Posted by Walter B on 17 June 2013, 12:34 a.m.,
in response to message #6 by Andrew Nikitin

Looks like DENFAC contains the root cause. The error does neither happen with DENANY nor DENFIX on the "real thing" (3.2 3407).

d:-)

Edited: 17 June 2013, 12:35 a.m.

                        
Re: wp34s, another shutdown situation
Message #8 Posted by Dieter on 17 June 2013, 5:55 p.m.,
in response to message #6 by Andrew Nikitin

No, I obviously overlooked that detail. With these settings I can reproduce the error. Seems to be something in the fractions settings.

One more reason for the metric system. ;-)

Dieter

                              
Re: wp34s, another shutdown situation
Message #9 Posted by Paul Dale on 17 June 2013, 7:01 p.m.,
in response to message #8 by Dieter

I'm pretty sure the GCD algorithm used to reduce the terms to their lowest form is the problem. It uses a huge number of digits to guarantee correct results for gcd(max-real, min-real). I think this is causing the volatile stack to overflow into important stuff. As a top level operation there is space for this, but not when called from a long chain from the display handler.

I made a change last night to just use the smaller modulus function instead but this isn't ideal since the GCD and LCM user functions will break for some inputs.

- Pauli

                                    
Re: wp34s, another shutdown situation
Message #10 Posted by Andrew Nikitin on 19 June 2013, 1:26 a.m.,
in response to message #9 by Paul Dale

Maybe fraction display code could use special (internal) GCD/LCM version. It only needs to work with integers under 9999. Unlike generic function that has to deal with entire range.

                                          
Re: wp34s, another shutdown situation
Message #11 Posted by Paul Dale on 19 June 2013, 1:52 a.m.,
in response to message #10 by Andrew Nikitin

More code would be required. Flash is full.

- Pauli


[ Return to Index | Top of Index ]

Go back to the main exhibit hall