[kaffe] FileOutputStream error? [Part-1]

Nektarios K. Papadopoulos npapadop@inaccessnetworks.com
Thu Apr 15 04:10:02 2004


This is a multi-part message in MIME format.
--------------010906050807070408050703
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

I tried to post the following message yesterday, but it got held from 
the list due to size limitations until the list moderator can review it 
for approval.

I am resenting it in three pieces (debug-out.intrp and debug-out.jit3)
in following messages.
If this is not the rigth thing to do, please let me know and it will not
happen again.

=====================FileOutputStream error?  [Part-1]=================

Since (yesterday I think) the latest CVS code compiles OK, but two of
the regression tests (FileChecks and LoaderTest) that use to work now fail.
I am using both interpreter engine and jit3 engine
(see attached keffe -fullversion outputs).

With the jit3  all seem to be ok (make check reports PASS).
With the interpreter both fail.

The problem with FileChecks is corrected with the attached patch.
I think the patch is clean but I can't understand why it works with jit3?

In addition, I tried to tracked down the problem with LoaderTest.
In the case of interpreter the test blocks for a while and then it exits.

I run manualy the test classes using

kaffe  -vmdebug "RESERROR,VMCLASSLOADER" LoaderTest 2> debug-out.intrp
kaffe  -vmdebug "RESERROR,VMCLASSLOADER" LoaderTest 2> debug-out.jit3

As you can see in both the debug outputs (debug-out.intrp:Line 1695 and
debug-out.jit3:Line 1287) an attempt is made to load java.lang.Object
through LoaderTest_Loader1.
Then a call to LoaderTest.getClassBytes("java.lang.Object").
And finally a new FileInputStream("java.lang.Object.class").
In the case of jit3 a FileNotFound exception is raised but ignored
While in interpreter it actually tries to read the class from
filedescriptor 0. (I verified it by printf and by redirecting something
to the input of the above command).

I am not sure if the problem lies to kaffe or to the test class itself.

cheers
nek


--------------010906050807070408050703
Content-Type: text/plain;
 name="intrp.config"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="intrp.config"

Engine: Interpreter   Version: 1.1.x-cvs   Java Version: 1.1
Configuration/Compilation options:
  Compile date  : Wed Apr 14 09:54:02 EEST 2004
  Compile host  : sotos
  Install prefix: /home/npapadop/usr
  Thread system : unix-jthreads
  CC            : gcc
  CFLAGS        : -g -O2 -Wno-import -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Wmain -Wmissing-braces -Wmultichar -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused-function -Wunused-label -Wunused-parameter -Wunused-variable -Wunused-value -Wuninitialized -W -Wfloat-equal -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wpacked -Wredundant-decls -Wnested-externs -Wunreachable-code -Winline -Wlong-long -Wdisabled-optimization
  LDFLAGS       : 
  ChangeLog head: 2004-04-13  Jim Pick <jim@kaffe.org>



--------------010906050807070408050703
Content-Type: text/plain;
 name="fix_FileChecks.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="fix_FileChecks.diff"

Index: libraries/javalib/java/io/FileOutputStream.java
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/io/FileOutputStream.java,v
retrieving revision 1.12
diff -u -r1.12 FileOutputStream.java
--- libraries/javalib/java/io/FileOutputStream.java	12 Apr 2004 11:40:26 -0000	1.12
+++ libraries/javalib/java/io/FileOutputStream.java	14 Apr 2004 14:14:48 -0000
@@ -84,6 +84,10 @@
     SecurityManager s = System.getSecurityManager();
     if (s != null)
       s.checkWrite(path);
+
+		File file = new File(path);
+		if (file.isDirectory())
+			throw new FileNotFoundException(file.getPath() + " is a directory");
     ch = new FileChannelImpl (path, (append
 				     ? FileChannelImpl.WRITE
 				     | FileChannelImpl.APPEND


--------------010906050807070408050703
Content-Type: text/plain;
 name="jit3.config"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="jit3.config"

Engine: Just-in-time v3   Version: 1.1.x-cvs   Java Version: 1.1
Configuration/Compilation options:
  Compile date  : Wed Apr 14 10:46:08 EEST 2004
  Compile host  : sotos
  Install prefix: /home/npapadop/usr
  Thread system : unix-jthreads
  CC            : gcc
  CFLAGS        : -g -O2 -Wno-import -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Wmain -Wmissing-braces -Wmultichar -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused-function -Wunused-label -Wunused-parameter -Wunused-variable -Wunused-value -Wuninitialized -W -Wfloat-equal -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wsign-compare -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wpacked -Wredundant-decls -Wnested-externs -Wunreachable-code -Winline -Wlong-long -Wdisabled-optimization
  LDFLAGS       : 
  ChangeLog head: 2004-04-13  Jim Pick <jim@kaffe.org>



--------------010906050807070408050703--