From owner-freebsd-java@FreeBSD.ORG Mon Feb 1 01:08:57 2010 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CD1C1065672 for ; Mon, 1 Feb 2010 01:08:57 +0000 (UTC) (envelope-from jlin@maxiscale.com) Received: from server505.appriver.com (server505b.appriver.com [98.129.35.5]) by mx1.freebsd.org (Postfix) with ESMTP id 44CC58FC08 for ; Mon, 1 Feb 2010 01:08:57 +0000 (UTC) X-Policy: GLOBAL - maxiscale.com X-Policy: GLOBAL - maxiscale.com X-Primary: jlin@maxiscale.com X-Note: This Email was scanned by AppRiver SecureTide X-ALLOW: jlin@maxiscale.com ALLOWED X-Virus-Scan: V- X-Note: Spam Tests Failed: X-Country-Path: UNITED STATES->UNITED STATES->UNITED STATES X-Note-Sending-IP: 98.129.23.14 X-Note-Reverse-DNS: ht01.exg5.exghost.com X-Note-WHTLIST: jlin@maxiscale.com X-Note: User Rule Hits: X-Note: Global Rule Hits: G169 G170 G171 G172 G176 G177 G188 G275 X-Note: Encrypt Rule Hits: X-Note: Mail Class: ALLOWEDSENDER X-Note: Headers Injected Received: from [98.129.23.14] (HELO ht01.exg5.exghost.com) by server505.appriver.com (CommuniGate Pro SMTP 5.2.14) with ESMTPS id 21868055; Sun, 31 Jan 2010 19:08:57 -0600 Received: from MBX01.exg5.exghost.com ([169.254.1.90]) by ht01.exg5.exghost.com ([98.129.23.14]) with mapi; Sun, 31 Jan 2010 19:08:56 -0600 From: Joe Lin To: Pieter de Goeje , "freebsd-java@freebsd.org" Date: Sun, 31 Jan 2010 19:08:55 -0600 Thread-Topic: DatagramCahnnel scatter/gather problem on diablo 1.6.0_07-b02 Thread-Index: Acqi18pGdx4DTK8JQPucXVyTu+KYqQAAkQNQ Message-ID: <8B6860326495B2438DCBEA74AA981C7A78B220EE@MBX01.exg5.exghost.com> References: <8B6860326495B2438DCBEA74AA981C7A78B220E0@MBX01.exg5.exghost.com> <201002010144.41376.pieter@degoeje.nl> In-Reply-To: <201002010144.41376.pieter@degoeje.nl> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: Subject: RE: DatagramCahnnel scatter/gather problem on diablo 1.6.0_07-b02 X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2010 01:08:57 -0000 Thanks for the reply. I looked at JDK source code and it appears that the J= NI call should be in J2se/src/solaris/native/sun/nio/ch/DatagramDispatcher.c:write0(): There's only linux and solaris #ifdef but not for BSD. I wonder how/what BS= D is calling. Since I'm getting a "IOException:Invalid argument" so I guess= this should correspond to a EINVAL. And a sendmsg() in FreeBSD does not re= turn an EINVAL. So the Diablo port must be calling a writev(). But I could = not locate the source code. Wish I can find out what went wrong with dialbl= o VM. Thanks. -----Original Message----- From: Pieter de Goeje [mailto:pieter@degoeje.nl]=20 Sent: Sunday, January 31, 2010 4:45 PM To: freebsd-java@freebsd.org Cc: Joe Lin Subject: Re: DatagramCahnnel scatter/gather problem on diablo 1.6.0_07-b02 On Monday 01 February 2010 01:01:38 Joe Lin wrote: > Hi I wrote a sample program trying to use > DatagramChannel.write(ByteBuffer[] bufs). The exact same code works on > Windows and Linux. But it fails on the Diablo VM under FreeBSD 7.0 64 bit= . > The exception: > > Exception in thread "main" java.io.IOException: Invalid argument > at sun.nio.ch.DatagramDispatcher.writev0(Native Method) > at sun.nio.ch.DatagramDispatcher.writev(DatagramDispatcher.java:3= 7) > at sun.nio.ch.IOUtil.write(IOUtil.java:164) > at > sun.nio.ch.DatagramChannelImpl.write0(DatagramChannelImpl.java:414) at > sun.nio.ch.DatagramChannelImpl.write(DatagramChannelImpl.java:431) at > java.nio.channels.DatagramChannel.write(DatagramChannel.java:418) at > coco.McastSender.main(McastSender.java:68). I can confirm it also doesn't work on FreeBSD 8/i386 and amd64 using jdk6 o= r=20 openjdk6. I find it odd why it works on Linux because they have exactly the= =20 same writev(2) as we do. Scatter/gather I/O isn't very often used so I gues= s=20 you're the first one that has run into this problem. --=20 Pieter de Goeje No virus found in this incoming message. Checked by AVG - www.avg.com=20 Version: 9.0.733 / Virus Database: 271.1.1/2649 - Release Date: 01/30/10 22= :39:00