Running Matlab (R) from ssh session with X forwarding doesn't work anymore in 17.10

Bug #1726595 reported by thomas duriez
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xorg-server (Ubuntu)
New
Undecided
Unassigned

Bug Description

OBSERVED BEHAVIOR:
Matlab stays in busy state when using some functions like "plot" or even "exit", while executing through a ssh tunnel with X11 forwarding.

REPRODUCE THE BUG:

You need matlab (my version is R2017a) to reproduce the bug. I suspect any version >= 2014b would reproduce the bug (HG2 framework), and maybe any version.

1. Connect to self (or from other machine) with X forwarding:
$ ssh -X user@localhost

2. Launch matlab
$ matlab &

3. Plot something
>> plot(1,1)

ADDITIONAL INFORMATION
- Normal behavior would be appearance of a new window and a single point at position (1,1).
- No ressources seem to be used.
- Opening a figure alone is possible. (>> figure). Opening other windows from the graphical user interface is possible
- Opening Matlab without the java machine seems to work, but matlab relies heavily on java. At least "exit" which doesn't work with java, works without java.
- Providing Matlab with open-jdk version 1.8.0_144 didn't change anything.
- This used to work perfectly for as long as I have been using Ubuntu (since 2012).

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: openssh-client 1:7.5p1-10
ProcVersionSignature: Ubuntu 4.13.0-16.19-generic 4.13.4
Uname: Linux 4.13.0-16-generic x86_64
ApportVersion: 2.20.7-0ubuntu3
Architecture: amd64
CurrentDesktop: Unity:Unity7:ubuntu
Date: Mon Oct 23 17:44:23 2017
ExecutablePath: /usr/bin/ssh
InstallationDate: Installed on 2017-08-25 (59 days ago)
InstallationMedia: Ubuntu 16.04.1 LTS "Xenial Xerus" - Release amd64 (20160719)
RelatedPackageVersions:
 ssh-askpass N/A
 libpam-ssh N/A
 keychain N/A
 ssh-askpass-gnome N/A
SSHClientVersion: OpenSSH_7.5p1 Ubuntu-10, OpenSSL 1.0.2g 1 Mar 2016
SourcePackage: openssh
UpgradeStatus: Upgraded to artful on 2017-10-23 (0 days ago)
modified.conffile..etc.ssh.ssh_config: [modified]
mtime.conffile..etc.ssh.ssh_config: 2017-10-23T16:25:50.569560

Revision history for this message
thomas duriez (thomas-duriez-gmail) wrote :
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Are you using Wayland? If yes, can you try with plain Xorg? To switch to xorg, logout, and on the login screen, after clicking on your name, you will see a small gear icon. Click that to select xorg, and then continue with the login.

Changed in openssh (Ubuntu):
status: New → Incomplete
Revision history for this message
thomas duriez (thomas-duriez-gmail) wrote :

Dear Andreas,

It was tried in all three modes.
Furthermore how do I enforce Xorg when I log from another machine (in my case a windows running Xming) to this one ?
I suspect once I connect through ssh with X11 forwarding, the session is Xorg.

Thanks for your time.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I meant in the ssh localhost test case that you showed. But still, even in the remote case, the "X server" would be your local machine and the X api calls from matlab would be routed to your local X server (wayland or xorg) through the ssh connection.

So, just to clarify, matlab works on your localhost when ssh is not used? I.e., just opening a terminal and running "matlab" followed by the plot command?

And if you repeat the above but first do a "ssh -X localhost", i.e., the DISPLAY variable is something other than just ":0", then it doesn't work?

Both scenarios above stay the same regardless if you are using wayland or xorg in Ubuntu Artful?

Revision history for this message
thomas duriez (thomas-duriez-gmail) wrote :

1- Yes Matlab works as expected without going through ssh.

2- Repeat the above but first do a "ssh -X localhost" triggers the problem.

3- Both scenarios hold regardless of how I login ("Ubuntu", "Ubuntu on Xorg" or "Unity").

As you mentionned the DISPLAY variable I checked the following (maybe it was obvious, but not to me):
     - ssh@localhost
     - echo $DISPLAY returns localhost:10.0
     - export DISPLAY=:0
     - matlab & then plot(1,1).
     - it works. (tested in "Ubuntu", "Ubuntu on Xorg" and "Unity")

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Most curious. It would be of tremendous help if you could find another application that behaves like that, one that is opensource and part of the ubuntu archive preferably.

