Mail Archives: cygwin/2001/08/17/13:07:57
Hi,
this mail is for cygwin developers mailing list I suppose, but as I am not
subscribed to it, I have to send it here (cygwin AT cygwin DOT com).
I hope that someone would read it and send it where it should.
I found out some postings in the cygwin mailing list about a bug (actually a
"crash") that appeared when someone tries to
load the cygwin1.dll using LoadLibrary() and then calls the
"cygwin_dll_init()" function.
Because I needed this functionnality too, the same happened to me.
I think that I know the reason for this, and I want to allert you about it,
so that you can fix it in the next release of cygwin dll.
As I understood, the most important part of "cygwin_dll_init" is that is
calls "dll_crt0_1 ()"
From it side the "dll_crt0_1()" calls "pinfo_init()" function, which calls
"environ_init()".
The "environ_init()" function call "posify()" for some enviroment variables
like "TEMP" or "TMP" and some
others. To the "posify" calls "getwinenv" which uses "cur_environ()"
function. The problems comes exactly
from this function. It tries to access two poitners "*main_environ" and
"__cygwin_environ". The problem is that
till the moment when these two are accessed they are never initialized. So
as you can imagine, the DLL just crashes.
I noticed that "*main_environ" is initialized in "_dll_crt0 ()" but this
funtion is never used during dynamic loading with LoadLibrary()
so the "*main_environ" points to a random location in the memory. Sadly
enough but I could not find out where the __cygwin_environ is
initialized at all.
Well, that is all from me. I hope that it would be easier for you now to fix
this bug.
Best Regards,
Stanimir Peev
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -