This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Standard out writes fail after cygwin generated dll loaded



Hi Luis and All,


When trying to run through the JNI native C code compiled in a DLL
using Cygwin, I found that standard Java output stops to work as
soon as the DLL is loaded. However, if the same code is compiled
without Cygwing (-mno-cygwin) the Java output works OK after and
before loading the DLL.

I am having same problem. My tests more in detail:


- When running the Java VM *from a cygwin shell*, the stdout channel
works OK before and after loading the DLL generated with the cygwin
gcc. However, the stderr stops working after loading the DLL.
After loading the DLL and using the stdout and stderr
channels by the native C function, the Java program is only able to use
the stdout channel.

- When running the Java VM *from a windows shell*, both the stdout and
stderr channels stop working after loading the DLL.

- When compiling the dll *without* cygwin support (with the
"-mno-cygwin" flag), both channels work ok in both shells.

- The version employed of "jni.h" does not seem to affect to the
results. I have tried both versions, the one comming with cygwin and
the version provided with the JDK distribution (defining by
myself __int64).

- The version of the JDK (1.3 or 1.4) does not seem to affect to the
results.

- I have tried with different combination of flags for the gcc compiler
and they do not seem to affect to the results.


Does anyone know why this is happening or a possible solution?


Thanks in advance,

Jose



_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail



-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]