gama-platform / gama.old

Main repository for developing the 1.x versions of GAMA
GNU General Public License v3.0
302 stars 99 forks source link

Missing lib for 2D graphs on Linux GAMA 1.8.2 w/ JDK build #3119

Closed RoiArthurB closed 2 years ago

RoiArthurB commented 3 years ago

Missing library on GAMA 1.8.2 with JDK on Linux happening on java2D and charts display :

-- Surface bounds set to 0  0 | 1339 871
org.eclipse.swt.SWTError: Unspecified error [Error while starting AWT] (java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
    /home/roiarthurb/.local/share/GAMA_1.8.2_Linux_with_JDK/configuration/org.eclipse.osgi/161/0/.cp/libswt-awt-gtk-4942r22.so: /home/roiarthurb/.local/share/GAMA_1.8.2_Linux_with_JDK/jdk/lib/libjawt.so: version `SUNWprivate_1.1' not found (required by /home/roiarthurb/.local/share/GAMA_1.8.2_Linux_with_JDK/configuration/org.eclipse.osgi/161/0/.cp/libswt-awt-gtk-4942r22.so)
    no swt-awt-gtk in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
    /home/roiarthurb/.swt/lib/linux/x86_64/libswt-awt-gtk-4942r22.so: /home/roiarthurb/.local/share/GAMA_1.8.2_Linux_with_JDK/jdk/lib/libjawt.so: version `SUNWprivate_1.1' not found (required by /home/roiarthurb/.swt/lib/linux/x86_64/libswt-awt-gtk-4942r22.so)
    Can't load library: /home/roiarthurb/.swt/lib/linux/x86_64/libswt-awt-gtk.so
    /home/roiarthurb/.swt/lib/linux/x86_64/libswt-awt-gtk-4942r22.so: /home/roiarthurb/.local/share/GAMA_1.8.2_Linux_with_JDK/jdk/lib/libjawt.so: version `SUNWprivate_1.1' not found (required by /home/roiarthurb/.swt/lib/linux/x86_64/libswt-awt-gtk-4942r22.so)
)
    at org.eclipse.swt.SWT.error(SWT.java:4915)
    at org.eclipse.swt.awt.SWT_AWT.new_Frame(SWT_AWT.java:166)
    at ummisco.gama.java2d.swing.SwingControl.populate(SwingControl.java:71)
    at ummisco.gama.java2d.swing.SwingControl.setBounds(SwingControl.java:104)
    at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:697)
    at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:201)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1851)
    at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1635)
    at org.eclipse.swt.widgets.Control.setBounds(Control.java:1023)
    at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:697)
    at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:201)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1851)
    at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1635)
    at org.eclipse.swt.widgets.Control.setBounds(Control.java:983)
    at org.eclipse.swt.custom.SashFormLayout.layout(SashFormLayout.java:110)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1851)
    at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1635)
    at org.eclipse.swt.widgets.Control.setBounds(Control.java:1023)
    at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:697)
    at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:201)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1851)
    at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1635)
    at org.eclipse.swt.widgets.Control.setBounds(Control.java:1023)
    at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:697)
    at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:201)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1851)
    at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1635)
    at org.eclipse.swt.widgets.Control.setBounds(Control.java:1023)
    at org.eclipse.swt.layout.FillLayout.layout(FillLayout.java:231)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1851)
    at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1635)
    at org.eclipse.swt.widgets.Control.setBounds(Control.java:1023)
    at org.eclipse.swt.layout.FillLayout.layout(FillLayout.java:231)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1851)
    at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1635)
    at org.eclipse.swt.widgets.Control.setBounds(Control.java:1023)
    at org.eclipse.swt.layout.FillLayout.layout(FillLayout.java:216)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1851)
    at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1635)
    at org.eclipse.swt.widgets.Control.setBounds(Control.java:983)
    at org.eclipse.swt.custom.CTabFolderLayout.layout(CTabFolderLayout.java:119)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1851)
    at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1635)
    at org.eclipse.swt.widgets.Control.setBounds(Control.java:983)
    at org.eclipse.e4.ui.workbench.renderers.swt.SashLayout.setRectangle(SashLayout.java:315)
    at org.eclipse.e4.ui.workbench.renderers.swt.SashLayout.tileSubNodes(SashLayout.java:260)
    at org.eclipse.e4.ui.workbench.renderers.swt.SashLayout.tileSubNodes(SashLayout.java:303)
    at org.eclipse.e4.ui.workbench.renderers.swt.SashLayout.tileSubNodes(SashLayout.java:303)
    at org.eclipse.e4.ui.workbench.renderers.swt.SashLayout.tileSubNodes(SashLayout.java:303)
    at org.eclipse.e4.ui.workbench.renderers.swt.SashLayout.layout(SashLayout.java:178)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1851)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1857)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1857)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1857)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1857)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1857)
    at org.eclipse.swt.widgets.Composite.setLayoutDeferred(Composite.java:1694)
    at org.eclipse.swt.widgets.Display.runDeferredLayouts(Display.java:5116)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4557)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
    at msi.gama.application.Application.start(Application.java:143)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1461)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1434)
Caused by: java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
    /home/roiarthurb/.local/share/GAMA_1.8.2_Linux_with_JDK/configuration/org.eclipse.osgi/161/0/.cp/libswt-awt-gtk-4942r22.so: /home/roiarthurb/.local/share/GAMA_1.8.2_Linux_with_JDK/jdk/lib/libjawt.so: version `SUNWprivate_1.1' not found (required by /home/roiarthurb/.local/share/GAMA_1.8.2_Linux_with_JDK/configuration/org.eclipse.osgi/161/0/.cp/libswt-awt-gtk-4942r22.so)
    no swt-awt-gtk in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
    /home/roiarthurb/.swt/lib/linux/x86_64/libswt-awt-gtk-4942r22.so: /home/roiarthurb/.local/share/GAMA_1.8.2_Linux_with_JDK/jdk/lib/libjawt.so: version `SUNWprivate_1.1' not found (required by /home/roiarthurb/.swt/lib/linux/x86_64/libswt-awt-gtk-4942r22.so)
    Can't load library: /home/roiarthurb/.swt/lib/linux/x86_64/libswt-awt-gtk.so
    /home/roiarthurb/.swt/lib/linux/x86_64/libswt-awt-gtk-4942r22.so: /home/roiarthurb/.local/share/GAMA_1.8.2_Linux_with_JDK/jdk/lib/libjawt.so: version `SUNWprivate_1.1' not found (required by /home/roiarthurb/.swt/lib/linux/x86_64/libswt-awt-gtk-4942r22.so)

    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:338)
    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:257)
    at org.eclipse.swt.awt.SWT_AWT.loadLibrary(SWT_AWT.java:77)
    at org.eclipse.swt.awt.SWT_AWT.new_Frame(SWT_AWT.java:162)
    ... 79 more
