Re: Loading gcc-compiled DLL with Java (JNI) crashes when using newer (1.5.5) cygwin1.dll

2004-10-26 Thread Igor Pechtchanski
Alain,

Please send Cygwin-related questions to the Cygwin mailing list at cygwin
at cygwin dot com.  Not only will you get access to more expertise than
any one person can provide, but your questions and the replies to them
will get archived on the web for others to find.

I've forwarded this reply to the list and set the Reply-To: field
accordingly.

On Tue, 26 Oct 2004, ademoulian wrote:

 Have you got any explanation of this problem,
 For I have the same problem, my program stop on the
 System.load(c:/path/libnative.dll)
 There is no error, but the program seems to be in an infinite loop in
 this routine.

 Thank you very much for helping me .

Dynamic loading of Cygwin DLLs has been broken for some time.  Since this
doesn't affect the core Cygwin developers, there's little motivation for a
fix.  You could try debugging this yourself and (hopefully) submitting a
patch, or use the -mno-cygwin option of gcc, which will build a MinGW
version of your DLL (with all the associated limitations -- please see
http://mingw.org/ for where to ask for help on MinGW).
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski, Ph.D.
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing.  -- Dr. Jubal Harshaw

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Loading gcc-compiled DLL with Java (JNI) crashes when using newer (1.5.5) cygwin1.dll

2004-09-24 Thread Igor Pechtchanski
Norbert,

Please do not send private mail with Cygwin questions.  All Cygwin
questions should be addressed to the appropriate Cygwin mailing list.
Addressing your questions to the list not only gives you access to more
expertise than any one person can provide, but also ensures that your
questions and the answers you get are archived on the web for others to
find later.  I'm forwarding this message to the main Cygwin mailing list,
and setting the Reply-To: field accordingly.

On Fri, 24 Sep 2004, Norbert Krömeke wrote:

 Hi Igor,

 I have the same Problem on Windows 2000. While the Jave VM try to load
 my DLL compiled with 1.5.11 cygwin, she stays in
 System.load() for ever. No Exception will be generated.

 The same sources compiled with 1.5.5 are loaded without
 any problems.

 Any idea?

 Best Regards
 Norbert Krömeke

http://cygwin.com/acronyms/#PPAST.  I doubt anyone will be able to
figure out which Problem you're referring to without a quoted message or
a description.

At a guess, you mean that you've built a DLL with Cygwin's gcc, and are
unable to load that into a Java VM via JNI.  This is expected behavior --
cygwin1.dll is *not* dynamically loadable (and thus, any DLL that depends
on it won't be).  http://cygwin.com/acronyms/#PTC.

You may consider MinGW as your alternative (use the -mno-cygwin gcc option
when building the DLL).  Be aware that a) you won't get all of the POSIX
functionality that Cygwin provides, and b) any questions about this setup
should be addressed to the MinGW mailing lists.
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski, Ph.D.
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing.  -- Dr. Jubal Harshaw

cygcheck.out
Description: Binary data
--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/

Loading gcc-compiled DLL with Java (JNI) crashes when using newer (1.5.5) cygwin1.dll

2004-08-29 Thread Carlo Jennetten
Hi,

I read the message 2004-04/msg00099.html and I ran into the same problems.
The option -mno-cygwin didnt't work as well. My only question is about the
state of this issue (bug). Is there someone fixing it, or is it planned to
fix it soon, ...? Because I'd need it urgently.

Best regards,
Carlo


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Loading gcc-compiled DLL with Java (JNI) crashes when using newer (1.5.5) cygwin1.dll

2004-04-05 Thread Christopher Faylor
On Sun, Apr 04, 2004 at 01:44:56PM -0700, Hans Horn wrote:
The correct switch is -mno-cygwin.  -mno-cygwin should be equivalent to
building with the mingw compiler unless you try to include cygwin header
files or libraries, which is a common mistake.

Chris, sorry that was I typo in my posting!
I used gcc -mno-cygwin rather than -no-cygwin, and this did NOT produce a
working dll
mingw-gcc did!

Well, there's really not enough data to go on here.  I assume that you must
have linked cygwin libraries in somehow.
--
Christopher Faylor
Cygwin Co-Project Leader
TimeSys, Inc.

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Loading gcc-compiled DLL with Java (JNI) crashes when using newer (1.5.5) cygwin1.dll

2004-04-04 Thread Hans Horn
The correct switch is -mno-cygwin.  -mno-cygwin should be equivalent to
building with the mingw compiler unless you try to include cygwin header
files or libraries, which is a common mistake.

