X-Spam-Check-By: sourceware.org Date: Mon, 21 Aug 2006 09:26:05 -0400 (EDT) From: Igor Peshansky Reply-To: cygwin AT cygwin DOT com To: Eric Thomas cc: cygwin AT cygwin DOT com Subject: Re: program fails to find it's DLL In-Reply-To: <44E96313.7040802@claranet.fr> Message-ID: References: <44E96313 DOT 7040802 AT claranet DOT fr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Mon, 21 Aug 2006, Eric Thomas wrote: > Hi all, > > I've got an issue here with some command line programs, all from the > same editor. > > Commands are issued from bash 3.0.16-14 / cygwin 1.5.18-1 on a > computer running W2K SP4. > Everything was ok until someone introduced an invalid path in the > default PATH that bash inherits from cmd.exe . > Let's say that PATH is made of 3 parts: > A : valid path > B : invalid path ("invalid" means that it raise my issue) > C : valid path > > Since, those programs raise a pop-up to complain that some DLL is > missing in "path displayed". > But "path displayed" is incomplete. In fact "path displayed" is only the > A part. > The missing DLL belongs to one dir of the C part. > So, this invalid value prevents the program to look further in the last > part of PATH. > > Well, one would think that the problem is only on the program's side > (and maybe it is). But there are other arguments to look at too. > > Only some kind of path format can raise the issue. > Let's say that > /cygdrive/c/a is a directory > /cygdrive/c/b is a regular file > /cygdrive/c/c does not exist > > Issue raised with > /cygdrive/c/b/ > /cygdrive/c/b/anyfilename_or_dirname > > It will also happen with a true invalid path like this one: > /cygdrive/sure_I_am_an_invalid_path > > But the following won't: > /cygdrive/c/a > /cygdrive/c/b > /cygdrive/c/c > everything that doesn't start with /cygdrive > > Facts: > - I didn't managed to reproduce the problem when issuing the command > directly from a cmd.exe, excepted by setting PATH to "" of course. But > an invalid path placed in PATH does not hurt. > - I didn't managed to reproduce the problem with any other program that > would requiere some DLL (excel for instance) > > So it makes me think that It could be related to cygwin in some way, > even if it occurs only with those programs because they probably behave > differently from other programs... > > I've done a fresh installation of cygwin (bash 3.1-6 / cygwin 1.5.21-2) > on another computer. > Some changes with this one: > - no more pop-up, but the program still fails to run due to its missing > DLL > - now "/regular_file/" will also raise the problem (at least this point > is consistent now) > > Could those programs explicitly load some DLL after they start-up ? and > rely on PATH to do it on purpuse ? > If so, they manage to deal with invalid path when running from cmd.exe. > Something must be different when run from bash. > > Just in case you wonder: same behaviour with ash. > > Any comment welcome and appreciated Known issue. It's not the shell, actually -- it's Cygwin's path conversion. It will stop converting the path as soon as it encounters an invalid directory. This also arises when some broken installers put quotes in the PATH. I believe I've had a patch for this somewhere, though don't recall whether it was applied or not. You might want to search the cygwin-patches archive and look at path.cc in Cygwin sources. I'll try to locate the patch file and resubmit. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com ZZZzz /,`.-'`' -. ;-;;,_ Igor Peshansky, Ph.D. (name changed!) |,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte." "But no -- you are no fool; you call yourself a fool, there's proof enough in that!" -- Rostand, "Cyrano de Bergerac" -- 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/