Bug 561 - UnsatisfiedLinkError in x11.X11Lib.XineramaEnabled for Intel GM965/GL960 on Linux 32-bit
Summary: UnsatisfiedLinkError in x11.X11Lib.XineramaEnabled for Intel GM965/GL960 on L...
Alias: None
Product: Jogl
Classification: JogAmp
Component: x11 (show other bugs)
Version: 2
Hardware: pc_x86_32 linux
: --- normal
Assignee: Sven Gothel
Depends on:
Reported: 2012-03-08 15:38 CET by Wade Walker
Modified: 2012-03-18 22:10 CET (History)
1 user (show)

See Also:
Type: ---
SCM Refs:
Workaround: ---

Log file with debugging turned on (56.96 KB, text/plain)
2012-03-08 15:40 CET, Wade Walker
Another log file with debugging turned on (58.59 KB, text/plain)
2012-03-12 16:24 CET, Barbara
Log file with debugging turned on using new JOGL version (238.45 KB, text/x-log)
2012-03-14 07:05 CET, Barbara
Another log file after adding "jogl-all-natives-linux-i586.jar" file (206.91 KB, text/x-log)
2012-03-14 08:14 CET, Barbara

Note You need to log in before you can comment on or make changes to this bug.
Description Wade Walker 2012-03-08 15:38:29 CET
It appears that with Intel graphics on Ubuntu, Xinerama is not installed, so we get an UnsatisfiedLinkError when we try to check for it. This bug was originally reported on my blog comments, and I've reported it here after gathering some more information.

System description:
- Ubuntu 11.10
- Intel GM965/GL960 (set up with xserver-xorg-video-intel)
- Platform: LINUX / Linux 3.0.0-16-generic (os), i386 (arch) 2 cores
- Platform: Java Version: 1.6.0_26, VM: Java HotSpot(TM) Server VM, Runtime: Java(TM) SE Runtime Environment
Comment 1 Wade Walker 2012-03-08 15:40:10 CET
Created attachment 333 [details]
Log file with debugging turned on

This command generated the log:

java -Dsun.java2d.noddraw=true -Dsun.java2d.opengl=false -Djava.library.path=lib -Djogamp.debug=all -Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all -classpath jar/gluegen-rt.jar:jar/jogl.all.jar javax.media.opengl.awt.GLCanvas > & jogl-debug.log
Comment 2 Wade Walker 2012-03-08 15:47:54 CET
This is probably due to an Intel driver bug -- looking in our XineramaHelper.c file, it looks like we only call XineramaIsActive if X reports that the extension is present.

  static const char* XinExtName = "XINERAMA";
  int32_t major_opcode, first_event, first_error;
  Bool gotXinExt = False;
  Bool isXinActive = False;

  gotXinExt = XQueryExtension(display, XinExtName, &major_opcode,
                              &first_event, &first_error);
  if (gotXinExt) {
    isXinActive = XineramaIsActive(display);
Comment 3 Barbara 2012-03-12 16:24:13 CET
Created attachment 334 [details]
Another log file with debugging turned on

Here another log file produced with the same command as the one already posted but on another computer.

java -Dsun.java2d.noddraw=true -Dsun.java2d.opengl=false
-Djava.library.path=lib -Djogamp.debug=all -Dnativewindow.debug=all
-Djogl.debug=all -Dnewt.debug=all -classpath
jar/gluegen-rt.jar:jar/jogl.all.jar javax.media.opengl.awt.GLCanvas > &

System description:
- Debian 5.0 Lenny
- nVidia Corporation GT218 [NVS 3100M] 
- Platform: LINUX / Linux 2.6.32-5-686 (os), i386 (arch) 4 cores
- Platform: Java Version:1.6.0_18, VM: OpenJDK Server VM, Runtime: OpenJDK Runtime Environment
Comment 4 Wade Walker 2012-03-12 23:10:47 CET
This looks like the same error. I'm setting up a 32-bit Ubuntu environment right now, so I'll try to build a version of JOGL for you that has some additional debugging code uncommented, to make sure we know the true cause of the bug (i.e. to make sure I'm not misreading this error log).
Comment 5 Wade Walker 2012-03-14 02:07:33 CET
I built a custom version of JOGL in 32-bit Ubuntu (in a VM) with some fprintf calls uncommented in XineramaHelper.c, and sent it to Barbara via email. When she runs it, we should be able to see in the log if the code is dying when it tries to load the Xinerama library.
Comment 6 Barbara 2012-03-14 07:05:52 CET
Created attachment 335 [details]
Log file with debugging turned on using new JOGL version

This log file was generated using following command and version of JOGL that Wade had sent me:

java -Dsun.java2d.noddraw=true -Dsun.java2d.opengl=false -Djava.library.path=lib -Djogamp.debug=all -Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all -classpath jar/gluegen-rt.jar:jar/jogl.all.jar javax.media.opengl.awt.GLCanvas >& jogl-debug.log

Again, it ran on the Linux amd64 with Intel graphic card with already above mentioned specification.
Comment 7 Barbara 2012-03-14 08:14:07 CET
Created attachment 336 [details]
Another log file after adding "jogl-all-natives-linux-i586.jar" file

After I saw the log file I added the jogl-all-natives-linux-i586.jar manually (using b684 version of JOGL from 2012-02-27), run the same command and it seems like that changed the problem. However, now a window popped out and afterwards it did not respond anymore (I had to kill the process in order to stop it). Anyway, here is the log file.
Comment 8 Wade Walker 2012-03-14 14:28:43 CET
It looks like the version I sent you works on your machine for some reason. Your original log said this:

Caused by: java.lang.UnsatisfiedLinkError: jogamp.nativewindow.x11.X11Lib.XineramaEnabled(J)Z

And the new log says this at that spot:

XineramaEnabled: p0
XineramaEnabled: p1 gotXinExt 1
XineramaEnabled: p2 XineramaIsActive 1

Those are the debug outputs I put in the XineramaEnabled function, and it wouldn't have got to the third one if the UnsatisfiedLinkError had happened again.

So, please try these three things to narrow this error down:

1. Try using the version of JOGL I sent you to run your program. This will confirm the problem is really gone (for whatever reason).

IMPORTANT: Make sure *not* to use your own *natives*.jar files when doing this test. The .so files I included with the JOGL version are the only ones that have the new debug fprintf statements in them :)

2. Try using an older autobuild of JOGL (from last December 24th or earlier) and see if that works. The version I sent you was based on the JOGL code from last December 24th (because I hadn't updated my source directory in a while). This will tell us if the problem appeared in the JOGL code sometime after I pulled the source code last time.

3. If an older autobuild of JOGL works, do a bisection search to find the first autobuild of JOGL that fails. I can use this to find the JOGL code commit that caused the failure.

Thanks for helping me find this bug!
Comment 9 Sven Gothel 2012-03-18 09:42:20 CET
Xinerama dependency has been fixed on Mon, 27 Feb 2012:

It's loaded dynamically now, since we used it on one mobile Linux/ARM machine as well,
as Xerxes has determined.
Comment 10 Wade Walker 2012-03-18 22:10:43 CET
Excellent! Barbara, you can disregard my last email then, just try the latest dev build and see if it works.

I may enter another bug soon about the "freezing" behavior we've seen while trying to run command-line gears test under 32-bit Ubuntu 11.10 -- that appears to be a separate issue from this.