http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49451
Summary: FileHandleGcTest FAILS on IRIX
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libgcj
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected], [email protected]
Host: mips-sgi-irix6.5
Target: mips-sgi-irix6.5
Build: mips-sgi-irix6.5
The FileHandleGcTest FAILS on IRIX 6.5 (both N32 and N64 ABIs):
FAIL: FileHandleGcTest execution - source compiled test
FAIL: FileHandleGcTest -findirect-dispatch execution - source compiled test
FAIL: FileHandleGcTest -O3 execution - source compiled test
FAIL: FileHandleGcTest -O3 -findirect-dispatch execution - source compiled test
In the log, I find:
/proc open failed
This message is ultimately from boehm-gc/dyn_load.c
(GC_register_dynamic_libraries) or boehm-gc/os_dep.c (GC_dirty_init). I had to
add a discriminator to the message to find it's the former. Running the test
under par, I find
1061mS[ 3]FileHandleGcTest(69051502): open("/dev/null", O_RDONLY, 0666) =
1023
1062mS[ 3]FileHandleGcTest(69051502): open("/dev/null", O_RDONLY, 0666) errno
= 24 (Too many open files)
1063mS[ 3]FileHandleGcTest(69051502): open("/proc/69051502", O_RDONLY, 0)
errn
o = 24 (Too many open files)
1063mS[ 3]FileHandleGcTest(69051502): write(2, "/proc open failed\n", 18) =
18
open 1056 0.07 72.78
When in gnu/java/nio/channels/natFileChannelPosix.cc (FileChannelImpl::open) an
open call fails, the code runs
::java::lang::System::gc ();
::java::lang::System::runFinalization ();
to try and free fds. Unfortunately, in boehm-gc
(GC_register_dynamic_libraries)
an attempt is made to open /proc/<pid>, which of course fails and calls
abort().
This doesn't happen on either Solaris or Tru64 UNIX because those use their
own implementations of GC_register_dynamic_libraries which don't need
additional file descriptors.
I guess something similar can be implemented on IRIX, using __rld_obj_head
described in rld(5). I''ll probably give it a try.