This is the mail archive of the cygwin-apps@cygwin.com 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: Setup 2.218.2.4 (fixed?)



> -----Original Message-----
> From: Christopher Faylor [mailto:cgf@redhat.com] 
> Sent: Tuesday, May 14, 2002 2:57 PM
> To: cygwin-apps@cygwin.com
> Subject: Re: Setup 2.218.2.4 (fixed?)
> 
> 
> On Mon, May 13, 2002 at 12:19:41PM -0400, Christopher Faylor wrote:
> >On Mon, May 13, 2002 at 09:05:52PM +1000, Robert Collins wrote:
> >>>I've noticed the same problem on a non-smb directory, fwiw.
> >>
> >>dir you mean as in "d:\foo" or as in NFS mounted?
> >
> >Occam's razor.
> 
> I think I've tracked this problem down.  I've checked in a 
> couple of fixes in the branch.  I've put up a new version of 
> setup.exe on sourceware.

Thanks. Somehow your version grabs atoi from cygwin1.dll. Doh. I'm about
to upload a new version.
 
> I believe that there were a couple of problems.  One was that 
> setup.exe would consider anything with the string "setup.ini" 
> to be a potential setup.ini file.  The reason for this is 
> that Robert (or someone) seems enamored of the use of strstr 
> for path manipulation.  I think I've mentioned before that 
> you really can't do a strstr (path, "foo.bar") and assume 
> that any foo.bar that means that the file component is 
> "foo.bar". This assumption exists in several places in the 
> source code.

Yeah, it was on my this-is-not-quite-right list, but I didn't think it
could be causing the crashes..
 
> In my case, setup.exe was parsing files like setup.ini.old, 
> setup.ini~, and setup.ini.orig.  This caused problems since 
> the assumption was that the setup.ini was the trailing 
> component of a path spec, which it wasn't.

Ah, so the trailing path was calculated as ...setup/ (given
setup.ini.orig).
 
> The other problem was the clobbering of a global buffer.  
> This resulted in either a stack overrun or just a hung setup.exe.
> 
> I've attached the patch and ChangeLog below.  I didn't try to 
> check this into the trunk since I thought that Robert would 
> look at it and want to do something another way.

I might, but in no great rush. If you've got the time, please port this
forward.
 
> Can I suggest that probably setup.exe needs something like a 
> "suffix" function which operates similarly to strstr but only 
> returns a non-NULL pointer if the string matches the last 
> strlen(string) characters of a path?

The STL provides rfind, and suffix could be created as a semi-trivial
wrapper of rfind.

Thanks for this Chris.

Rob


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