Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Aug 2002 09:52:36 -0700 (PDT)
From:      Nick Johnson <freebsd@spatula.net>
To:        freebsd-java@freebsd.org
Subject:   native jvm arraycopy / corruption problem 
Message-ID:  <20020801095035.O62438-100000@turing.morons.org>

next in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Apologies if this is a duplicate... been having some mail problems & this
didn't turn up in the archive...


I'm running Resin and a bunch of JSP stuffs under the FreeBSD JVM 1.3.1,
and running into a bit of trouble.  I'm hoping someone closer to the code
can point me in the right direction, or someone else may have seen this
problem and can verify it exists.

A certain piece of code (in this case an XSLT filter) calls
java.io.ByteArrayOutputStream.toByteArray.  Inside this bit of code, an
arraycopy is done from a byte[] to a byte[].  The problem is that at
times, this will throw an ArrayCopyException, which is really only
supposed to happen if there's an attempt to copy into an array of a
different type (like from a byte[] to an int[]).  As far as I can see,
there's no way for the arguments into arraycopy from toByteArray to be
anything but byte[].

I noticed that the code in the jvm for arraycopy checks the flags of the
objects passed in and then performs a different type of memcopy depending
on the types, so this suggests that somehow the flags for at least one of
the two byte[]'s are getting corrupted so that one of them appears to be
something other than byte[].

Tracking this down is probably going to be an incredible pain in the
behind :-(  In the meantime, it seems that running the Linux JVM with
Linux compat works fine.

   Nick


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE9SWdZ6oaD7JHSxFYRApRCAJoDGNyE1FaZLSfK2DbHpcKaEsBIzgCgiqQj
oa4MpNi98Q5eDoF/gnOSqYw=
=3tJy
-----END PGP SIGNATURE-----



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message




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