bugGNU Octave - Bugs: bug #49729, octave in background dies when...

 
 

bug #49729: octave in background dies when disconnecting ssh

Submitter:  Muhali <muhali>
Submitted:  Mon 28 Nov 2016 09:57:03 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 13 Jun 2017 05:19:09 PM UTC, comment #5: 

Yes, Octave 3.8 runs octave-cli by default, Octave 4.0 and newer runs octave-gui by default (if an X server is available). Octave-gui runs as a QApplication, and Qt's event loop probably doesn't like it when the X server connection disappears from underneath it.

If you want Octave to not rely on a persistent active X server, use "octave -W" or "octave --no-gui-libs" or "octave-cli".

Mike Miller <mtmiller>
Group Member
Tue 13 Jun 2017 12:46:23 PM UTC, comment #4: 

I got a little closer now. The reason is X11 forwarding. Apparently, older versions such as octave-3.8 do not crash when the X-channel is closed. Newer versions (>= 4.0) do:

%> ssh -X some.host
  %some.host> nohup octave --no-gui foo.m &
  %some.host> logout
%> ssh -X some.host
  %some.host> tail -1 nohup.out
  %some.host> panic: Segmentation fault -- stopping myself...

Note that the logout hangs and has to be interrupted with "^C". By using "-x" instead nothing hangs and no segfault occurs.

Why does the newer octave depend on the X11 channel, and is it intended?

Muhali <muhali>
Thu 15 Dec 2016 10:31:26 AM UTC, comment #3: 

just noticed that I get the same behaviour on a non-systemd machine. When starting instead a looping bash script similar to the octave script here, I can log off and on without interrupting that script. Not so for the octave script, so something peculiar with octave is indeed happening.

Muhali <muhali>
Tue 29 Nov 2016 07:35:56 AM UTC, comment #2: 

yeah, systemd was the culprit.

The debian bug report suggests to set

KillUserProcesses=no

in /etc/systemd/logind.conf, which didn't work for me. But replacing nohup with the systemd-run command did work.

Thanks!

Muhali <muhali>
Mon 28 Nov 2016 10:31:51 PM UTC, comment #1: 

Are you sure this is an Octave bug? Are you able to run any other processes under nohup and verify that they are still running after logging out? Could this be related to a systemd update (see e.g. https://bugs.debian.org/825394)?

Mike Miller <mtmiller>
Group Member
Mon 28 Nov 2016 09:57:03 PM UTC, original submission:  

I often put octave jobs in the background and then disconnect the ssh session. This used to work fine.

Since a few weeks, e.g. with the current dev version, this no longer works. For example, when starting the script


# foo.m
while true
pause(2) ;
strftime("%T", localtime(time))
endwhile


via

%> nohup octave --no-gui -f foo.m &

and then disconnect and reconnect the ssh session, octave has died on the remote machine. With more complicated scripts, I even get a segfault.

Muhali <muhali>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by muhali (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-29 mtmiller StatusNeed Info Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2016-11-28 mtmiller StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code