Date: Tue, 18 Mar 2008 17:48:30 -0400 From: "Aryeh M. Friedman" <aryeh.friedman@gmail.com> To: Peter Jeremy <peterjeremy@optushome.com.au> Cc: freebsd-java@freebsd.org Subject: Re: jdk15/javaws on amd64 Message-ID: <47E038AE.7000505@gmail.com> In-Reply-To: <20080318214106.GA69742@server.vk2pj.dyndns.org> References: <20080316223054.GA46447@server.vk2pj.dyndns.org> <20080317133144.GA4473@misty.eyesbeyond.com> <20080318061525.GQ44676@server.vk2pj.dyndns.org> <20080318214106.GA69742@server.vk2pj.dyndns.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47E038AE.7000505>
