Menu

#128 sqrt(); crashes PSL REDUCE

None
closed
None
5
2020-10-22
2020-09-27
No

Using Reduce (Free PSL version, revision 5368), 24-Jun-2020 on Windows I get the error message "bpsl.exe has stopped working" if I start a new session and run the command

sqrt();

On CSL REDUCE I get the error message
+++ Error attempt to take car of an atom: nil
which seems reasonable.

Francis

Discussion

  • Rainer Schöpf

    Rainer Schöpf - 2020-09-27
    • status: open --> accepted
    • assigned_to: Rainer Schöpf
    • Group: -->
     
  • Rainer Schöpf

    Rainer Schöpf - 2020-09-27

    Note that on Linux the error message is "Segmentation violation" - which in most of the cases comes from trying to take car or cdr of an atom.
    Clearly this is not properly handled on Windows. I'm sure that it worked a while ago.
    I will look at it.

    Rainer

     
  • Arthur Norman

    Arthur Norman - 2020-09-27

    The CSL and PSL issues are really the same - I hope I have just checked in
    an update that arranges that this input leads to a more proper "wrong
    number of arguments" diagnostic.

    Anybody who feels keen might try as many other functions and operators as
    they can think of and see which check for the right number of arguments
    nicely. A few that I tried were OK but it is possible that there are more
    cases like this - each individually not hard to fix --- but finding them
    all and making the changes could become pretty tedious!

    Arthur

    On Sun, 27 Sep 2020, Francis Wright wrote:

    sqrt();
    On CSL REDUCE I get the error message
    +++ Error attempt to take car of an atom: nil
    which seems reasonable.

     
  • Rainer Schöpf

    Rainer Schöpf - 2020-10-21

    I believe I have corrected the bug causing the crash.
    Can you please rebuild from scratch and check?

    Rainer

     
  • Francis Wright

    Francis Wright - 2020-10-22

    Yes, it looks fine now, thanks. I built PSL REDUCE revision 5442 from scratch on 64-bit Windows 10, undid Arthur's argument checking code, and now I get

     sqrt();
    ***** An attempt was made to do car on `nil', which is not a pair
    

    after which REDUCE continues to a new prompt.

    Francis

     
  • Rainer Schöpf

    Rainer Schöpf - 2020-10-22

    Hmm, that looks like a car on nil in interpreted code. Can you try again after "on comp;" before redefining the function?

    My test is a bit simpler:

    on comp;
    symbolic;
    procedure testcrash x; car x;
    testcrash 1;
    

    Rainer

     
  • Francis Wright

    Francis Wright - 2020-10-22

    OK. Using compiled code I get

    sqrt();
    ***** Segmentation Violation in simpsqrt
    

    Francis

     
  • Rainer Schöpf

    Rainer Schöpf - 2020-10-22

    Excellent.
    This is from optimized code where car/cdr are compiled into indirect memory references.
    It is difficult (but theoretically possible) to analyze the faulting instruction and so determine the operation (car/cdr/rplaca/rplacd) and the atom on which it operates.
    On the other hand, it is much easier to identify the problem in interpreted code.

    Rainer

     
  • Rainer Schöpf

    Rainer Schöpf - 2020-10-22
    • status: accepted --> closed
     
  • Rainer Schöpf

    Rainer Schöpf - 2020-10-22

    Bug is fixed.

     

Log in to post a comment.

MongoDB Logo MongoDB