DISPLAY being set to, for example, localhost:10.0, is indicating that the X alls are going through ssh in that particular case. It's setup by the -X parameter.

Revision history for this message
thomas duriez (thomas-duriez-gmail) wrote :

I will try. For the moment I double boot 16.04 because I need to have it working, but I can run tests on spare time. Because I couldn't find problems when not running the java machine of Matlab I will focus on applications relying heavily on java. If you have any suggestion it would help. Thanks again for your time.

Revision history for this message
Andreas Hasenack (ahasenack) wrote : Re: [Bug 1726595] Re: Running Matlab (R) from ssh session with X forwarding doesn't work anymore in 17.10

Ah, Java, I hadn't realised that. I have a couple a
I can try too with ssh -X.

On Oct 25, 2017 12:31, "thomas duriez" <email address hidden> wrote:

> I will try. For the moment I double boot 16.04 because I need to have it
> working, but I can run tests on spare time. Because I couldn't find
> problems when not running the java machine of Matlab I will focus on
> applications relying heavily on java. If you have any suggestion it
> would help. Thanks again for your time.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1726595
>
> Title:
> Running Matlab (R) from ssh session with X forwarding doesn't work
> anymore in 17.10
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/
> 1726595/+subscriptions
>

Revision history for this message
thomas duriez (thomas-duriez-gmail) wrote :

As a matter of fact, I just checked the bug happens with scilab, available in universe. Scilab returns some interesting debug info in the standard output, which O copy in the attached text file.

NEW INFO.

I didn't see before that matlab was generating a crash log for this. This log confirms that the error comes from java:
"Assertion in void {anonymous}::mwJavaAbort() at javainit.cpp line 1411:
Fatal Java Exception. See Java Crash Report for details."

The java crash report gives the following:

 Operating System: Linux 4.10.0-37-generic #41-Ubuntu SMP Fri Oct 6 20:20:37 UTC 2017 x86_64
  Processor ID: x86 Family 6 Model 60 Stepping 3, GenuineIntel
  Host Name: XXXXXXXX
FATAL ERROR in native method: Nativewindow X11 IOError: Display 0x7fb2cb9e5210 (localhost:10.0): Resource temporarily unavailable
 at sun.awt.X11.XlibWrapper.XEventsQueued(Native Method)
 at sun.awt.X11.XToolkit.run(Unknown Source)
 at sun.awt.X11.XToolkit.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)

Which says that X11 is at fault.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Interesting:
Exception in thread "AWT-EventQueue-1" com.jogamp.opengl.GLException: Caught GLException: AWT-EventQueue-1: createImpl ARB n/a but required, profile > GL2 requested (OpenGL >= 3.1). Requested: GLProfile[GL3bc/GL3bc.sw], current: 3.0 (Compat profile, compat[ES2], FBO, software) - 3.0 Mesa 17.2.2

So something to do with opengl over remote X11 connections. I'll switch the bug over to wayland, and maybe add a xorg task

affects: openssh (Ubuntu) → wayland (Ubuntu)
Changed in wayland (Ubuntu):
status: Incomplete → New
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

"wayland" is just the protocol library, so not the right place to file this.

The xorg-server package covers both native Xorg servers and Xwayland so filing there... until someone finds somewhere more appropriate.

affects: wayland (Ubuntu) → xorg-server (Ubuntu)
Revision history for this message
Lorenzo Delana (ldelana) wrote :

I have similar problem explained through attachment video, that happens when I focus opened window by through x11 forwarding using ssh and then I cannot raise up any of already opened window from the dock.

Steps to reproduce:
- open a gnome terminal so that it happears on the side dock
- xhost +somehost ; ssh -X somehost
- run some gui app and maximize
- click on the window opened by the app so that it got focus
- bug here: now click on terminal on dock and an alert message indicate that is ready but it cannot raise even with a second click

Workaround:
- click on the x11 forwarded app titlebar
- click on terminal or other app available on the dock
- the requested app window now raises

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

this was fixed in libjogl2-java 2.3.2+dfsg-6

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.