From owner-freebsd-java@FreeBSD.ORG Tue Mar 18 21:48:45 2008 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 8D80A1065672 for ; Tue, 18 Mar 2008 21:48:45 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from mta5.srv.hcvlny.cv.net (mta5.srv.hcvlny.cv.net [167.206.4.200]) by mx1.freebsd.org (Postfix) with ESMTP id 7685C8FC20 for ; Tue, 18 Mar 2008 21:48:45 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from flosoft.no-ip.biz (ool-435559b8.dyn.optonline.net [67.85.89.184]) by mta5.srv.hcvlny.cv.net (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTP id <0JXY008MD4L7NEN0@mta5.srv.hcvlny.cv.net> for freebsd-java@freebsd.org; Tue, 18 Mar 2008 17:48:44 -0400 (EDT) Received: from flosoft.no-ip.biz (localhost [IPv6:::1]) by flosoft.no-ip.biz (8.14.2/8.14.2) with ESMTP id m2ILmaTs000433; Tue, 18 Mar 2008 17:48:41 -0400 Date: Tue, 18 Mar 2008 17:48:30 -0400 From: "Aryeh M. Friedman" In-reply-to: <20080318214106.GA69742@server.vk2pj.dyndns.org> To: Peter Jeremy Message-id: <47E038AE.7000505@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT X-Enigmail-Version: 0.95.6 References: <20080316223054.GA46447@server.vk2pj.dyndns.org> <20080317133144.GA4473@misty.eyesbeyond.com> <20080318061525.GQ44676@server.vk2pj.dyndns.org> <20080318214106.GA69742@server.vk2pj.dyndns.org> User-Agent: Thunderbird 2.0.0.12 (X11/20080314) Cc: freebsd-java@freebsd.org Subject: Re: jdk15/javaws on amd64 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: Tue, 18 Mar 2008 21:48:45 -0000 Peter Jeremy wrote: > On Tue, Mar 18, 2008 at 05:15:25PM +1100, Peter Jeremy wrote: > >> I've done some poking at it with both some printf()s and gdb and it >> appears to be a gcc bug - in fact, I'm surprised it works at all... >> >> The relevant function is GetBootClassPath(): >> char* GetBootClassPath(void) { >> static char bootclasspath[MAXPATHLEN]; >> #ifdef _DEBUG >> sprintf(bootclasspath, "%s%c%s%c%s%c%s", >> sysGetJarLib(), FILE_SEPARATOR, "javaws_g.jar", >> PATH_SEPARATOR, sysGetJarLib(), FILE_SEPARATOR, "deploy_g.jar"); >> #else >> sprintf(bootclasspath, "%s%c%s%c%s%c%s", >> sysGetJarLib(), FILE_SEPARATOR, "javaws.jar", >> PATH_SEPARATOR, sysGetJarLib(), FILE_SEPARATOR, "deploy.jar"); >> #endif >> return bootclasspath; >> } >> > > I've done a bit more investigating and the problem is that > sysGetJarLib() returns char*, and this is assumed by the above code. > But there is no prototype in scope for the above code so gcc assumes > that sysGetJarLib() returns int and passes it to sprintf as an int. > > Looking further, there is no prototype for sysGetJarLib() anywhere in > the source code - or, for that matter many of the other functions in > deploy/src/javaws/share/native/system.c that also return char*. > > This code can't work correctly on any platform where > sizeof(int) != sizeof(void*) so I'm not quite sure how Sun make it > work on Sun SPARC... > > I'm currently trying to rebuild Java with -Wall to see how many of > these sorts of bugs exist. In the meantime, I would suggest that > java is broken on any 64-bit architecture. > > Diablo is also broken on AMD64 after the removal of KSE threading in 8-current (so are the Sun Linux binaries)... thus as a result it is not possible to get Java working in any shapre or form on 8-current AMD64