SUGGESTED FIX
Ideally the implementation should be changed to use readdir64_r but there seems to be issues with the reentrant functions in Solaris 8 and 9 (see 4621211). Asssuming these issues still exist then a simple solution is to just switch to readdir64:
------- UnixFileSystem_md.c -------
*** /tmp/sccs.52ayoa Tue Mar 14 13:54:21 2006
--- UnixFileSystem_md.c Tue Mar 14 13:54:16 2006
***************
*** 335,341 ****
jobject file)
{
DIR *dir = NULL;
! struct dirent *ptr;
int len, maxlen;
jobjectArray rv, old;
--- 335,341 ----
jobject file)
{
DIR *dir = NULL;
! struct dirent64 *ptr;
int len, maxlen;
jobjectArray rv, old;
***************
*** 351,357 ****
if (rv == NULL) goto error;
/* Scan the directory */
! while ((ptr = readdir(dir)) != NULL) {
jstring name;
if (!strcmp(ptr->d_name, ".") || !strcmp(ptr->d_name, ".."))
continue;
--- 351,357 ----
if (rv == NULL) goto error;
/* Scan the directory */
! while ((ptr = readdir64(dir)) != NULL) {
jstring name;
if (!strcmp(ptr->d_name, ".") || !strcmp(ptr->d_name, ".."))
continue;
|
EVALUATION
The output from truss shows the issue:
8901/1: getdents64(5, 0x000EC4C0, 8192) = 176
8901/1: ino=107547 off=1 rlen=24 "."
8901/1: ino=107490 off=2 rlen=24 ".."
8901/1: ino=321247 off=461915142750211 rlen=32 ".DS_Store"
8901/1: ino=107548 off=461919437717508 rlen=32 ".localized"
8901/1: ino=107549 off=6473847154933765 rlen=32 "Drop Box"
8901/1: ino=1507310 off=9223372032559808518 rlen=32 "stoiber.mp3"
File.list is implemented using readdir(3C) which limits the offset to 32-bits. So in this case the offset 9223372032559808518 leads to readdir failing with an overflow error. The implementation needs to be changed to use readdir64.
|