Menu

#17 "Load into Scilab" hangs in Scilab-6

open
None
Bug
mandatory
non-debugger
windows
scilab6.x
always
2019-11-11
2019-11-11
No

"Load into Scilab" hangs Scipad in Scilab-6.

It is working as expected in any other environment, for instance in Scilab-5.5.2.

This was reported in the mailing list for Win10 with Scipad-8.76

Discussion

  • Francois VOGEL

    Francois VOGEL - 2019-11-11
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,4 @@
    -"Load into Scilab" hangs in Scilab-6.
    +"Load into Scilab" hangs Scipad in Scilab-6.
    
     It is working as expected in any other environment, for instance in Scilab-5.5.2.
    
     
  • Francois VOGEL

    Francois VOGEL - 2019-11-11

    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:

        ScilabEval $comm $opt1 $opt2
    

    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:

       ScilabEval exec("C:/Users/francois/Desktop/testfile.sce"); sync seq
    

    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:

    • Executing the same command from Scilab-6 instead of from the Tcl interpreter works, i.e. there is no hang with:
      TCL_EvalStr("ScilabEval ""exec(\""C:/Users/francois/Desktop/testfile.sce\"");"" ""sync"" ""seq"" ","scipad")
    

    or even with:

    TCL_EvalStr("execfile","scipad")
    

    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:

    TCL_EvalStr("focus -force $pad ; event generate $pad <Control-l>","scipad")
    

    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.

    • Running 'execfile' 1 minute after Scipad has finished starting hangs, that is, adding:
    after 60000 execfile
    

    at the end of scipad.tcl produces the hang. The fact the user runs the command through a binding is therefore not the cause.

    • From all the above observations, it looks like the "sync" option of ScilabEval works correctly in Scilab-6 when called from Scipad during the startup phase of Scipad. Adding a ScilabEval_lt ";" sync seq at the very end of scipad.tcl does not hang. However the "sync" option of ScilabEval hangs when called from Scipad after the startup phase is fully finished, but the same works when called from Scilab-6.

    At this point I'm lacking ideas about how to debug this further.

     

    Last edit: Francois VOGEL 2019-11-24

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.