#431 Error in error reporting

open
Mark Hessling
None
5
2014-07-24
2014-07-24
Paul Kislanko
No

An expected failure of an exec that I expect to not fail when it actually has some input was reported incorrectly.

---begin snippet---

Done work\Compare\Compare_votes_00.txt
0 rankings.
Error in C:\rxcommon\RXXMATH.rx (LN) -- Argument <= 0: 0
623 +++
28 +++ call 'gviol_'
Error 44 running "D:\Documents\Football\2014\gviol_.rx", line 623: Function did not return data
Error 44.1: No data returned from function "RXXMATH"
+++ RC=44 +++
---end snippet---

That cannot be correct since ...\gviol_.rx doesn't even have 623 lines! The 623 came from the line number within the function.

The "Error in C:\rxconnon..." line is the result of a SAY in rxxmath
The "623 +++"
must refer to rxxmath.rx, namely
" else exit / If called as function caller will blow up. /"
is line 623 in my copy of rxxmath (and its caller did indeed blow up - this was the expected part.)

The " 28 +++ call 'gviol_'" is the line in the highest-level routine (which is correct). The call to rxxmath within gviol_ is at line 77, so I believe the correct error message would've been:

77 +++ weightbase = (xi+xj)*rxxmath(digits(),'ln', xM)
Error 44 running "D:\Documents\Football\2014\gviol_.rx", line 77: Function did not return data
Error 44.1: No data returned from function "RXXMATH"

I hope this one's easy to fix.

Discussion

  • Mark Hessling
    Mark Hessling
    2014-07-24

    A simple test case with sample code would help. Is this error occurring with the "16 Jul 2014" version of Regina 3.8.2 I uploaded for you?

     
    • Paul Kislanko
      Paul Kislanko
      2014-07-24

      Oh, sorry Mark, I missed that upload was done. I will download it and test. If that fixes it I'll let you know.

      Meanwhile, the sample is just

      exec a:
      call B

      exec b:
      rxxmath(digits(),'log',0)

       
    • Paul Kislanko
      Paul Kislanko
      2014-07-25

      Yes, it is happening in the 16 Jul 2014 version.

      parse version ver
      say ver
      REXX-Regina_3.8.2(MT) 5.00 16 Jul 2014
      Error in C:\rxcommon\RXXMATH.rx (LN) -- Argument <= 0: 0
      623 +++
      28 +++ call 'gviol_'
      Error 44 running "D:\Documents\Football\2014\gviol_.rx", line 623: Function did not return data
      Error 44.1: No data returned from function "RXXMATH"
      +++ RC=44 +++


      The actual RXXMATH() call is at line 78 in 'gviol_'
      line 623 in RXXMATH is the function return with no data, the last line in this snippet:

      / Print error message and exit. /
      error: procedure expose glb.
      if arg(1, "E") then say errmsg(arg(1))
      parse source . cmd? .
      if cmd? = "COMMAND"
      then exit 1 / Error return code is 1 when called as a command. /
      else exit / If called as function caller will blow up. /

      As far as a test case goes, just insert a

      logzero = rxxmath('log',0)

      into any exec.

       
  • Mark Hessling
    Mark Hessling
    2014-07-24

    • assigned_to: Mark Hessling