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]

Re: dll, java, gcc, cygwin


Earnie Boyd <earnie_boyd@yahoo.com> writes:
> 
> Have you tried using the libmmalloc.a library that comes with the
> cygwin package for your malloc and friends routines?  Note: that there
> are two m's and is a Mapped Memory Allocation package.  This has
> seemed to fix various other porters problems when I've suggested it.

I tend to shudder everytime someone recommends a different malloc
package to fix bugs in code; more often than not, it just hides the
bug waiting to bite on another platform. There are pretty reliable
ways to debug memory allocation problems (eg., we use Purify on all
our supported platforms).

I don't remember if I already responded to Glenn's message or not 
(or if I copied the list or not), so here's quick recap to avoid 
further confusion and speculation.

  - cygwin app loading cygwin dll ................ OK
  - cygwin app loading "native" dll .............. OK if you do it right
  - "native" app loading cygwin dll .............. NOT OK (bug!)

Here I'm using "native" for msvc or mingw compiled apps. Since Java is
a "native" app, you just can't load cygwin JNI dll until this bug is
fixed. There is also an issue of threading with Java when loading a
cygwin JNI DLL, and I have yet to look in that direction.

I've tracked down the problem, but have no idea what the solution is.
Basically, the DLL startup is not initializing Cygwin properly (yes,
I did take all the necessary steps for cygwin), and pretty much 
everything that requires impure_ptr will crash, which includes all the
stdio, memory allocation, etc in newlib.

I've submitted a test case to cygwin32 developers and hopefully someone
will come forward and figure it out. It's a bit beyond my expertise ...

It's not a memory allocation problem per se, but a much larger one.

Regards,
Mumit

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


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