This is the mail archive of the cygwin 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]
Other format: [Raw text]

Re: Old Cygwin Versions -or- Elusive Compatability Problem

On Thu, 24 Jun 2004, Alan Larkin wrote:

> > FWIW, I didn't find a -Xrun flag in the Sun JDK.  I did find a -Xrunhprof
> > flag, which doesn't seem to allow running an external program...  You
> > should let the list know if you're using another JDK.  BTW, from your
> > description above, it's unclear whether you actually run an executable, or
> > dynamically load a DLL.  If the latter, you should know that the Cygwin
> > DLL is not amenable to dynamic loading, and there are no plans to fix it
> > ATM.
> I never noticed that its not in the help before, but I assure you that Sun
> JVMs support it (-Xrunhprof is a particular instance that loads hprof.dll, a
> profiler built in exactly the same manner as mine). Its a DLL. If I invoke
> java -Xruncygforrest-0:<options> HelloWorld
> (or more simply
> java -Xruncygforrest-0:help
> to print out my profilers help message)
> the JVM looks for a hook in forrest.dll which sets things in motion. I have
> seen all sorts of crashes and error messages whilst developing this, but its
> just so queer to see nothing!
> The Cygwin DLL must be dynamically loading ...
> $ nm ./cygforrest-0.dll | grep -C 2 cygwin
> 10047d40 B __bss_end__
> 10043000 B __bss_start__
> 10018630 T __cygwin_crt0_common@8
> 10018030 T __cygwin_dll_entry@12
> 10018100 T __cygwin_noncygwin_dll_entry@12
> [snip]
> 100185c0 T _cygwin_attach_dll
> 100185b0 T _cygwin_detach_dll
> [snip]
> 10018330 T _dlclose
> Maybe this was possible up to but not after version 1.5.5? Might that be the
> cause?
> I appreciate your help,
> Alan.


Ok, I see now.  Well, the Cygwin DLL does pay lip service to dynamic
loading (i.e., defines all the necessary methods and entry points), but
it's never reliably loaded dynamically (i.e., via LoadLibrary or dlopen),
since it doesn't perform the necessary initialization in that case.  This
is a known problem, and, as I said above, nobody is working on resolving
it, due to lack of interest.  Maybe you were just lucky that it worked
with 1.5.5, e.g., the parts that weren't initialized properly weren't
touched in what you used in your program, as they are now?  If you expect
this to get fixed, you'll probably have to be the one to fix it[*].

FWIW, you could still try strace on the whole java process (it will, of
course, only trace the Cygwin parts, but it might give you some clues).
[*] See <> for instructions on how to build
Cygwin and submit patches.
      |\      _,,,---,,_
ZZZzz /,`.-'`'    -.  ;-;;,_
     |,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:
Problem reports:

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