Major upgrade broke STACK, now getting "CASText failed validation. TIMEDOUT dumped"

Re: Major upgrade broke STACK, now getting "CASText failed validation. TIMEDOUT dumped"

by Tom Smith -
Number of replies: 8

I also am struggling to get STACK/Maxima working again (it previously worked fine, but a package change

about 6 months ago appeared to break it.) Last night we upgraded the STACK plugin version to the latest available

as well as updating the server packages (Ubuntu 20.04). Maxima works fine from the command line; I've set the

correct version in the STACK config [5.43.2]  via Moodle and its path [/usr/bin/maxima].

Any help would be appreciated.


Here's the health script output:


Debug info

Context used

Platform: linux
Maxima shell command: /usr/bin/maxima
Maxima initial command: load("/srv/moodledata/stack/maximalocal.mac");


Maxima timeout: 10

Maxima command

cab:block([],print("[STACKSTART Locals= [ 0=[ error= ["), cte("CASresult",errcatch(diff(x^n,x))), print("1=[ error= ["), cte("STACKversion",errcatch(stackmaximaversion)), print("2=[ error= ["), cte("MAXIMAversion",errcatch(MAXIMA_VERSION_STR)), print("3=[ error= ["), cte("MAXIMAversionnum",errcatch(MAXIMA_VERSION_NUM)), print("4=[ error= ["), cte("externalformat",errcatch(adjust_external_format())), print("5=[ error= ["), cte("CAStime",errcatch(CAStime:"2021-01-27 08:33:05")), print("] ]"), return(true));

CAS process return value: 134

Timings

Start: 1611736385.5097, End: 1611736387.3044, Taken = 1.7946619987488

CAS result

