Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: New glibc version seems to break Java 7 and 8 iteration over directories

  1. #1
    Junior Member
    Join Date
    Jun 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default New glibc version seems to break Java 7 and 8 iteration over directories

    On SLES 11 SP1 Linux, the glibc (standard C library) was upgraded from glibc-2.11.1-0.46.1 to glibc-2.11.1-0.52.1. This included a change to the readdir_r function that is also in all newer versions of glibc.

    When I tried to build the JDK on the system, I got an error where a directory was being read. Upon investigating, I found it to be a general problem with the directory processing.

    If you compile and run the following snippet on such a system:

    import java.io.File;
    import java.nio.file.DirectoryStream;
    import java.nio.file.FileSystems;
    import java.nio.file.Files;
    import java.nio.file.Path;
    import java.util.*;

    public class tstconv {

    public static void main(String[] args) throws Exception {

    tstconv.testit(args[0]);
    }

    public static void testit(String dpath) throws Exception {
    Path path = FileSystems.getDefault().getPath(dpath);

    try (DirectoryStream<Path> dirStr = Files.newDirectoryStream(path)) {
    for (Path entry : dirStr) {
    String fileName = entry.getFileName().toString();
    System.out.println(fileName);

    }
    }
    return;
    }

    }

    The following error occurs:

    Exception in thread "main" java.nio.file.DirectoryIteratorException: java.nio.file.FileSystemException: /home/lug: Unknown error 1601332584
    at sun.nio.fs.UnixDirectoryStream$UnixDirectoryIterat or.readNextEntry(UnixDirectoryStream.java:172)
    at sun.nio.fs.UnixDirectoryStream$UnixDirectoryIterat or.hasNext(UnixDirectoryStream.java:201)
    at tstconv.testit(tstconv.java:22)
    at tstconv.main(tstconv.java:15)
    Caused by: java.nio.file.FileSystemException: /home/lug: Unknown error 1601332584
    at sun.nio.fs.UnixException.translateToIOException(Un ixException.java:91)
    at sun.nio.fs.UnixException.asIOException(UnixExcepti on.java:111)
    at sun.nio.fs.UnixDirectoryStream$UnixDirectoryIterat or.readNextEntry(UnixDirectoryStream.java:171)
    ... 3 more

    Where /home/lug was the (yes it exists) directory given on the command line. The directory is not corrupted or anything like that; I've seen this on multiple systems and for any directory.

    The exception is thrown after the readdir_r native call in the JNI code.

    With the old glibc version this did not occur. Has anyone else seen this?


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: New glibc version seems to break Java 7 and 8 iteration over directories

    . . . and (since I answered your other post first) welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.

    Please post your code correctly per the above link.

    This isn't really a Java question. Rather, it's a development/runtime environment question that I doubt anyone here will be able to duplicate in order to join you in an intelligent discussion. Yours is a very specific topic or case while we tend to work with the general here so that it's meaningful to a larger group.

    Even so, good luck with your quest to resolve this problem.

  3. #3
    Junior Member
    Join Date
    Jun 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: New glibc version seems to break Java 7 and 8 iteration over directories

    Yes it appears this isn't really a java question; I have found what appears to be a problem in the glibc version (C code) we are using that is causing the issue, so I won't pursue it further here.

Similar Threads

  1. uploading the java version
    By ball in forum What's Wrong With My Code?
    Replies: 1
    Last Post: July 14th, 2013, 01:43 PM
  2. Java HSA Break To Part of Code
    By nigerianmahogany in forum What's Wrong With My Code?
    Replies: 5
    Last Post: May 30th, 2013, 11:20 PM
  3. Java Version
    By mohdrazeed in forum Java Theory & Questions
    Replies: 1
    Last Post: July 18th, 2012, 04:28 PM
  4. Java Version
    By mohdrazeed in forum Object Oriented Programming
    Replies: 1
    Last Post: July 16th, 2012, 09:58 AM
  5. MarshallableObject for java 6 version
    By AllenK in forum Java SE APIs
    Replies: 12
    Last Post: July 5th, 2010, 02:51 AM