From owner-freebsd-java Tue Aug 6 11: 7:30 2002 Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D2CD637B405 for ; Tue, 6 Aug 2002 11:07:26 -0700 (PDT) Received: from turing.morons.org (turing.morons.org [209.237.229.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6ECA743E6E for ; Tue, 6 Aug 2002 11:07:25 -0700 (PDT) (envelope-from freebsd@spatula.net) Received: by turing.morons.org (Postfix, from userid 1001) id 6F165AB35; Thu, 1 Aug 2002 09:52:41 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by turing.morons.org (Postfix) with ESMTP id 6E52CA947 for ; Thu, 1 Aug 2002 09:52:41 -0700 (PDT) Date: Thu, 1 Aug 2002 09:52:36 -0700 (PDT) From: Nick Johnson X-X-Sender: spatula@turing.morons.org To: freebsd-java@freebsd.org Subject: native jvm arraycopy / corruption problem Message-ID: <20020801095035.O62438-100000@turing.morons.org> X-what-happen: someone set up us the bomb X-Message-Flags: Spatula MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org -----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