Maxima 5.43.2 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.12
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) define: warning: redefining the built-in function intervalp
warning: variable simp (declared type boolean) assigned type any.
execvp failure when executing '/usr/bin/gcc -c -g -fdebug-prefix-map=/build/gcl-GO84Zx/gcl-2.6.12=. -fstack-protector-strong -Wformat -Werror=format-security -fsigned-char -pipe -fno-builtin-malloc -fno-builtin-free -fno-PIE -fno-pie -fno-PIC -fno-pic -Wall -Wno-empty-body -Wno-unused-but-set-variable -Wno-misleading-indentation -Wdate-time -D_FORTIFY_SOURCE=2  -I/usr/lib/gcl-2.6.12/unixport/../h  -O2  -c /tmp/gazonk_33990_0.c -o /tmp/gazonk_33990_0.o ': No such file or directory
Maxima encountered a Lisp error:

 SIMPLE-ERROR: (SYSTEM "/usr/bin/gcc -c -g -fdebug-prefix-map=/build/gcl-GO84Zx/gcl-2.6.12=. -fstack-protector-strong -Wformat -Werror=format-security -fsigned-char -pipe -fno-builtin-malloc -fno-builtin-free -fno-PIE -fno-pie -fno-PIC -fno-pic -Wall -Wno-empty-body -Wno-unused-but-set-variable -Wno-misleading-indentation -Wdate-time -D_FORTIFY_SOURCE=2  -I/usr/lib/gcl-2.6.12/unixport/../h  -O2  -c /tmp/gazonk_33990_0.c -o /tmp/gazonk_33990_0.o ") returned a non-zero value 130 0.

Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.
(%i1) 
[STACKSTART Locals= [ 0=[ error= [ 
], key = [ 
CASresult 
] 
, value = [ 
n*x^(n-1) 
], dispvalue = [ 
n*x^(n-1) 
], display = [ 
stack_disp(n*x^(n-1),"") 
] 
],  
1=[ error= [ 
], key = [ 
STACKversion 
] 
, value = [ 
stackmaximaversion 
], dispvalue = [ 
stackmaximaversion 
], display = [ 
stack_disp(stackmaximaversion,"") 
] 
],  
2=[ error= [ 
], key = [ 
MAXIMAversion 
] 
, value = [ 
"5.43.2" 
], dispvalue = [ 
"5.43.2" 
], display = [ 
stack_disp("5.43.2","") 
] 
],  
3=[ error= [ 
], key = [ 
MAXIMAversionnum 
] 
, value = [ 
43.2 
], dispvalue = [ 
43.2 
], display = [ 
stack_disp(43.2,"") 
] 
],  
4=[ error= [ 
There is no settable external format.
], key = [ 
externalformat 
] 
, value = [ 
false 
], dispvalue = [ 
false 
], display = [ 
stack_disp(false,"") 
] 
],  
5=[ error= [ 
], key = [ 
CAStime 
] 
, value = [ 
"2021-01-27 08:33:05" 
], dispvalue = [ 

Unrecoverable error: Segmentation violation..
Aborted (core dumped)

Unpacked result as

Array
(
    [0] => Array
        (
            [key] => CASresult
            [value] => n*x^(n-1)
            [dispvalue] => n*x^(n-1)
            [display] => stack_disp(n*x^(n-1),"")
            [error] => 
        )

    [1] => Array
        (
            [key] => STACKversion
            [value] => stackmaximaversion
            [dispvalue] => stackmaximaversion
            [display] => stack_disp(stackmaximaversion,"")
            [error] => 
        )

    [2] => Array
        (
            [key] => MAXIMAversion
            [value] => "5.43.2"
            [dispvalue] => "5.43.2"
            [display] => stack_disp("5.43.2","")
            [error] => 
        )

    [3] => Array
        (
            [key] => MAXIMAversionnum
            [value] => 43.2
            [dispvalue] => 43.2
            [display] => stack_disp(43.2,"")
            [error] => 
        )

    [4] => Array
        (
            [error] => There is no settable external format.
            [key] => externalformat
            [value] => false
            [dispvalue] => false
            [display] => stack_disp(false,"")
        )

    [5] => Array
        (
            [key] => CAStime
            [value] => "2021-01-27 08:33:05"
            [dispvalue] => Unrecoverable error: Segmentation violation..Aborted (core dumped)
            [error] => 
        )

)

Trying to connect to the CAS

We are trying to evaluate the following CAS text:

The derivative of {@ x^4/(1+x^4) @} is \[ \frac{d}{dx} \frac{x^4}{1+x^4} = {@ diff(x^4/(1+x^4),x) @}. \]  Confirm if unicode is supported: \(\forall\) should be displayed {@unicode(8704)@}.

The derivative of x^4/(1+x^4) is ddxx41+x4=diff(x4/(1+x4),x).

Confirm if unicode is supported:

should be displayed unicode(8704).

Errors

CASText failed validation. (%i2) length: argument cannot be a symbol; found %ERR -- an error. (%i3)

Debug info

(%i2) length: argument cannot be a symbol; found %ERR -- an error. (%i3)

Automatically create an optimised Maxima image

For best performance we need to optimize maxima on a linux machine. Use the plugin "healthcheck" page and see the documentation on this issue.

Maxima image created at: timeout --kill-after=10s 10s /srv/moodledata/stack/maxima_opt_auto -eval '(cl-user::run)'

Debug info

Context used

Platform: linux
Maxima shell command: /usr/bin/maxima
Maxima initial command: load("/srv/moodledata/stack/maximalocal.mac");


Maxima timeout: 10

Maxima command

:lisp (si::save-system "/srv/moodledata/stack/maxima_opt_auto")
quit();

CAS process return value: 0

Timings

Start: 1611736388.8441, End: 1611736390.5599, Taken = 1.7158231735229

CAS result

Maxima 5.43.2 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.12
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) define: warning: redefining the built-in function intervalp
warning: variable simp (declared type boolean) assigned type any.
execvp failure when executing '/usr/bin/gcc -c -g -fdebug-prefix-map=/build/gcl-GO84Zx/gcl-2.6.12=. -fstack-protector-strong -Wformat -Werror=format-security -fsigned-char -pipe -fno-builtin-malloc -fno-builtin-free -fno-PIE -fno-pie -fno-PIC -fno-pic -Wall -Wno-empty-body -Wno-unused-but-set-variable -Wno-misleading-indentation -Wdate-time -D_FORTIFY_SOURCE=2  -I/usr/lib/gcl-2.6.12/unixport/../h  -O2  -c /tmp/gazonk_34048_0.c -o /tmp/gazonk_34048_0.o ': No such file or directory
Maxima encountered a Lisp error:

 SIMPLE-ERROR: (SYSTEM "/usr/bin/gcc -c -g -fdebug-prefix-map=/build/gcl-GO84Zx/gcl-2.6.12=. -fstack-protector-strong -Wformat -Werror=format-security -fsigned-char -pipe -fno-builtin-malloc -fno-builtin-free -fno-PIE -fno-pie -fno-PIC -fno-pic -Wall -Wno-empty-body -Wno-unused-but-set-variable -Wno-misleading-indentation -Wdate-time -D_FORTIFY_SOURCE=2  -I/usr/lib/gcl-2.6.12/unixport/../h  -O2  -c /tmp/gazonk_34048_0.c -o /tmp/gazonk_34048_0.o ") returned a non-zero value 130 0.

Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.
(%i1) 
unpack_raw_result: no STACKSTART returned. Data returned was: 
Maxima 5.43.2 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.12
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) define: warning: redefining the built-in function intervalp
warning: variable simp (declared type boolean) assigned type any.
execvp failure when executing '/usr/bin/gcc -c -g -fdebug-prefix-map=/build/gcl-GO84Zx/gcl-2.6.12=. -fstack-protector-strong -Wformat -Werror=format-security -fsigned-char -pipe -fno-builtin-malloc -fno-builtin-free -fno-PIE -fno-pie -fno-PIC -fno-pic -Wall -Wno-empty-body -Wno-unused-but-set-variable -Wno-misleading-indentation -Wdate-time -D_FORTIFY_SOURCE=2  -I/usr/lib/gcl-2.6.12/unixport/../h  -O2  -c /tmp/gazonk_34048_0.c -o /tmp/gazonk_34048_0.o ': No such file or directory
Maxima encountered a Lisp error:

 SIMPLE-ERROR: (SYSTEM "/usr/bin/gcc -c -g -fdebug-prefix-map=/build/gcl-GO84Zx/gcl-2.6.12=. -fstack-protector-strong -Wformat -Werror=format-security -fsigned-char -pipe -fno-builtin-malloc -fno-builtin-free -fno-PIE -fno-pie -fno-PIC -fno-pic -Wall -Wno-empty-body -Wno-unused-but-set-variable -Wno-misleading-indentation -Wdate-time -D_FORTIFY_SOURCE=2  -I/usr/lib/gcl-2.6.12/unixport/../h  -O2  -c /tmp/gazonk_34048_0.c -o /tmp/gazonk_34048_0.o ") returned a non-zero value 130 0.

Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.
(%i1) ]]]]

