X-Spam-Check-By: sourceware.org Date: Thu, 26 Jan 2006 13:37:15 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: LD_PRELOAD regression on 1.5.19-4 ? no more loaded library in child process Message-ID: <20060126183715.GB30765@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com References: <5CD8C8F9F151D142922161D4CF32F9400573F5EF AT exch-lv03 DOT intl DOT businessobjects DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5CD8C8F9F151D142922161D4CF32F9400573F5EF@exch-lv03.intl.businessobjects.com> User-Agent: Mutt/1.5.11 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Thu, Jan 26, 2006 at 11:37:18AM +0100, Louis Lecaroz wrote: >Hi all CygWin champions developers ;) > >Since this version, the LD_PRELOAD tag is no more replicated to >subprocess (Win32 version of cygwin). That means, if I set the >LD_PRELOAD variable, only the parent process calls the LoadLibrary & >load the DLL defined in LD_PRELOAD. > >In this case, when starting bash, the LD_PRELOAD command is executed. >but when starting a cp.exe, cat.exe or another cygwin command from the >bash shell, the LD_PRELOAD is no more executed ! Please CALM DOWN. >If I performed : >SET LD_PRELOAD=/cygdrive/d/mydll.dll >c:\bash (mydll.dll loaded correctly) >$cp toto.txt titi.txt (no mydll.dll loaded !) > >If I performed : >SET LD_PRELOAD=/cygdrive/d/mydll.dll >c:\bash (mydll.dll loaded correctly) >$cmd >c:\cp toto.txt titi.txt (mydll.dll loaded) > >So, it works now in this last build of cygwin as it was working >previously the snapshot #20050811 > >To correct this, a snapshot has been provided, snapshot #20050811, See >ChangeLog in winsup\cygwinChangeLog : >2005-08-11 Christopher Faylor Please don't send my email address to public mailing lists. > * dcrt0.cc: Remove ld_preload declaration. > * winsup.h: Move ld_preload declaration here. > * fork.cc (fork_child): Call ld_preload() before returning. > >So this issue was corrected by ffork.cc version 1.158 of ffork.ccd I >took a quick look into the ffork.cc, & I saw that the >fixup_hooks_after_fork () & _my_tls.fixup_after_fork () are now called >after ld_preload instead of before as deliverd in snapshot #20050811. >I don't know exactly if this is the reason of my issue. I'm sorry but I don't really understand this report. I implemented LD_PRELOAD because I have software which needs it. I would notice if it wasn't working in subprocesses and I've just confirmed that it does, in fact get propagated and loaded. So whatever your problem is, it isn't as simple as what you are describing. I appreciate the fact that you're making the effort to look at the source code but, in general, just quoting something like this with no understanding of what the change does is not really going to be very useful. If you are building this from source then maybe you could put some "small_printf ("...");" entries in the code to illustrate what is going on since, as I said, it WFM. cgf -- 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/