In message <[email protected]>, Ilya Berezhniuk writes: > > Hi!
Hi, > I observed 3 problems when running on FreeBSD 7.2. > > 1) I need to set LD_LIBRARY_PATH to VM's 'bin' directory, even to > print version or help. Seems like '-rpath $ORIGIN' ld option does not > work on FreeBSD. This problem also appeared for me on FreeBSD 6.3 and > 7.0. Of course, we may rename java to java-bin and use shell-script, > be maybe I'm just missing some FreeBSD know-how... This doesn't seem to be a problem on freebsd 8. > 2) When running in JIT mode on x86, VM crashes in classloader called > from compile-me stub in JITted code, because of corrupted Method* > passed. I have failed to investigate it the fist time I met this > problem, and dropped the matter. On the other hand, I was able to run > Eclipse with -Xint, so looks like threading works here. I've forced -Xint on in my build now so I can't confirm the current behaviour but I don't imagine the situation has changed. I've run some classlib tests with -Xint and the appended patch and uploaded my results to: http://people.apache.org/~hindessm/freebsd8/x86/ The patch fixes some socket issues but there are more socket issues and there are also several other problems with crashed tests. I'm planning to investigate these further. > 3) On x86_64 JIT works fine for me, but VM crashes in debug mode on > assertion in low-level threading. JVMTI tests in JIT mode may also > fail because of lack of thread-local data. I'm investigating the > problem. The same patch fixes some of the socket issues on x86_64 too but it doesn't seem to fix quite as much as on x86. I'm going to look at this as well. > I will get access to FreeBSD 8.0/amd64 soon, and will also check it > for problems with running Harmony VM. Cool. I'm concentrating on classlib problems at the moment because I'm interested in portability improvements in this code but obviously the VM/jit issues are pretty crucial to making real progress. Regards, Mark. P.S. We are in code freeze so I don't plan to commit this and it needs tidying up before it could be committed anyway. Index: working_classlib/modules/portlib/src/main/native/port/unix/hysock.c =================================================================== --- working_classlib/modules/portlib/src/main/native/port/unix/hysock.c (revision 915743) +++ working_classlib/modules/portlib/src/main/native/port/unix/hysock.c (working copy) @@ -602,12 +602,16 @@ { length = ((OSSOCKADDR_IN6 *) & addr->addr)->sin6_len; } +#if defined(FREEBSD) + else { + length = ((OSSOCKADDR *) & addr->addr)->sin_len; + } #endif #endif +#endif if (bind - (SOCKET_CAST (sock), (struct sockaddr *) &addr->addr, - sizeof (addr->addr)) < 0) + (SOCKET_CAST (sock), (struct sockaddr *) &addr->addr, length) < 0) { rc = errno; HYSOCKDEBUG ("<bind failed, err=%d>\n", rc); @@ -678,10 +682,15 @@ hysockaddr_t addr) { I_32 rc = 0; + I_32 length = +#if !defined(FREEBSD) + sizeof (addr->addr); +#else + ((OSSOCKADDR *) & addr->addr)->sin_len; +#endif if (connect - (SOCKET_CAST (sock), (struct sockaddr *) &addr->addr, - sizeof (addr->addr)) < 0) + (SOCKET_CAST (sock), (struct sockaddr *) &addr->addr, length) < 0) { rc = errno; HYSOCKDEBUG ("<connect failed, err=%d>\n", rc); @@ -3460,6 +3469,9 @@ { OSSOCKADDR *sockaddr = (OSSOCKADDR *) & handle->addr; memset (handle, 0, sizeof (struct hysockaddr_struct)); +#if defined(FREEBSD) + sockaddr->sin_len = sizeof(OSSOCKADDR); +#endif sockaddr->sin_family = family; sockaddr->sin_addr.s_addr = nipAddr; sockaddr->sin_port = nPort;
