Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <006301c1273f$4c2dfdf0$1d00a8c0@obs.local> From: "Stanimir Peev" To: Subject: BUG found in cygwin1.dll : cygwin_dll_init() crash Date: Fri, 17 Aug 2001 20:08:55 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 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/