Date: Mon, 28 Oct 2013 10:58:31 +0100 (CET) From: Palle Girgensohn <girgen@FreeBSD.org> To: FreeBSD-gnats-submit@freebsd.org Cc: glewis@FreeBSD.org Subject: ports/183389: [PATCH] java/openjdk7 fails using nio.ch.DefaultAsynchronousChannelProvider Message-ID: <201310280958.r9S9wV3m046083@ananas.pingpong.net> Resent-Message-ID: <201310281020.r9SAK0iP044686@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 183389 >Category: ports >Synopsis: [PATCH] java/openjdk7 fails using nio.ch.DefaultAsynchronousChannelProvider >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Oct 28 10:20:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Palle Girgensohn >Release: FreeBSD 9.2-RELEASE amd64 >Organization: >Environment: System: FreeBSD ananas 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r257156: Sat Oct 26 18:02:04 CEST 2013 girgen@ananas:/usr/obj/usr/src/sys/ANANAS amd64 openjdk-7.25.15_1 tomcat 7.0.47 >Description: Tomcat's latest version, 7.0.47, seems to have changed to use sun/nio/ch/DefaultAsynchronousChannelProvider.java with FreeBSD's openjdk, this fails with a java.lang.InternalError: platform not recognized tomcat 7.0.42 workes fine, but surely doesn't use the asynchronous channel stuff from nio. >How-To-Repeat: $ cat Foo.java import java.nio.channels.AsynchronousServerSocketChannel; class Foo { public static void main(String[] args) throws Exception { AsynchronousServerSocketChannel.open(); } } $ javac Foo.java $ java Foo Exception in thread "main" java.lang.InternalError: platform not recognized at sun.nio.ch.DefaultAsynchronousChannelProvider.create(DefaultAsynchronousChannelProvider.java:55) at java.nio.channels.spi.AsynchronousChannelProvider$ProviderHolder$1.run(AsynchronousChannelProvider.java:88) at java.nio.channels.spi.AsynchronousChannelProvider$ProviderHolder$1.run(AsynchronousChannelProvider.java:79) at java.security.AccessController.doPrivileged(Native Method) at java.nio.channels.spi.AsynchronousChannelProvider$ProviderHolder.load(AsynchronousChannelProvider.java:78) at java.nio.channels.spi.AsynchronousChannelProvider$ProviderHolder.<clinit>(AsynchronousChannelProvider.java:75) at java.nio.channels.spi.AsynchronousChannelProvider.provider(AsynchronousChannelProvider.java:166) at java.nio.channels.AsynchronousServerSocketChannel.open(AsynchronousServerSocketChannel.java:138) at java.nio.channels.AsynchronousServerSocketChannel.open(AsynchronousServerSocketChannel.java:161) at Foo.main(Foo.java:5) $ java -version openjdk version "1.7.0_25" OpenJDK Runtime Environment (build 1.7.0_25-b15) OpenJDK 64-Bit Server VM (build 23.21-b01, mixed mod >Fix: This is already fixed for MaxOS, using kqueue(2). Just changing to accept the same lib for FreeBSD *seems* to help. The test case works. Tomcat works. But since this is "Asynchrounous Channel", maybe some more tests would be appropriate? diff -urN --exclude '*.svn*' /home/girgen/openjdk7/Makefile openjdk7/Makefile --- /home/girgen/openjdk7/Makefile 2013-10-28 10:47:01.325767103 +0100 +++ openjdk7/Makefile 2013-10-28 10:41:10.484771486 +0100 @@ -1,9 +1,9 @@ # Created by: Greg Lewis <glewis@FreeBSD.org> -# $FreeBSD: head/java/openjdk7/Makefile 327845 2013-09-22 00:39:22Z glewis $ +# $FreeBSD: java/openjdk7/Makefile 327845 2013-09-22 00:39:22Z glewis $ PORTNAME= openjdk PORTVERSION= ${JDK_MAJOR_VERSION}.${PORT_MINOR_VERSION}.${PORT_BUILD_NUMBER} -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= java devel MASTER_SITES= http://download.java.net/openjdk/jdk${JDK_MAJOR_VERSION}u${JDK_MINOR_VERSION}/promoted/b${JDK_BUILD_NUMBER}/ \ http://download.java.net/jaxp/1.4.5/:jaxp \ diff -urN --exclude '*.svn*' /home/girgen/openjdk7/files/patch-src-solaris-classes-sun-nio-ch-DefaultAsynchronousChanneldProvider.java openjdk7/files/patch-src-solaris-classes-sun-nio-ch-DefaultAsynchronousChanneldProvider.java --- /home/girgen/openjdk7/files/patch-src-solaris-classes-sun-nio-ch-DefaultAsynchronousChanneldProvider.java 1970-01-01 01:00:00.000000000 +0100 +++ openjdk7/files/patch-src-solaris-classes-sun-nio-ch-DefaultAsynchronousChanneldProvider.java 2013-10-28 01:36:06.946770171 +0100 @@ -0,0 +1,11 @@ +--- jdk/src/solaris/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java.orig 2013-10-28 01:26:45.766774262 +0100 ++++ jdk/src/solaris/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java 2013-10-28 01:27:24.043766301 +0100 +@@ -50,7 +50,7 @@ + return new SolarisAsynchronousChannelProvider(); + if (osname.equals("Linux")) + return new LinuxAsynchronousChannelProvider(); +- if (osname.contains("OS X")) ++ if (osname.contains("OS X") || osname.equals("FreeBSD")) + return new BsdAsynchronousChannelProvider(); + throw new InternalError("platform not recognized"); + } >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310280958.r9S9wV3m046083>