This is the mail archive of the cygwin@sourceware.cygnus.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]

Bug in Cygwin-B20.1?


I took the java-jni/c example of Mumit and modified it as follows:

1. dhello2 (in hello2.dll) calls dhello1.
2. dhello1 (in hello1.dll) calls dhello.
3. dhello (in hello.dll) is Mumit's function.

4. hello2.dll is linked to the java program and built by using
hello1.lib (see hello2Make)
5. hello1.dll is built by using hello.lib (see hello1Make)

I built the libraries using an adapted version of Mumit's Makefile.cyg
to account for libraries. This worked fine.

Now I added a function pointer declaration in hello.c together with an
external dummy function:

extern void dummyHello(JNIEnv *, jobject);
void (*extFncPtr)(JNIEnv *, jobject) = dummyHello;

void dummyHello(JNIEnv *env, jobject obj){}

I also changed hello1.c by adding the following:

  extern void (*extFncPtr)(JNIEnv *,jobject);
  extFncPtr = dHello;

I recompiled and linked the code. Now starting the program with "java
Main" I get the following message:

            " JAVA caused and invalid page fault in module hello1.dll"

Is this a BUG of Cygwin-B20.1?

All the source and make files are in the attached gzipped, tar file. The
source codes are shorter (together) than this email.

Any help will be greatly appreciated.

With many thanks in advance,

radu



lc.tar.gz

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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