Menu

#20 Problem in java_io_FileOutputStream.cpp

open
nobody
None
5
2001-06-29
2001-06-29
Wu Gansha
No

When we run Volano using ORP, a error message
says "Uncaught exception while running a finalizer of
class java/io/FileOutputStream".
Classpath/FileOutputStream do the close work in its
finalizer. After tracing the object which causes this
problem, we found close() is called explicitly, when
finalizing, close() is called again.
So we must add a line in
Java_java_io_FileOutputStream_closeInternal()
(java_io_FileOutputStream.cpp):
if(file_d == -1)return; //already closed
And we could add the same line in
Java_java_io_FileOutputStream_writeInternal, but
according to the semantics, we'd better not add.

BTW, tracing in FileOutputStream.java is tricky,
because System.out is an instance of FileOutputStream,
so we couldn't add "System.out.println(...)" in this
file, or else program exits abruptly(recursion
overflow?). But we can use writeInternal to do the
print work by native part.

Discussion


Log in to post a comment.