[kaffe] SecureRandomTest failed

Ito Kazumitsu kaz at maczuka.gcd.org
Sat Jul 23 16:18:31 PDT 2005

Hi Guilhem,

From: Guilhem Lavaux <guilhem at kaffe.org>
Subject: Re: [kaffe] SecureRandomTest failed
Date: Sat, 23 Jul 2005 09:01:01 +0200

> Thanks for the analysis. Actually with your second report I have feared
> that the providers in java.security were not loaded. It apparently is
> the case as you have reported. It would be interesting if you have some
> time for this to check what happens in java.security.Security.<clinit>
> and loadProviders. I know that some exceptions are hidden there and
> these functions are in charge of loading the providers.

Yes, inserting System.err.prinln() into java/security/Security.java,
I got:

loadProviders loading: file:///path-to-kaffe/jre/lib/security/Kaffe.security
loadProviders caught java.io.FileNotFoundException: No such file or directory
loadProviders loading: file:///path-to-kaffe/jre/lib/security/java.security
loadProviders caught java.io.IOException: Inappropriate ioctl for device
loadProviders loading: file:///path-to-kaffe/jre/lib/security/classpath.security
loadProviders caught java.io.FileNotFoundException: No such file or directory

So the cause of error is "java.io.IOException: Inappropriate ioctl for device".

This is my simplified test case:

$ cat URLTest.java 
import java.io.*;
import java.net.URL;
public final class URLTest
  public static void main(String[] args)
    String filestr = args[0];
        System.err.println("loading: " + filestr);
        InputStream fin = new URL(filestr).openStream();
        BufferedReader reader =
          new BufferedReader(new InputStreamReader(fin, "ISO-8859-1"));
          String line;
          while ((line = reader.readLine()) != null)

    catch (IOException e)

$ path-to-kaffe/bin/java URLTest file:///path-to-kaffe/jre/lib/security/java.security
loading: file:///path-to-kaffe/jre/lib/security/java.security
java.io.IOException: Inappropriate ioctl for device
   at gnu.java.nio.channels.FileChannelImpl.available (FileChannelImpl.java)
   at java.io.FileInputStream.available (FileInputStream.java:165)
   at java.io.FilterInputStream.available (FilterInputStream.java:129)
   at java.io.BufferedInputStream.read (BufferedInputStream.java:276)
   at java.io.FilterInputStream.read (FilterInputStream.java:173)
   at java.io.InputStreamReader.read (InputStreamReader.java:395)
   at java.io.BufferedReader.fill (BufferedReader.java:373)
   at java.io.BufferedReader.readLine (BufferedReader.java:475)
   at URLTest.main (URLTest.java:15)

Using URL here seems to be significant.  Changing the test program so that
it uses FileInputStream instead of URL.openStream(), I got no exception.

More information about the kaffe mailing list