octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #59044] octave session terminates prematurely


From: anonymous
Subject: [Octave-bug-tracker] [bug #59044] octave session terminates prematurely inside of tmux
Date: Sun, 30 Aug 2020 23:48:50 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36

URL:
  <https://savannah.gnu.org/bugs/?59044>

                 Summary: octave session terminates prematurely inside of tmux
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Mon 31 Aug 2020 03:48:48 AM UTC
                Category: Performance
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Other
                  Status: None
             Assigned to: None
         Originator Name: Calvin Eiber
        Originator Email: ceiber@unimelb.edu.au
             Open/Closed: Open
                 Release: 4.2.2
         Discussion Lock: Any
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Hello all, 


I'm running GNU Octave, version 4.2.2 on a remote server (Ubuntu
4.15.0-76-generic). 

I've encountered the problem that octave sessions inside of tmux get
prematurely terminated when I close the ssh connection (I'm using mobaXterm
v20.3 as my ssh client). This is true whether I invoke octave with or without
the gui, or whether I try to eval my code using $ octave -i my_script.m or $
octave -i -eval 'my_script args'

I can escape my tmux session using ^b,d and return to it and the process isn't
interrupted, but if I close mobaXterm (inside or outside the tmux session) my
currently running octave function is terminated with no explanation or output.


observed output (example, this all worked fine): 


home/octave $ tmux new -s 'tmux-octave-ses'
     [tmux] $ ls
'my_script.m' 

     [tmux] $ octave --eval 'my_script 1'
... wait a couple seconds

     [tmux] $ ls
'my_script.m' 'it-worked (1).mat'

     [tmux] $ octave  -i --eval 'my_script 11'
... (exit tmux session using ^b,d) 

home/octave $ tmux ls
tmux-octave-ses:  1 windows (created Mon Aug 31 02:25:51 2020) [110x51]

... wait about 12 seconds
home/octave $ ls 
'my_script.m' 'it-worked (1).mat' 'it-worked (11).mat'
home/octave $ tmux attach -t tmux-octave-ses

   [tmux] 
GNU Octave, version 4.2.2
Copyright (C) 2018 John W. Eaton and others.
This is free software; see the source code for copying conditions. ...
warrenty, yadda yadda, ... 
For information about changes from previous versions, type 'news'.

 [11 / 11 s] ...  done!


So that all works fine, but if I for instance reset my ssh connection: 


     [tmux] $ octave --eval 'my_script 100'
... wait a couple seconds

GNU Octave, version 4.2.2
Copyright (C) 2018 John W. Eaton and others.
This is free software; see the source code for copying conditions. ...
warrenty, yadda yadda, ... 
For information about changes from previous versions, type 'news'.
 [2 / 100 s] ... 

... (exit tmux session using ^b,d) 
... (and then close mobaXterm) 



And then reconnect: 

home/octave $ tmux ls
tmux-octave-ses: 1 windows (created Mon Aug 31 02:25:51 2020) [110x51]
home/octave $ tmux attach -t tmux-octave-ses

GNU Octave, version 4.2.2
Copyright (C) 2018 John W. Eaton and others.
This is free software; see the source code for copying conditions. ...
warrenty, yadda yadda, ... 
For information about changes from previous versions, type 'news'.
 [14 / 100 s] ... 
    [tmux] $ 


So the octave process is obviously killed when I close the ssh connection,
which tmux is supposed to prevent. 

Interestingly, if I'm polite and close the connection using $ exit (outside of
tmux), it waits for octave to finish before exiting (which again is not the
desired behavior, as the code I intend to run has runtimes of hours to days). 


IS this an issue with the command-line instruction I'm passing to octave? if
so, what are the appropriate flags to preserve the octave instance beyond the
duration of the ssh connection? 


demo example script: 

function my_script(tDelay_s)
if nargin == 0, tDelay_s = 10; end
if ischar(tDelay_s), tDelay_s = str2double(tDelay_s); end
s = ''; 

for tt = 1 : tDelay_s

  fprintf('%s',char(8*ones(size(s))))
  s = sprintf(' [%d / %d s] ... ', tt, tDelay_s);
  fprintf('%s',s)

  pause(1)
end
fprintf('done!\n')
save(sprintf('it-worked (%d).mat',tt), 'tt')
return









tmux version is 2.6-3ubuntu0.2 amd64




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59044>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]