-- Surface bounds set to 0  0 | 1339 889
-- Surface bounds set to 0  0 | 1339 889
java.lang.UnsatisfiedLinkError: 'java.lang.Object org.eclipse.swt.awt.SWT_AWT.initFrame(long, java.lang.String)'
    at org.eclipse.swt.awt.SWT_AWT.initFrame(Native Method)
    at org.eclipse.swt.awt.SWT_AWT.new_Frame(SWT_AWT.java:170)
    at ummisco.gama.java2d.swing.SwingControl.populate(SwingControl.java:71)
    at ummisco.gama.java2d.swing.SwingControl.setBounds(SwingControl.java:104)
    at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:697)
    at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:201)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1851)
    at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1635)
    at org.eclipse.swt.widgets.Control.setBounds(Control.java:1023)
    at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:697)
    at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:201)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1851)
    at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1635)
    at org.eclipse.swt.widgets.Control.setBounds(Control.java:983)
    at org.eclipse.swt.custom.SashFormLayout.layout(SashFormLayout.java:110)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1851)
    at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1635)
    at org.eclipse.swt.widgets.Control.setBounds(Control.java:1023)
    at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:697)
    at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:201)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1851)
    at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1635)
    at org.eclipse.swt.widgets.Control.setBounds(Control.java:1023)
    at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:697)
    at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:201)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1851)
    at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1635)
    at org.eclipse.swt.widgets.Control.setBounds(Control.java:1023)
    at org.eclipse.swt.layout.FillLayout.layout(FillLayout.java:231)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1851)
    at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1635)
    at org.eclipse.swt.widgets.Control.setBounds(Control.java:1023)
    at org.eclipse.swt.layout.FillLayout.layout(FillLayout.java:231)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1851)
    at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1635)
    at org.eclipse.swt.widgets.Control.setBounds(Control.java:1023)
    at org.eclipse.swt.layout.FillLayout.layout(FillLayout.java:216)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1851)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1857)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1857)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1857)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1857)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1857)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1857)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1857)
    at org.eclipse.swt.widgets.Composite.setLayoutDeferred(Composite.java:1694)
    at org.eclipse.swt.widgets.Display.runDeferredLayouts(Display.java:5116)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4557)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
    at msi.gama.application.Application.start(Application.java:143)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1461)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1434)
