This is the mail archive of the 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: cygpath hangs from postinstall scripts when called like $(cygpath -S) but not otherwise

On Sat, Oct 04, 2003 at 10:52:26AM -0400, Igor Pechtchanski wrote:
>On Sat, 4 Oct 2003, Cliff Hones wrote:
>> I ran cygcheck on cygpath, and was surprised to discover
>> that it has a dependence on msvcrt (as well as cygwin1):
>> $ cygcheck /bin/cygpath.exe
>> D:/cygwin/bin/cygpath.exe
>>   D:/cygwin/bin\cygwin1.dll
>>     D:\WINNT\system32\KERNEL32.dll
>>       D:\WINNT\system32\NTDLL.DLL
>>   D:\WINNT\system32\SHELL32.DLL
>>     D:\WINNT\system32\GDI32.DLL
>>       D:\WINNT\system32\USER32.DLL
>>     D:\WINNT\system32\ADVAPI32.DLL
>>       D:\WINNT\system32\RPCRT4.DLL
>>     D:\WINNT\system32\SHLWAPI.DLL
>>       D:\WINNT\system32\msvcrt.dll
>>     D:\WINNT\system32\COMCTL32.DLL
>>I thought that using the msvcrt and cygwin1 dll's in the same
>>executable was likely to cause crashes or hangs - is this no longer the
>>case, or could this be the problem with the postinstall?
>Wow! Good thinking, Cliff! I think you may be on to something...  ISTM
>that the problem could manifest itself when running from setup as
>opposed to from the shell because setup is a Windows program, so some
>MSVCRT functions may be found before the Cygwin ones...  We could test
>by using "cygstart cygpath" or "run cygpath" or something.

I don't know what the statement "some MSVCRT functions may be found
before the Cygwin ones" means.

Who's going to find these functions?  cygpath.exe is not going to
accidentally use ar function with the same name from another DLL.  That's
not how it works.  msvcrt is being loaded by SHLWAPI.DLL so there isn't
much likelihood of toe stepping between it and cygwin.  I would suspect
that cygpath isn't the only program which loads msvcrt in this fashion.
There's not much we can do about it, and if it was a problem, I think
we'd know about it by now.

Adding cygstart just adds another non-cygwin process in the mix, causing
cygwin's exec stub to behave differently.

Unsubscribe info:
Problem reports:

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