Subject: Problem with Java and stdout in newest snapshot
From: "Dr. Schroeder, Klaus" <[email-masked]>
To: [email-masked]
Date: Wed, 12 Jan 2000 11:01:16 +0100

Hi ,

Using the newest snapshot cygwin1-20000108.dll in my Java JNI
application solved my problem with segmentation faults in function
ioctl.

But now I'm running into a new problem:As soon, as the jni-dll is loaded
from my Java-Program, the Java standard output (System.out.println) does
no longer work. This bug does not appear with the originalB20.1
cygwin.dll.

To demonstrate the bug I changed the Java code from the java-jni  c++
example:

Main.java
========

class Main {
    public static void main(String[] args) {
       System.out.println("*** main START ***"); // !!!
       new HelloWorld().displayHelloWorld();
       System.out.println("*** main END ***"); // !!!
    }
}

HelloWorld.java
============

class HelloWorld {
    public native void displayHelloWorld();

    static {
        System.out.println("*** load hello.dll ***"); // !!!
        System.loadLibrary("hello");
        System.out.println("*** hello.dll loaded ***"); // !!!
    }
}

Running this with the original cygwin1.dll gives the following correct
output:

*** main START ***
*** load hello.dll ***
#1 LocalFoo created.
*** hello.dll loaded ***
HelloWorld::displayHelloWorld: Entering.
#2 LocalFoo created.
#3 LocalFoo created.
#3 LocalFoo destroyed.
HelloWorld::displayHelloWorld: Leaving..
#2 LocalFoo destroyed.
*** main END ***
#1 LocalFoo destroyed.

Running the same program with cygwin1-20000108.dll:

*** main START ***
*** load hello.dll ***
#1 LocalFoo created.
HelloWorld::displayHelloWorld: Entering.
#2 LocalFoo created.
#3 LocalFoo created.
#3 LocalFoo destroyed.
HelloWorld::displayHelloWorld: Leaving..
#2 LocalFoo destroyed.
#1 LocalFoo destroyed.

The lines *** hello.dll loaded *** and *** main END *** are missing.

Any help would be greatly appreciated.

Klaus Schröder

--
Want to unsubscribe from this list?
Send a message to [email-masked]