Subject: Re: dll, java, gcc, cygwin
From: [email-masked] (Mumit Khan)

28 Oct 1998 13:26:35 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
To: [email-masked]
Cc: Glen Fullmer-EGF002 <[email-masked]>, [email-masked],
        [email-masked]

Earnie Boyd <[email-masked]> 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
"[email-masked]" with one line of text: "help".