public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Radu Grosu <grosu@saul.cis.upenn.edu>
To: cygwin@sourceware.cygnus.com, khan@xraylith.wisc.EDU
Subject: Bug in Cygwin-B20.1?
Date: Tue, 31 Aug 1999 23:49:00 -0000	[thread overview]
Message-ID: <37B05009.2EF2994B@saul.cis.upenn.edu> (raw)
Message-ID: <19990831234900.SQ6iBJZ-nLFIy-YXjPw-jE6Woma2Zpg-UEbfyALfGKA@z> (raw)

[-- Attachment #1: Type: text/plain, Size: 1235 bytes --]

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




[-- Attachment #2: lc.tar.gz --]
[-- Type: application/x-gzip, Size: 32635 bytes --]

             reply	other threads:[~1999-08-31 23:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-10  9:15 Radu Grosu [this message]
1999-08-31 23:49 ` Radu Grosu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=37B05009.2EF2994B@saul.cis.upenn.edu \
    --to=grosu@saul.cis.upenn.edu \
    --cc=cygwin@sourceware.cygnus.com \
    --cc=khan@xraylith.wisc.EDU \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).