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: LD_PRELOAD regression on 1.5.19-4 ? no more loaded library in child process

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 !


>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)
>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  <cgf@DONTQUOTERAWEMAIL>

Please don't send my email address to public mailing lists.

> * Remove ld_preload declaration.
> * winsup.h: Move ld_preload declaration here.
> * (fork_child): Call ld_preload() before returning.
>So this issue was corrected by version 1.158 of ffork.ccd I
>took a quick look into the, & 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

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.


Unsubscribe info:
Problem reports:

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