Tree root = horizontal weight null
-- Surface bounds set to 0  0 | 667 871
-- Surface bounds set to 0  0 | 667 871
-- Surface bounds set to 0  0 | 667 889
-- Surface bounds set to 0  0 | 667 889

Originally posted by @RoiArthurB in https://github.com/gama-platform/gama/issues/3090#issuecomment-865508619

minhduc0711 commented 3 years ago

Huh, java2D on my machine works fine. Which model did you try?

RoiArthurB commented 3 years ago

@minhduc0711 The last build of GAMA 1.8.2 with JDK ? Otherwise, the git and the built without JDK both works fine to me ! :)

minhduc0711 commented 3 years ago

Ah sorry, I just ran the release version and have the same issue. I suppose something is wrong with the embedded JDK.

RoiArthurB commented 3 years ago

To display (it's the same with any java2D displays, just have to replace opengl in any toymodel) the problem, here's running the Library Moel/Visualization and User Interaction/Visualization/Charts/models/Distribution.gaml

2021-06-22-144538_1920x1080_scrot

ndgnuh commented 3 years ago

image

Just confirming the bug

ndgnuh commented 3 years ago

It didn't work for me in git build. I saw someone posted the same log on StackOverflow saying that this was caused by mixing AWT with SWT? I'm not sure, just hope this is not due to the previous patch on OpenGL, somehow.

https://stackoverflow.com/questions/56201672/how-to-insert-swing-widget-into-swt-i-get-exception-in-thread-main-java-lang-i

Edit: There seems to be a memory leak when running simulation for a long time, too. image

RoiArthurB commented 2 years ago

As said previously, the java2D issue appears only on the version with the Embedded JDK. Maybe we can try to update the JDK version to resolve this issue (the JDK is older than the Eclipse version) :

$ # Embedded JDK 15 version       
$ ./GAMA_1.8.2_Alpha_withJDK_Linux_09.10.21_ead98a2a/jdk/bin/java -version
java version "15.0.1" 2020-10-20
Java(TM) SE Runtime Environment (build 15.0.1+9-18)
Java HotSpot(TM) 64-Bit Server VM (build 15.0.1+9-18, mixed mode, sharing)

$ # My default JDK 15 version                                                             
$ java -version
openjdk version "15.0.2" 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 15.0.2+7)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 15.0.2+7, mixed mode, sharing)

If using this solution, we can use the latest released version from the Github Repo instead of freezing one version on our server (same as what Github Action is doing, which makes it use the exact same version as my laptop)

ndgnuh commented 2 years ago

@AlexisDrogoul We've found the problem traces back to the versions of Jogl and JDK and. We need your help with that.

So these are what we discussed and some related search results:

AlexisDrogoul commented 2 years ago

JOGL is already 2.4.0 (otherwise nothing would work). And it is normally not involved in the Java2D processes... Have you tried the simple solution of building GAMA without the OpenGL plugin ? To see if the problem persists ?

RoiArthurB commented 2 years ago

I trigger a new build, please feel free to test this issue with the new JDK :)

EDIT : New build works for me :+1: