Interlisp / medley

The main repo for the Medley Interlisp project. Wiki, Issues are here. Other repositories include maiko (the VM implementation) and Interlisp.github.io (web site sources)
https://Interlisp.org
MIT License
376 stars 19 forks source link

NIL is not a non-complex number error when loading VSTATS #1802

Open pamoroso opened 3 months ago

pamoroso commented 3 months ago

Describe the bug

When loading the VSTATS LispUsers module I get a partially rendered program window and a break window with the error:

In \FLOAT:
NIL is not a non-complex number

To Reproduce

Steps to reproduce the behavior:

  1. sign into your Interlisp Online account
  2. under Initial Exec, select Interlisp
  3. click Run Medley
  4. evaluate (FILESLOAD VSTATS)

Expected behavior

The VSTATS program window is fully rendered with no errors.

Screenshots

The full desktop with the break window and the partially rendered VSTATS window:

vstats-error

Context (please complete the following information):

Additional context

The transcript of a debugger session:

5_: BT
FTIMES
VStatsSpace-Read
VStatsSpace-Display
VStats-Display
VSTATS
LOAD
DOFILESLOAD
FILESLOAD
FAULTEVAL
EVAL
EXEC

6_: ?=
  X = NIL
7_: PB X
bindings for X: 
 @ TOP : NOBIND
8_: BTV
\FLOAT
\DTEST.UFN
\BOXFTIMES2
FTIMES
VStatsSpace-Read
VStatsSpace-Display
VStats-Display
VSTATS
   *FORM* (VSTATS (QUOTE ON))
   *ARGVAL* NIL
   *TAIL* NIL
   *FN* VSTATS
\EVALFORM
   *TAIL* ((VSTATS &))
\EVPROGN
   *TAIL* ((& &))
COND
   *FORM* (COND (& &))
\EVALFORM
   STREAM 
#<Input Stream on {DSK}<usr>local>interlisp>medley>lispusers>VSTATS.LCOM;1/130,3600>
   LDFLG NIL
   PRINTFLG NIL
   LOAD-VERBOSE-STREAM T
   PACKAGE NIL
   *STANDARD-INPUT* 
