Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Feb 2010 21:31:14 -0800
From:      Greg Lewis <glewis@eyesbeyond.com>
To:        Joe Lin <jlin@maxiscale.com>
Cc:        Pieter de Goeje <pieter@degoeje.nl>, "freebsd-java@freebsd.org" <freebsd-java@freebsd.org>
Subject:   Re: DatagramCahnnel scatter/gather problem on diablo 1.6.0_07-b02
Message-ID:  <20100202053114.GA90683@misty.eyesbeyond.com>
In-Reply-To: <8B6860326495B2438DCBEA74AA981C7A78B224DE@MBX01.exg5.exghost.com>
References:  <8B6860326495B2438DCBEA74AA981C7A78B220E0@MBX01.exg5.exghost.com> <201002011207.57163.pieter@degoeje.nl> <8B6860326495B2438DCBEA74AA981C7A78B22476@MBX01.exg5.exghost.com> <201002020207.30685.pieter@degoeje.nl> <8B6860326495B2438DCBEA74AA981C7A78B224DE@MBX01.exg5.exghost.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Feb 01, 2010 at 07:13:56PM -0600, Joe Lin wrote:
> I think that is the problem. As I looked at the code in DatagramDispatcher.c:writev0(), these fields only got zeroed out in solaris or linux:
> 
>     m.msg_name = NULL;
>     m.msg_namelen = 0;
>     m.msg_iov = iov;
>     m.msg_iovlen = len;
> #ifdef __solaris__
>     m.msg_accrights = NULL;
>     m.msg_accrightslen = 0;
> #endif
> 
> #ifdef __linux__
>     m.msg_control = NULL;
>     m.msg_controllen = 0;
> #endif

So, if you make the second #ifdef into

#if defined(__linux__) || defined(_ALLBSD_SOURCE)

what happens?

> -----Original Message-----
> From: Pieter de Goeje [mailto:pieter@degoeje.nl] 
> Sent: Monday, February 01, 2010 5:08 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 23:42:27 Joe Lin wrote:
> > Did a struss and the error happened with sendmsg call:
> >
> > sendmsg(0x4,0x7fffffbfe580,0x0,0x1,0x2,0x830c17de8) ERR#22 'Invalid
> > argument'
> 
> The struss output is broken because sendmsg only takes 3 arguments. It seems 
> that java passes bogus data in msg_flags and possibly msg_control and 
> msg_controllen fields of struct msghdr:
> 
> (gdb) p *m
> $4 = {msg_name = 0x0, msg_namelen = 0, msg_iov = 0x5dee4e00, msg_iovlen = 2, 
> msg_control = 0x29012e74, msg_controllen = 10480328, msg_flags = 740777920}
> 
> 
> >
> > -----Original Message-----
> > From: Pieter de Goeje [mailto:pieter@degoeje.nl]
> > Sent: Monday, February 01, 2010 3:08 AM
> > 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 02:08:55 Joe Lin wrote:
> > > Thanks for the reply. I looked at JDK source code and it appears that the
> > > JNI 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
> > > BSD 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 return 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 dialblo VM.
> >
> > You could use ktrace/kdump to find out what it (not?) calls and why it
> > dies.
> >
> > - Pieter
> >
> > No virus found in this incoming message.
> > Checked by AVG - www.avg.com
> > Version: 9.0.733 / Virus Database: 271.1.1/2649 - Release Date: 01/30/10
> > 22:39:00 _______________________________________________
> > freebsd-java@freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-java
> > To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org"
> 
> 
> 
> -- 
> Pieter de Goeje
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com 
> Version: 9.0.733 / Virus Database: 271.1.1/2649 - Release Date: 01/31/10 23:35:00
> _______________________________________________
> freebsd-java@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-java
> To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org"

-- 
Greg Lewis                          Email   : glewis@eyesbeyond.com
Eyes Beyond                         Web     : http://www.eyesbeyond.com
Information Technology              FreeBSD : glewis@FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100202053114.GA90683>