Unpacked result as

Array
(
)

Maxima version

The version of the STACK-Maxima libraries being used (stackmaximaversion) does not match what is expected (2020120600) by this version of the STACK question type. It is not really clear how that happened. You will need to debug this problem yourself. Start by clearing the CAS cache.

Graph plotting

There should be two different plots. If two identical plots are seen then this is an error in naming the plot files. If no errors are returned, but a plot is not displayed then one of the following may help. (i) check read permissions on the two temporary directories. (ii) change the options used by GNUPlot to create the plot. Currently there is no web interface to these options.

Two example plots below.  {@plot([x^4/(1+x^4),diff(x^4/(1+x^4),x)],[x,-3,3])@} {@plot([sin(x),x,x^2,x^3],[x,-3,3],[y,-3,3],grid2d)@}  A third, smaller, plot may be displayed here with traditional axes.  (Newer versions of Maxima only.) {@plot([sin(x),x,x^2,x^3],[x,-3,3],[y,-3,3],[box, false],[yx_ratio, 1],[axes, solid],[xtics, -3, 1, 3],[ytics, -3, 1, 3],[size,250,250])@}

Two example plots below. plot([x^4/(1+x^4),diff(x^4/(1+x^4),x)],[x,-3,3]) plot([sin(x),x,x^2,x^3],[x,-3,3],[y,-3,3],grid2d) A third, smaller, plot may be displayed here with traditional axes. (Newer versions of Maxima only.) plot([sin(x),x,x^2,x^3],[x,-3,3],[y,-3,3],[box, false],[yx_ratio, 1],[axes, solid],[xtics, -3, 1, 3],[ytics, -3, 1, 3],[size,250,250])

Errors

CASText failed validation. (%i2) length: argument cannot be a symbol; found %ERR -- an error. (%i3)

Debug info

(%i2) length: argument cannot be a symbol; found %ERR -- an error. (%i3)

CAS result caching

CAS results are being cached in the database.

The cache currently contains 1 entries.


linux
OKCAS returned data as expected. You have a live connection to the CAS.
OKMaxima image created at: timeout --kill-after=10s 10s /srv/moodledata/stack/maxima_opt_auto -eval '(cl-user::run)'
FAILEDThe version of the STACK-Maxima libraries being used (stackmaximaversion) does not match what is expected (2020120600) by this version of the STACK question type. It is not really clear how that happened. You will need to debug this problem yourself. Start by clearing the CAS cache.
Load optional Maxima libraries: stats,distrib,descriptive,simplex
CAS results are being cached in the database.

Average of ratings: Useful (2)
In reply to Tom Smith

Re: Major upgrade broke STACK, now getting "CASText failed validation. TIMEDOUT dumped"

by Susan Mangan -
Hi, we are running Moodle v3.9 and experiencing the same problem. Has anyone had any luck figuring this one out?
In reply to Susan Mangan

Re: Major upgrade broke STACK, now getting "CASText failed validation. TIMEDOUT dumped"

by Thorsten Bartel -
Picture of Core developers
Hi Susan,
hi Tom,

the error message at the very end implies the usage of an optimized maxima image that has been compiled with an earlier version of STACK.
To resolve this issue, please delete the old optimized maxima image and instead set "qtype_stack | platform" to "Linux". Please ensure that the correct maxima version is selected in "qtype_stack | maximaversion" and that "qtype_stack | maximacommand" has the correct value (in most cases STACK will guess correctly if left empty).

