Let's test this version: only '$timedNameStack' is initialized once,
the rest stats variables are initialized for each line typed into
interpreter.
- Qian
diff --git a/src/interp/g-timer.boot b/src/interp/g-timer.boot
index cb373c43..02e53450 100644
--- a/src/interp/g-timer.boot
+++ b/src/interp/g-timer.boot
@@ -148,7 +148,6 @@ initializeTimedNames(listofnames,listofclasses) ==
for [.,name,:.] in listofclasses repeat
PUT( name, 'ClassTimeTotal, 0.0)
PUT( name, 'ClassSpaceTotal, 0)
- $timedNameStack := '(other)
computeElapsedTime()
computeElapsedSpace()
PUT('gc, 'TimeTotal, 0.0)
diff --git a/src/interp/i-toplev.boot b/src/interp/i-toplev.boot
index 20b4773c..00d793ee 100644
--- a/src/interp/i-toplev.boot
+++ b/src/interp/i-toplev.boot
@@ -70,6 +70,7 @@ interpsysInitialization(display_messages) ==
createInitializers()
if $displayStartMsgs then sayKeyedMsg("S2IZ0053",['"interpreter"])
initializeTimedNames($interpreterTimedNames,$interpreterTimedClasses)
+ $timedNameStack := '(other)
$InteractiveFrame := makeInitialModemapFrame()
initializeSystemCommands()
initializeInterpreterFrameRing()
On 12/11/23 11:49, Qian Yun wrote:
Based on my experience when I was adding ')storage' and tweaking
g-timer.boot, the problem is that '$timedNameStack' should not
be initialized multiple times.
Aka 'initializeTimedNames' should not be called in 'processInteractive'
(it is already called at toplevel 'interpsysInitialization').
diff --git a/src/interp/i-toplev.boot b/src/interp/i-toplev.boot
index 20b4773c..04d37850 100644
--- a/src/interp/i-toplev.boot
+++ b/src/interp/i-toplev.boot
@@ -130,8 +130,6 @@ processInteractive(form, posnForm) ==
-- and then calls processInteractive1 to do most of the work.
-- This function receives the output from the parser.
- initializeTimedNames($interpreterTimedNames,$interpreterTimedClasses)
-
$op: local:= (form is [op,:.] => op; form) --name of operator
$Coerce: local := NIL
$compErrorMessageStack:local := nil
With this change, the looping problem is gone.
Also if my analysis is right, 'savedTimerStack' can also be removed.
This needs more testing and analysis. A side effect of this is
that stats are not working properly.
I'll take a deeper look.
- Qian
On 12/11/23 09:18, Waldek Hebisch wrote:
There is trouble with recusive calls to intepreter. Ralf reported
problem with use of 'systemCommand("read foo.input")', after
fixing part of it I got a hang. Earlier, doing
s := "1 + 1"
interpret_block(s)$Lisp
we got a hang. I now found the reason: recursive call to
intepreter mangles '$timedNameStack' (and other timing
variables) causing infinite loop in statisctics code.
I am not sure what is proper fix for this (more precisely,
how should we time recursive calls). The attached patch
works around infinite loop and fixes abort when doing 'read'
as system command.
--
You received this message because you are subscribed to the Google Groups "FriCAS -
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/d9984ba2-562e-479f-9c2c-9c66c32836b7%40gmail.com.