Bug in libgcj UDP network classes
Norbert Frese
postfach@nfrese.net
Thu Dec 4 01:32:00 GMT 2003
On Wed, 2003年12月03日 at 21:56, Michael Koch wrote:
> On Wed, Dec 03, 2003 at 12:49:40PM -0700, Tom Tromey wrote:
> > >>>>> "Norbert" == Norbert Frese <postfach@nfrese.net> writes:
> >
> > Norbert> ... got curious myself ... and i think i have found it:
> > Norbert> The buffer size which is told to recvfrom() in
> > Norbert> "gnu::java::net::PlainDatagramSocketImpl::receive" is the size of the
> > Norbert> previously received Packet. Which is kept in the "length" variable of
> > Norbert> DatagramPacket. Therefore the number of bytes read via recvfrom() gets
> > Norbert> reduced with every packet that is smaller than the previous one.
> >
> > Did this ever get resolved?
> > If not, could you file the problem in bugzilla?
>> This is fixed in CVS and Norbert's testcase works like a charm. The only
> missing piece is a mauve test ...
>>> Michael
>
Thanks, Michael, for fixing the incompatibilities i have found. I am
trying to write a more comprehensive datagram-packet test because there
are still differences to the JDK - you can download udp_testsuite2 from
the link below - perhaps we need two seperate fields for setLength() and
getLength().
My proposal:
2 fields: 'maxlen' and 'length'
setLength() sets both 'maxlen' and 'length' to the same value.
send() sends a Packet with 'length' bytes.
receive() reads not more than 'maxlen' bytes and sets 'length' to the
actual number of bytes received.
getLength() returns 'length'
The problem is, that this would require the fields to be public, because
we can't simply use getLength and setLength from CNI.
How does this mauve test stuff work? Is there a tutorial?
Besides: It seems there still is a bytecode verifyer bug. Is this a
known problem?
gcj -fCLASSPATH=swt.jar:xerces.jar -c jface-standalone.jar -o
jface_standalone.oOpenStrategy.java: In class
`org.eclipse.jface.util.OpenStrategy1ドル':
OpenStrategy.java: In method
`org.eclipse.jface.util.OpenStrategy1ドル.handleEvent(org.eclipse.swt.widgets.Event)':
OpenStrategy.java:229: error: verification error at PC=480
OpenStrategy.java:229: error: loading local variable 2 which has unknown
type
org/eclipse/jface/resource/URLImageDescriptor.java: In class
`org.eclipse.jface.resource.URLImageDescriptor':
org/eclipse/jface/resource/URLImageDescriptor.java: In method
`org.eclipse.jface.resource.URLImageDescriptor.getImageData()':
org/eclipse/jface/resource/URLImageDescriptor.java:48: error:
verification error at PC=21
org/eclipse/jface/resource/URLImageDescriptor.java:48: error: loading
local variable 2 which has unknown type
org/eclipse/jface/resource/FileImageDescriptor.java: In class
`org.eclipse.jface.resource.FileImageDescriptor':
org/eclipse/jface/resource/FileImageDescriptor.java: In method
`org.eclipse.jface.resource.FileImageDescriptor.getImageData()':
org/eclipse/jface/resource/FileImageDescriptor.java:75: error:
verification error at PC=21
org/eclipse/jface/resource/FileImageDescriptor.java:75: error: loading
local variable 2 which has unknown type
make: *** [default] Error 1
The tests:
http://www.scheinwelt.at/~norbertf/gcj/tests/
thanks,
norbert
More information about the Java
mailing list