delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/10/30/11:35:31

From: khan AT xraylith DOT wisc DOT edu (Mumit Khan)
Subject: Re: JNI functions under g++
30 Oct 1998 11:35:31 -0800 :
Message-ID: <9810291616.AA29880.cygnus.gnu-win32@modi.xraylith.wisc.edu>
References: <363884CA DOT B4B93295 AT sarnoff DOT com>
To: "JAMES DOYLE" <jdoyle AT sarnoff DOT com>
Cc: Gnu Win32 Mailing List <gnu-win32 AT cygnus DOT com>

"JAMES DOYLE" <jdoyle AT sarnoff DOT com> writes:
> Sounds great!  I thought that you had said there was a large
> problem in invoking cygwin-linked DLLs from MSVC-linked apps,
> such as Java.  Did you get around that problem?

I've submitted a patch for this. Unless there is something really
wrong with the implementation, and/or it's a little too late 
for Geoffrey to include it, you can see it in upcoming b20.

> BTW, I found out that my problem with MSVC was that one DLL was deleting
> memory that was newed in a different DLL, which apparently does not
> work at all.  Do you happen to know whether this is normal
> shared library behavior?  It doesn't happen with shared objects
> on Solaris, so I don't know if it's a Windows problem, or just an
> MSVC problem.  Would it happen with cygwin DLLs, do you think?

Boo (I have something much worse in my book, but this is a gentle
public forum after all ;-) the people who designed the abomination
knows as "Windows 32 Dynamic Link Libraries". What you're seeing
is typical of when the runtimes for your DLL and Java are not exactly 
the same. Java uses MSVCRT.DLL, whereas VC++ built apps can be using 
quite a few different DLLs, and the heaps may not be the same.

You might consider defining new/delete for each class and see if that
helps a bit. You'll also need to wrap your other allocs and deallocs
in "object factory" style to guarantee that both actual alloc and 
dealloc happen in the same DLL.

Ah, the joys of ELF shared libraries.

Regards,
Mumit

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019