X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Mon, 18 Aug 2008 15:39:30 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Bug in cygcheck (1.7)
Message-ID: <20080818133930.GK21040@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <48A787F0.408@cwilson.fastmail.fm> <48A8188E.4030203@elite-systems.org> <20080817165425.GA3708@ednor.casa.cgf.cx> <48A85BA5.20501@cwilson.fastmail.fm> <48A8E552.3070803@cwilson.fastmail.fm> <20080818032220.GA28914@ednor.casa.cgf.cx> <48A8F8A7.8080805@cwilson.fastmail.fm>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <48A8F8A7.8080805@cwilson.fastmail.fm>
User-Agent: Mutt/1.5.16 (2007-06-09)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Aug 18 00:20, Charles Wilson wrote:
> Christopher Faylor wrote:
> > Have you investigated the possibility that one of the package files
> > may be corrupted?
> 
> Not really -- but when I run cygcheck.exe under gdb, I get all the
> packages listed properly (when 'set arg -cd') -- so I really don't think
> that's it.

I can reproduce the problem 1 out of 3 or 4.  I also added some
additional debug output for a start:

  get_packages()
  [...]
    for (n = 0; fgets (buf, 4096, fp) && n < nlines;)
      {
	char *package = strtok (buf, " ");
	printf ("(%8ld) %-20s :: %-20s\n",
		ftell (fp), package ?: "<NULL>", argv[0]);
        [...]
      }
    printf ("finished\n");

And that's weird, when the problem occurs, ftell(fp) prints the
same offset into the file twice:

  [...]
  (     502) automake1.8          :: openssh
  (     545) automake1.9          :: openssh
  (     545) automake1.9          :: openssh

and then the next call to fgets() just pegs out.

The next test was not to call load_cygwin().  In this case, the problem
seems to disappear.  I can't reproduce it in 100s of calls.

Next, I call LoadLibrary ("cygwin1.dll") but none of the other
processing in load_cygwin().  Still no problem.

Next, enable the FreeLibrary call.  Now the problem reappears.

So it's the FreeLibrary call which triggers the problem.  What I don't
understand so far is, why it does.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
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/

