"Load into Scilab" hangs in Scilab-6
A powerful editor and graphical debugger for code written in Scilab
Brought to you by:
ensegre,
fvogelnew1
Diff:
Developer-level analysis and notes:
Ths problem does not depend on the content of the Scipad buffer, on whether it is a .sce (level 0 Scilab code) or a .sci (Scilab functions) file, or on whether or not the file in the Scipad buffer contains unsaved changes.
Tracing execution of the Scipad code shows that the hang happens in proc ScilabEval_lt, the following ScilabEval call simply does not return:
When using "Load into Scilab" (Ctrl-l) on a previously saved file, in my tests C:\Users\francois\Desktop\testfile.sce the Tcl ScilabEval command executed from the scipad Tcl interpreter is exactly:
This command does not return in Scilab-6 (only). The Tcl interpreter "scipad" does not see the command return, however Scilab is responsive as normal.
Some datapoints:
or even with:
which is the same (execfile) as what is launched when selecting "Load into Scilab" from the menu in Scipad.
If the "sync" argument is removed in proc execfile, and only "seq" is kept, then there is no hang. Of course in this case, the error trapping (catch) mechanism in place in proc execfile can no longer work since ScilabEval now returns immediately before waiting for execution of the ScialbEvaled command.
If the "seq" argument is removed in proc execfile, and only "sync" is kept, then the hang persists.
There are other ScilabEval commands with the "sync" and "seq" options that are run during the Scipad startup phase without hanging.
If "exec(...)" is replaced by another command such as "disp(...)" in proc execfile, the hang persists.
If exec("C:/Users/francois/Desktop/testfile.sce"); in proc execfile is replaced by a preliminary cd {C:/Users/francois/Desktop/} and ScilabEval only runs exec("testfile.sce"); (in sync seq mode), then the hang persists.
If exec("C:/Users/francois/Desktop/testfile.sce"); in proc execfile is replaced by just a ; that is ScilabEval only runs ; (in sync seq mode), then the hang persists. The content of what is ScilabEval'ed is therefore not relevant.
When the Scipad hang happened, the file content was already exec'ed in Scilab. The file content is known to Scilab.
When the Scipad hang happened, exiting Scilab by typing 'quit' at the prompt restores responsivity of Scipad, but hangs Scilab. Looks like a deadlock.
When the Scipad hang happened, exiting Scilab by clicking on its window closure cross exits Scilab and restores responsivity of Scipad (Scipad does not exit). If "Load into Scilab" is executed once more at this point, the Scipad hang happens again: the Scilab engine is still in the background, only the Scilab window got closed.
There is no hang with:
which should be the same as when the user hits Control-l in Scipad. Obviously there must be a difference since the above command does not hang while hitting Control-l in Scipad does hang.
at the end of scipad.tcl produces the hang. The fact the user runs the command through a binding is therefore not the cause.
At this point I'm lacking ideas about how to debug this further.
Last edit: Francois VOGEL 2019-11-24