This is the mail archive of the
mailing list for the Cygwin project.
Re: Unbelievably obscure setup bug
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin-apps at cygwin dot com
- Date: Fri, 19 Nov 2010 14:13:35 +0100
- Subject: Re: Unbelievably obscure setup bug
- References: <4CE6650F.firstname.lastname@example.org>
- Reply-to: cygwin-apps at cygwin dot com
On Nov 19 11:52, Jon TURNEY wrote:
> Whilst trying to write some other modifications to setup.exe, I've found what
> looks like an obscure bug introduced in the following change:
> > CVSROOT: /sourceware/projects/cygwin-apps-home/cvsfiles
> > Module name: setup
> > Changes by: email@example.com 2009-05-07 14:14:59
> > Modified files:
> > . : ChangeLog package_db.cc
> > Log message:
> > * package_db.cc (ConnectedLoopFinder::doIt): Revert patch from
> > 2008-08-29. Add dumb hardcoded algorithm to make sure base-cygwin
> > and base-passwd are always the first packages in the postinstall
> > executable order.
> > Patches:
> > http://sourceware.org/cgi-bin/cvsweb.cgi/setup/ChangeLog.diff?cvsroot=cygwin-apps&r1=2.618&r2=2.619
> > http://sourceware.org/cgi-bin/cvsweb.cgi/setup/package_db.cc.diff?cvsroot=cygwin-apps&r1=2.40&r2=2.41
> This change to package_db.cc doesn't do what it claims as casecompare()
> returns 0 to indicate equality.
> Since db.packages is sorted alphabetically, it looks like it actually inserts
> the dependencies of the first (in alphabetical order) installed package
> (assuming that's not base-cygwin or base-passwd), twice.
> The log output actually shows this happening. In my case aewm++ is the
> installed package which comes first in alphabetical order, which is why the
> logged dependency order list before running the postinstall scripts starts
> "Dependency order of packages: base-cygwin base-passwd cygwin libgcc1 libXau6
> libXdmcp6 libxcb1 libX11_6 libXext6 aewm++ aewm++ ..."
> Attached is the obvious patch to fix this, but I'm not sure that's right, as
> it runs base-passwd and base-cygwin in the opposite order to the comment
> ("Dependency order of packages: base-passwd cygwin base-cygwin ..."), which
> isn't very clear about if they merely both have to run first, or in a
> given order
The code in question was supposed to make sure that the order is always
"base-cygwin base-passwd [...]" and that was the case so far. Of
course, given the obvious mishandling of the casecompare return value
it's not clear why this ever worked. Even more mysterious is the fact
that the bugfix *breaks* this order. Well, time to debug...
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com