Discussion:
iceweasel javaplugin
Alan Greenberger
2009-12-11 18:03:12 UTC
Permalink
I am experiencing strange behavior of the sun java6 plugin in iceweasel
on a Lenny installation.
iceweasel 3.0.6-3
sun-java6-plugin 6-12-1 (/etc/alternatives/iceweasel-javaplugin.so ->
/usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so)
Tested with http://www.java.com/en/download/help/testvm.xml or other
applets gives the spinning pattern for about THREE MINUTES until the
applet suddenly starts. On the same box, konqueror starts the applets
quickly. I copied an applet from the internet which exhibits the slow
start. When iceweasel accesses it from the disk, it starts quickly. On
another Lenny box with the same versions, the applets start quickly from
iceweasel.

I have tried purging java and reinstalling. I don't see anything
obvious using wireshark and strace. I get the same result under a new
user id without previous iceweasel use.

The slow system was not a fresh install, but was upgraded. I suspect
there is some inherited setting somewhere causing this. Does anyone
have a clue? A java debug technique?
Alan Greenberger
2009-12-12 15:59:28 UTC
Permalink
Post by Alan Greenberger
I am experiencing strange behavior of the sun java6 plugin in iceweasel
on a Lenny installation.
iceweasel 3.0.6-3
sun-java6-plugin 6-12-1 (/etc/alternatives/iceweasel-javaplugin.so ->
/usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so)
Tested with http://www.java.com/en/download/help/testvm.xml or other
applets gives the spinning pattern for about THREE MINUTES until the
applet suddenly starts. On the same box, konqueror starts the applets
quickly. I copied an applet from the internet which exhibits the slow
start. When iceweasel accesses it from the disk, it starts quickly. On
another Lenny box with the same versions, the applets start quickly from
iceweasel.
I have tried purging java and reinstalling. I don't see anything
obvious using wireshark and strace. I get the same result under a new
user id without previous iceweasel use.
The slow system was not a fresh install, but was upgraded. I suspect
there is some inherited setting somewhere causing this. Does anyone
This theory was wrong, see below.
Post by Alan Greenberger
have a clue? A java debug technique?
New information:
I have a java application that worked fine under Sarge, but on Lenny in
March would not print. /var/log/cups/error_log would immediately get
complaints about no %BoundingBox or %%PAGES in header. Same for trying
to print from /usr/share/doc/sun-java6-jdk/demo/jfc/Font2DTest. I
believe this is a known fight between java and ghostscript. I tried
again and now it just hung until I killed the process with no error
message. Then I thought, "what if I leave it for three minutes"? It
then brought up the printer GUI and when the print button was pressed,
got the error message!

Next I downloaded a trivial java test program from
http://freemind.sourceforge.net/wiki/index.php/FreeMind_on_Linux
javac DummyPrinter.java
strace java DummyPrinter
It hangs with:
futex(0xb7d6cbd8, FUTEX_WAIT, 1992, NULL
After three minutes, it brings up the printer GUI. When the print
button is pressed, it completes the trace line as:
futex(0xb7d6cbd8, FUTEX_WAIT, 1992, NULL) = ? ERESTARTSYS (To be restarted)
The fourth argument of NULL is telling it to wait forever. Now I think
a kernel (2.6.26-1-686) watchdog may be timing it out.

Then I grepped other traces for 'FUTEX_WAIT,' .
slow system iceweasel:
futex(0xb444dbd8, FUTEX_WAIT, 16372, NULL) = -1 EAGAIN (Resource temporarily
unavailable)
fast system iceweasel:
futex(0xb3affbd8, FUTEX_WAIT, 3411, NULL) = 0

slow system konqueror, which responded quickly, did not have FUTEX_WAIT.
It did have FUTEX_WAKE_PRIVATE.

So it is a java futex problem always showing up on printing and
triggered by iceweasel but not konqueror. It wasn't happening on
Lenny-slow in March. Does anyone have an idea what I could have done to
this system to cause the FUTEX_WAIT problem with java to appear?
Marcus Better
2009-12-13 11:14:55 UTC
Permalink
Hi,
Post by Alan Greenberger
So it is a java futex problem always showing up on printing and
triggered by iceweasel but not konqueror. It wasn't happening on
Lenny-slow in March. Does anyone have an idea what I could have done to
this system to cause the FUTEX_WAIT problem with java to appear?
I had a similar problem with Eclipse recently. The launcher would sometimes
hang indefinitely on FUTEX_WAIT. I never managed to pin it down.

There are a few reports on the web:

https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/309407
https://bugzilla.redhat.com/show_bug.cgi?id=492018

Cheers,

Marcus
Alan Greenberger
2009-12-16 16:32:55 UTC
Permalink
Post by Alan Greenberger
Next I downloaded a trivial java test program from
http://freemind.sourceforge.net/wiki/index.php/FreeMind_on_Linux
javac DummyPrinter.java
strace java DummyPrinter
futex(0xb7d6cbd8, FUTEX_WAIT, 1992, NULL
After three minutes, it brings up the printer GUI. When the print
Tim Ruehsen just posted in debian/user a workaround for a java problem
in unstable. I gave it a try and:
java -Djava.net.preferIPv4Stack=true DummyPrinter
brings up the printer GUI right away!
_JAVA_VM_OPTIONS="-Djava.net.preferIPv4Stack=true" jcontrol
brings up the jcontrol GUI right away instead of three minutes!

Does anyone have an idea of how to pass this to the java plugin in
iceweasel?
Alan Greenberger
2009-12-17 18:19:02 UTC
Permalink
Post by Alan Greenberger
Tim Ruehsen just posted in debian/user a workaround for a java problem
java -Djava.net.preferIPv4Stack=true DummyPrinter
brings up the printer GUI right away!
_JAVA_VM_OPTIONS="-Djava.net.preferIPv4Stack=true" jcontrol
brings up the jcontrol GUI right away instead of three minutes!
Does anyone have an idea of how to pass this to the java plugin in
iceweasel?
I figured it out. Running the Java Control Panel (jcontrol or
ControlPanel) / Java tab / "Java Applet Runtime Settings" View button /
Click on the box under "Java Runtime Parameters", enter
-Djava.net.preferIPv4Stack=true and press OK / Apply / OK and restart
iceweasel.

[Of course, this does not explain why this problem started on this
system. So there is probably a simple solution in a file somewhere.]
Loading...