Chris, sorry that was I typo in my posting!
I used gcc -mno-cygwin rather than -no-cygwin, and this did NOT produce a
working dll
mingw-gcc did!

thx for responding,
H.




--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Loading gcc-compiled DLL with Java (JNI) crashes when using newer (1.5.5) cygwin1.dll

2004-04-03 Thread Frédéric L. W. Meunier
On Fri, 2 Apr 2004, Hans Horn wrote:

 this was something I did try out as well. However, the dll produced with
 -no-cygwin was just as bad as before.
 Then I recalled faintly reading some discussion a while back, that
 mingw-gcc != gcc -no-cygwin (don't remember details, though).

-no-cygwin ? I thought it was -mno-cygwin. Or are both the same
thing ?

-- 
http://www.pervalidus.net/contact.html

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Loading gcc-compiled DLL with Java (JNI) crashes when using newer (1.5.5) cygwin1.dll

2004-04-03 Thread Christopher Faylor
On Sat, Apr 03, 2004 at 06:32:16AM -0300, Fr?d?ric L. W. Meunier wrote:
On Fri, 2 Apr 2004, Hans Horn wrote:

 this was something I did try out as well. However, the dll produced with
 -no-cygwin was just as bad as before.
 Then I recalled faintly reading some discussion a while back, that
 mingw-gcc != gcc -no-cygwin (don't remember details, though).

-no-cygwin ? I thought it was -mno-cygwin. Or are both the same
thing ?

The correct switch is -mno-cygwin.  -mno-cygwin should be equivalent to
building with the mingw compiler unless you try to include cygwin header
files or libraries, which is a common mistake.
--
Christopher Faylorspammer? - [EMAIL PROTECTED]
Cygwin Co-Project Leader  [EMAIL PROTECTED]
TimeSys, Inc.

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Loading gcc-compiled DLL with Java (JNI) crashes when using newer (1.5.5) cygwin1.dll

2004-04-02 Thread Hans Horn
Dear Group,

I'd like to follow up on this seemingly abandoned thread.

I just ran into the same problem as reported by Niklas.

Googling around brought me to the idea to try to use mingw's gcc flavour to
create the desired dll.
I just downloaded and uncompressed four of the mingw packages mentioned on
http://www.mingw.org/download.shtml (mingw-runtime, w32api, binutils and gcc
tarball packages) and followed the hints given here:
http://www.mingw.org/mingwfaq.shtml#faq-jni-dll, essentially,

mingw-gcc -Wall -D_JNI_IMPLEMENTATION_ -Wl,--kill-at -shared ...

The JNI dll created this way works neatly (and doesn't make the JVM croak as
the dll created using cygwin's gcc).
This may be just a temporary work-around until cygwin's gcc is back on
track, but at least one can live with it!

cheers,
Hans

Larry Hall [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 At 02:40 PM 3/10/2004, you wrote:
 Igor Pechtchanski wrote:
 
 The core Cygwin DLL (/bin/cygwin1.dll) has no support for dynamic
loading.
 You may have been lucky before in that the functionality you had in your
 DLL didn't require the loading of the core one.  Apparently this has
 changed between 1.5.5 and 1.5.7.
 
 Right. This seems to be, on the face of it, the same problem that bit the
WinCVS users - WinCVS looks for a tcl84.dll in the PATH and automatically
dynamically loads it, and if it happens to be a Cygwin-compiled one, it
hangs. This also changed after 1.5.6 - before that, it would work, for
some definition of working.
 
 Someone (I see eyes turning this way :-) needs to debug this, at least to
understand what changed..


 Dynamic loading of cygwin1.dll has been broken for a very long time.  That
 doesn't mean it cannot be fixed.  Just that figuring out what changed
 between 1.5.5 and 1.5.7 and reinstating it would not be a fix.  It's
 the Cygwin DLL initialization that needs attention really.  But I do
 expect that everyone would like it if someone got this working again. :-)


 --
 Larry Hall  http://www.rfk.com
 RFK Partners, Inc.  (508) 893-9779 - RFK Office
 838 Washington Street   (508) 893-9889 - FAX
 Holliston, MA 01746






--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Loading gcc-compiled DLL with Java (JNI) crashes when using newer (1.5.5) cygwin1.dll

2004-04-02 Thread Igor Pechtchanski
FYI, there was no need for you to go to all this trouble.  You could have
instead installed the gcc-mingw and mingw-runtime packages via
Cygwin's setup, and gotten the same functionality via gcc -mno-cygwin.

As long as your DLL doesn't use any of Cygwin's POSIX features, you should
be fine with a MinGW version (i.e., -mno-cygwin one).
Igor

On Fri, 2 Apr 2004, Hans Horn wrote:

 Dear Group,

 I'd like to follow up on this seemingly abandoned thread.

 I just ran into the same problem as reported by Niklas.

 Googling around brought me to the idea to try to use mingw's gcc flavour
 to create the desired dll.
 I just downloaded and uncompressed four of the mingw packages mentioned
 on http://www.mingw.org/download.shtml (mingw-runtime, w32api, binutils
 and gcc tarball packages) and followed the hints given here:
 http://www.mingw.org/mingwfaq.shtml#faq-jni-dll, essentially,

 mingw-gcc -Wall -D_JNI_IMPLEMENTATION_ -Wl,--kill-at -shared ...

 The JNI dll created this way works neatly (and doesn't make the JVM
 croak as the dll created using cygwin's gcc).
 This may be just a temporary work-around until cygwin's gcc is back on
 track, but at least one can live with it!

 cheers,
 Hans

 Larry Hall cygwin-lhatcygwindotcom wrote:
  At 02:40 PM 3/10/2004, you wrote:
  Igor Pechtchanski wrote:
  
  The core Cygwin DLL (/bin/cygwin1.dll) has no support for dynamic
  loading. You may have been lucky before in that the functionality
  you had in your DLL didn't require the loading of the core one.
  Apparently this has changed between 1.5.5 and 1.5.7.
  
  Right. This seems to be, on the face of it, the same problem that bit
  the WinCVS users - WinCVS looks for a tcl84.dll in the PATH and
  automatically dynamically loads it, and if it happens to be a
  Cygwin-compiled one, it hangs. This also changed after 1.5.6 - before
  that, it would work, for some definition of working.
  
  Someone (I see eyes turning this way :-) needs to debug this, at
  least to understand what changed..
 
  Dynamic loading of cygwin1.dll has been broken for a very long time.
  That doesn't mean it cannot be fixed.  Just that figuring out what
  changed between 1.5.5 and 1.5.7 and reinstating it would not be a fix.
  It's the Cygwin DLL initialization that needs attention really.  But I
  do expect that everyone would like it if someone got this working
  again. :-)

-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski, Ph.D.
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster.  -- Patrick Naughton

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Loading gcc-compiled DLL with Java (JNI) crashes when using newer (1.5.5) cygwin1.dll

2004-04-02 Thread Hans Horn
Hi Igor,

this was something I did try out as well. However, the dll produced with
-no-cygwin was just as bad as before.
Then I recalled faintly reading some discussion a while back, that
mingw-gcc != gcc -no-cygwin (don't remember details, though).

For better or worse, I'm in business now!

thx,
Hans

FYI, there was no need for you to go to all this trouble.  You could have
instead installed the gcc-mingw and mingw-runtime packages via
Cygwin's setup, and gotten the same functionality via gcc -mno-cygwin.

As long as your DLL doesn't use any of Cygwin's POSIX features, you should
be fine with a MinGW version (i.e., -mno-cygwin one).
Igor




--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Loading gcc-compiled DLL with Java (JNI) crashes when using newer (1.5.5) cygwin1.dll

2004-03-10 Thread Shankar Unni
Igor Pechtchanski wrote:

The core Cygwin DLL (/bin/cygwin1.dll) has no support for dynamic loading.
You may have been lucky before in that the functionality you had in your
DLL didn't require the loading of the core one.  Apparently this has
changed between 1.5.5 and 1.5.7. 
Right. This seems to be, on the face of it, the same problem that bit 
the WinCVS users - WinCVS looks for a tcl84.dll in the PATH and 
automatically dynamically loads it, and if it happens to be a 
Cygwin-compiled one, it hangs. This also changed after 1.5.6 - before 
that, it would work, for some definition of working.

Someone (I see eyes turning this way :-) needs to debug this, at least 
to understand what changed..

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: Loading gcc-compiled DLL with Java (JNI) crashes when using newer (1.5.5) cygwin1.dll

2004-03-10 Thread Larry Hall
At 02:40 PM 3/10/2004, you wrote:
Igor Pechtchanski wrote:

The core Cygwin DLL (/bin/cygwin1.dll) has no support for dynamic loading.
You may have been lucky before in that the functionality you had in your
DLL didn't require the loading of the core one.  Apparently this has
changed between 1.5.5 and 1.5.7. 

Right. This seems to be, on the face of it, the same problem that bit the WinCVS 
users - WinCVS looks for a tcl84.dll in the PATH and automatically dynamically loads 
it, and if it happens to be a Cygwin-compiled one, it hangs. This also changed after 
1.5.6 - before that, it would work, for some definition of working.

Someone (I see eyes turning this way :-) needs to debug this, at least to understand 
what changed..


Dynamic loading of cygwin1.dll has been broken for a very long time.  That
doesn't mean it cannot be fixed.  Just that figuring out what changed 
between 1.5.5 and 1.5.7 and reinstating it would not be a fix.  It's 
the Cygwin DLL initialization that needs attention really.  But I do 
expect that everyone would like it if someone got this working again. :-)


--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
838 Washington Street   (508) 893-9889 - FAX
Holliston, MA 01746 


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Loading gcc-compiled DLL with Java (JNI) crashes when using newer (1.5.5) cygwin1.dll

2004-03-09 Thread Martin Proefrock
It just worked fine with 1.5.5. Now, using 1.5.7, Java crashes inside
the System.LoadLibrary call, even with a nearly empty DLL.

I can't use -mno-cygwin because I use cygwin-specific stuff.

Any hints, beside using the older version?

Martin


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Loading gcc-compiled DLL with Java (JNI) crashes when using newer (1.5.5) cygwin1.dll

2004-03-09 Thread Larry Hall
At 03:35 PM 3/9/2004, you wrote:
It just worked fine with 1.5.5. Now, using 1.5.7, Java crashes inside
the System.LoadLibrary call, even with a nearly empty DLL.

I can't use -mno-cygwin because I use cygwin-specific stuff.

Any hints, beside using the older version?


Try a snapshot. http://cygwin.com/snapshots/



--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
838 Washington Street   (508) 893-9889 - FAX
Holliston, MA 01746 


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Loading gcc-compiled DLL with Java (JNI) crashes when using newer (1.5.5) cygwin1.dll

2004-03-09 Thread Martin Proefrock
It just worked fine with 1.5.5. Now, using 1.5.7, Java crashes inside
the System.LoadLibrary call, even with a nearly empty DLL.

 Try a snapshot. http://cygwin.com/snapshots/

It still crashes when using the latest snapshot 20040306.



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Loading gcc-compiled DLL with Java (JNI) crashes when using newer (1.5.5) cygwin1.dll

2004-03-09 Thread Igor Pechtchanski
On Tue, 9 Mar 2004, Martin Proefrock wrote:

 It just worked fine with 1.5.5. Now, using 1.5.7, Java crashes inside
 the System.LoadLibrary call, even with a nearly empty DLL.

  Try a snapshot. http://cygwin.com/snapshots/

 It still crashes when using the latest snapshot 20040306.

The core Cygwin DLL (/bin/cygwin1.dll) has no support for dynamic loading.
You may have been lucky before in that the functionality you had in your
DLL didn't require the loading of the core one.  Apparently this has
changed between 1.5.5 and 1.5.7.  Since this isn't supported, you're
basically on your own...  Sorry.
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski, Ph.D.
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster.  -- Patrick Naughton

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Loading gcc-compiled DLL with Java (JNI) crashes when using newer (1.5.5) cygwin1.dll

2004-03-09 Thread Larry Hall
At 04:53 PM 3/9/2004, you wrote:
On Tue, 9 Mar 2004, Martin Proefrock wrote:

 It just worked fine with 1.5.5. Now, using 1.5.7, Java crashes inside
 the System.LoadLibrary call, even with a nearly empty DLL.

  Try a snapshot. http://cygwin.com/snapshots/

 It still crashes when using the latest snapshot 20040306.

The core Cygwin DLL (/bin/cygwin1.dll) has no support for dynamic loading.
You may have been lucky before in that the functionality you had in your
DLL didn't require the loading of the core one.  Apparently this has
changed between 1.5.5 and 1.5.7.  Since this isn't supported, you're
basically on your own...  Sorry.


Oh jeez.  I guess I was too much on my try a snapshot bandwagon today.
Rereading I noticed that Martin mentioned that he was trying to 
dynamically load a Cygwin-enabled DLL.  So yeah, the snapshot isn't going
to help here.  Without Cygwin-enabled Java or a kind patch to the Cygwin 
DLL, this isn't going to work, just as Igor said.

But trying a snapshot was fun, wasn't it?! ;-)


--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
838 Washington Street   (508) 893-9889 - FAX
Holliston, MA 01746 


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/