#<Input Stream on {DSK}<usr>local>interlisp>medley>lispusers>VSTATS.LCOM;1/130,3600>
   FILE 
{DSK}<usr>local>interlisp>medley>lispusers>VSTATS.LCOM;1
   *PACKAGE* #<Package INTERLISP>
   *READTABLE* #<ReadTable OLD-INTERLISP-FILE/174,73730>
   DFNFLG NIL
   BUILDMAPFLG T
   FILEPKGFLG T
   ADDSPELLFLG T
   LISPXHIST ((&) (3 "" . "_ ") "<not yet evaluated>" 
NIL *LISPXPRINT* ("
" & "
" "compiled on " " 6-Jul-94 01:10:03" "
" "File created " "13-Nov-87 01:45:11" "
" --) SIDE (-1 & & & & & & & & --))
   PRLST NIL
   DEFINEDENV {READER-ENVIRONMENT}#174,70604
   FILEMAP ((NIL & & & & & & & & --) (28536 28719 . 
COVEREDWP))
   FNADRLST NIL
   ROOTNAME NIL
   TEM " 2-Jun-94 10:43:09"
   FILECREATEDLST ((" 6-Jul-94 01:10:03" & 
" 2-Jun-94 10:43:09" bcompl'd in "Medley  2-Jun-94 ..." 
dated " 2-Jun-94 10:52:50") ("13-Nov-87 01:45:11" 
"{FireFS:CS:Univ Rochester}<Koomen>LispUsers>Lyric>VSTATS.;12" 46865 changes to%: & previous date%: 
"30-Oct-87 01:20:07" --))
   LOADA (COND (& &))
   MAYBEWANTFILEMAP NIL
   INTERLISP-P NIL
   FILECREATEDLOC NIL
   *PACKAGE* #<Package INTERLISP>
   *READTABLE* #<ReadTable INTERLISP/174,73714>
   *READ-BASE* 10
   *PRINT-BASE* 10
   *EXTERNALFORMAT* :XCCS
\LOAD-STREAM
   SI::*CLEANUP-FORMS* SI::RESETUNWIND
   STREAM 
#<Input Stream on {DSK}<usr>local>interlisp>medley>lispusers>VSTATS.LCOM;1/130,3600>
   TEM NIL
SI::*UNWIND-PROTECT*
   FILE 
{DSK}<usr>local>interlisp>medley>lispusers>VSTATS.LCOM;1
   LDFLG NIL
   PRINTFLG NIL
   PACKAGE NIL
   LISPXHIST ((&) (3 "" . "_ ") "<not yet evaluated>" 
NIL *LISPXPRINT* ("
" & "
" "compiled on " " 6-Jul-94 01:10:03" "
" "File created " "13-Nov-87 01:45:11" "
" --) SIDE (-1 & & & & & & & & --))
   SI::*RESETFORMS* ((& NIL))
   RESETSTATE NIL
LOAD
DOFILESLOAD
FILESLOAD
CL:FUNCALL
   *FORM* (CL:FUNCALL (FUNCTION FILESLOAD) (QUOTE &))
   *ARGVAL* NIL
   *TAIL* NIL
   *FN* CL:FUNCALL
\EVALFORM
FAULTEVAL
   *FORM* (UNDOABLY (FILESLOAD VSTATS))
\EVALFORM
   \INTERNAL NIL
EVAL
EVAL-INPUT
   RETRYFLAG NIL
   HELPCLOCK 2529
DO-EVENT
   SI::*DUMMY-FOR-CATCH* T
   SI::*CATCH-RETURN-FROM* (&)
   LISPXHIST ((&) (3 "" . "_ ") "<not yet evaluated>" 
NIL *LISPXPRINT* ("
" & "
" "compiled on " " 6-Jul-94 01:10:03" "
" "File created " "13-Nov-87 01:45:11" "
" --) SIDE (-1 & & & & & & & & --))
   HELPCLOCK 0
XCL::EXECA0001A0002
   *CURRENT-EVENT* ((&) (3 "" . "_ ") 
"<not yet evaluated>" NIL *LISPXPRINT* ("
" & "
" "compiled on " " 6-Jul-94 01:10:03" "
" "File created " "13-Nov-87 01:45:11" "
" --) SIDE (-1 & & & & & & & & --))
   SI::NLSETQ-VALUE NIL
   *PROCEED-CASES* (&)
   SI::*NLSETQFLAG* NIL
XCL::EXECA0001
\PROGV
   XCL::TOP-LEVEL-P T
   XCL::WINDOW {WINDOW}#161,173664
   XCL::TITLE-SUPPLIED NIL
   XCL::TITLE NIL
   *THIS-EXEC-COMMANDS* (#<Hash-Table @ 166,25666>)
   XCL::ENVIRONMENT NIL
   XCL::PROMPT NIL
   XCL::FN EVAL-INPUT
   XCL::PROFILE "XCL"
   *EXEC-ID* ""
   XCL::PROFILE-CACHE (XCL::*PROFILE-NAME* "XCL" 
XCL:*EVAL-FUNCTION* CL:EVAL *PACKAGE* #<Package XCL-USER> *READTABLE* #<ReadTable XCL/174,73634> XCL:*EXEC-PROMPT* "> " --)
EXEC
\PROC.REPEATEDLYEVALQT
   *FORM* (\PROC.REPEATEDLYEVALQT)
   *ARGVAL* NIL
   *TAIL* NIL
   *FN* \PROC.REPEATEDLYEVALQT
\EVALFORM
   %#FORM# (\PROC.REPEATEDLYEVALQT)
   *CURRENT-PROCESS* #<Process EXEC/174,24204>
   HELPFLAG BREAK!
   \CURRENTDISPLAYLINE 11
   \#DISPLAYLINES 25
   \LINEBUF.OFD #<IO Linebuffer Stream/167,114400>
   *READTABLE* #<ReadTable INTERLISP/174,73714>
   \PRIMTERMTABLE {TERMTABLEP}#174,66740
   \PRIMTERMSA {CHARTABLE}#174,67000
   TtyDisplayStream #<Output Display Stream/130,21200>
   SI::*RESETFORMS* NIL
   \INTERRUPTABLE T
   \TTYWINDOW NIL
   READBUF NIL
   \TERM.OFD #<Output Display Stream/170,111400>
   *STANDARD-OUTPUT* #<Output Display Stream/170,111400>
   *STANDARD-INPUT* #<IO Linebuffer Stream/167,114400>
\MAKE.PROCESS0
T
nbriggs commented 3 months ago

From the graphical break window for the TYPE-MISMATCH, left button in the stack trace to select VStatsSpace-Read then middle button there to select Display Edit, answer Y to "do you want to LOADFROM PROP ...". Looking at the source for that function reveals that it's going to use the result of (STORAGE.LEFT) as a SPACEDATA record. So, in an Interlisp exec you can (INSPECT (STORAGE.LEFT) 'SPACEDATA) and see: Screenshot 2024-08-11 at 8 54 41 AM and looking at that you'll see that the ATOMFRAC is NIL - thus the error trying to multiply it by 100. I suspect the definition of (STORAGE.LEFT) changed at some point. You can see in your output that the file came from Hans Koomen - "{FireFS:CS:Univ Rochester}<Koomen>LispUsers>Lyric>VSTATS.;12" - when he wrote it for the Interlisp Lyric release. It would not surprise me at all if the result of (STORAGE.LEFT) changed between Lyric and Medley, when the atom space got much larger. This doesn't solve the problem, but is an example of how to debug.

pamoroso commented 3 months ago

Very useful, thanks.

masinter commented 3 months ago

with the introduction of 4-byte atoms, there is no longer a difference between storage left for atoms (symbols) vs storage left for anythhing. I remember patching STORAGE (and \MAPMDS) to fix several problems (pr a80788201ffd4) but this looks like a case I missed.