Upon running the Healthcheck-Script, you should find an option to automatically create a new optimized image at the very bottom. I have observed newer versions of STACK performing this task automatically during the plugin upgrade process.

If these steps fail to solve your problem, please provide more information.

Cheers
In reply to Thorsten Bartel

Re: Major upgrade broke STACK, now getting "CASText failed validation. TIMEDOUT dumped"

by Tom Smith -
Hmm, I checked the "qtype_stack | platform" ... "Linux" (it was) and "qtype_stack | maximaversion" as 5.43.2; command line maxima reports as 5.43.2-3 so this seems like the best option. The healthcheck script fails with similar errors and when I tried to run the 'create optimised image', I got:

STACK healthcheck
Automatically create an optimised Maxima image

stack_ast_container: tried to get the value from of an unevaluated casstring.

More information about this error
In reply to Tom Smith

Re: Major upgrade broke STACK, now getting "CASText failed validation. TIMEDOUT dumped"

by Thorsten Bartel -
Picture of Core developers
Well, creating an optimized image is pretty much expected to fail if the healthcheck itself fails.
If Maxima is running on a system level, you could always try to create the optimized image yourself:
https://github.com/maths/moodle-qtype_stack/blob/master/doc/en/CAS/Optimising_Maxima.md
(Look for the chapter titled "Create Maxima Image by hand".)

You might at the very least get more detailed error output during this process.
If this fails, too, you can also set up another machine with an older version of Maxima (typically Ubuntu 18.04 LTS with Maxima 5.41.0), copy the STACK libraries to that system, create the optimised image there, then copy the finished image to your Moodle server. You'll obviously have to specify the older Maxima version in the question type settings and most likely you'll have to ensure that compatible Lisp versions / libraries are in use on both machines.
In reply to Thorsten Bartel

Re: Major upgrade broke STACK, now getting "CASText failed validation. TIMEDOUT dumped"

by Susan Mangan -
 
This is way above my paygrade - lol. I am getting the exact same errors Tom Smith reported.
 
In response to:
 
To resolve this issue, please delete the old optimized maxima image and instead set "qtype_stack | platform" to "Linux". Please ensure that the correct maxima version is selected in "qtype_stack | maximaversion" and that "qtype_stack | maximacommand" has the correct value (in most cases STACK will guess correctly if left empty).
 
Settings are as follows:
qtype_stack | platform = Linux
qtype_stack | maximaversion = 5.44

Upon running the Healthcheck-Script, you should find an option to automatically create a new optimized image at the very bottom. I have observed newer versions of STACK performing this task automatically during the plugin upgrade process.
 
I have cleared the cache and clicked on the button Create Maxima Image which returns: stack_ast_container: tried to get the value from of an unevaluated casstring.

If these steps fail to solve your problem, please provide more information.
 
I'm not sure what other information I can provide? We did have this working previously - I believe it was before the upgrade to 3.9.
 
 
In reply to Susan Mangan

Re: Major upgrade broke STACK, now getting "CASText failed validation. TIMEDOUT dumped"

by Thorsten Bartel -
Picture of Core developers
I can see how you might be overwhelmed by this issue if administration of server-level applications is not what you're usually doing.
The "easiest" way to circumvent your problem is most likely to install an older version of Maxima and/or build the Maxima image manually as described above.
You could also check using a different lisp implementation: Tom's error message suggests he's using GCL - if this is also the case for you, a switch to CLISP might be worth a try.

As you're running Maxima 5.44 on Linux, I'm assuming you're using a distribution I'm not intimately familiar with. Also, if this is something you're having troubles resolving by yourself, you should involve the person administrating your servers and check whether you can run tests with downgrading Maxima / manually building an image under their guidance / with their assistance.

The steps to troubleshoot this problem beyond the advice I provided here are much too small to be feasibly made without hands-on assistance and direct access to the server environment.

Wish you the best with overcoming this problem!
Cheers
In reply to Thorsten Bartel

Re: Major upgrade broke STACK, now getting "CASText failed validation. TIMEDOUT dumped"

by Susan Mangan -
Thank you very much for your reply. That is what we were trying to do (myself and our web systems administrator) but downgrading does not seem to be an easy task as each time he tried there was another dependency which kept leading him down a rabbit hole.

We running RH8 - I wonder if anyone who reads this has a working solution with either 5.44 or 5.41 could they confirm what distro they used?
In reply to Susan Mangan

Re: Major upgrade broke STACK, now getting "CASText failed validation. TIMEDOUT dumped"

by Thorsten Bartel -
Picture of Core developers
That's an easy one: We're running Ubuntu 18.04 LTS and 20.04 LTS (different servers). Both had no issues with Maxima 5.41.