public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: Re[3]: setup-2.243 Crash / Install from Local Directory / WinXP
@ 2002-05-22 10:10 Robert Collins
  2002-05-22 13:24 ` Re[5]: " Pavel Tsekov
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Collins @ 2002-05-22 10:10 UTC (permalink / raw)
  To: Pavel Tsekov; +Cc: Max Bowsher

Thanks Pavel. I've no time to test this tonight, but:

==
Index: IniParseFindVisitor.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/IniParseFindVisitor.cc,v
retrieving revision 2.2
diff -u -p -r2.2 IniParseFindVisitor.cc
--- IniParseFindVisitor.cc	19 May 2002 12:54:16 -0000	2.2
+++ IniParseFindVisitor.cc	22 May 2002 14:56:13 -0000
@@ -62,7 +62,11 @@ IniParseFindVisitor::visitFile(String co
   /* Copy leading part of path to temporary buffer and unescape it */
   
   String prefix (&basePath.cstr_oneuse()[baseLength + 1]);
-  String mirror = rfc1738_unescape_part (prefix.substr(0,prefix.size()
- 1));
+  String mirror;
+  if (prefix.size())
+    mirror = rfc1738_unescape_part (prefix.substr(0,prefix.size() -
1));
+  else
+    mirror = String ();
   _Builder.parse_mirror = mirror;
   ini_init (ini_file, &_Builder);
   ==
may help.

Rob

> -----Original Message-----
> From: Pavel Tsekov [mailto:ptsekov@syntrex.com] 
> Sent: Thursday, May 23, 2002 12:32 AM
> To: Pavel Tsekov
> Cc: Robert Collins; Pavel Tsekov; Max Bowsher
> Subject: Re[3]: setup-2.243 Crash / Install from Local 
> Directory / WinXP
> 
> 
> Wednesday, May 22, 2002, 2:34:47 PM, you wrote:
> 
> PT> I can confirm this - here is the output shown from Dr. Mingw JIT:
> 
> I'm not sure this is the same crash but the crash I'm 
> reporting is easy reproducable and I think it is not the 
> expected behaviour :) Here is more info on it..
> 
> The crash is caused by this code from IniParseFindVisitor.cc, line 62:
> 
>   /* Copy leading part of path to temporary buffer and unescape it */
> 
>   String prefix (&basePath.cstr_oneuse()[baseLength + 1]);
>   String mirror = rfc1738_unescape_part 
> (prefix.substr(0,prefix.size() - 1));
> 
>   baseLenght - the length of the fullpath to the local package dir
>   basePath - the full path of a directory we are currently scanning
>              with FindFirstFile and friends.
> 
> When scannin the local package directory itself prefix would 
> be with zero length. Now prefix.size() will result in 0 thus this call
> prefix.substr(0,prefix.size() - 1) will look like this 
> prefix.substr(0, -1) i.e. give me the whole string. Ok 
> fine... Now take a look at String::substr:
> 
> String
> String::substr(size_t start, size_t len) const
> {
>   // Adapt the C++ string class
>   return string(cstr_oneuse()).substr(start, len);
> }
> 
> Ok cstr_oneuse() would return 0. This is where the crash 
> happens because the string class does strlen() when this 
> constructor is used i.e. const char *. I suggest to change this to:
> 
> string tmpStr;
> tmpStr.assign (cstr_oneuse(), theData->length); // this 
> construct is safe return tmpStr.substr (start, len);
> 
> You can also check theData->length and return empty string :)
> 
> Here is a backtrace from the crash:
> 
> #0  0x0043a1a5 in String::substr (this=0x152fa94, start=0, 
> len=4294967295)
>     at /usr/include/g++-3/std/straits.h:125
> 125         { return strlen (s); }
> (gdb) bt
> #0  0x0043a1a5 in String::substr (this=0x152fa94, start=0, 
> len=4294967295)
>     at /usr/include/g++-3/std/straits.h:125
> #1  0x0041897c in IniParseFindVisitor::visitFile (this=0x152fe14,
>     basePath=@0x152fc14, theFile=0x152fc44) at 
> IniParseFindVisitor.cc:65 #2  0x0040e89f in Find::accept 
> (this=0x152fe34, aVisitor=@0x152fe14)
>     at find.cc:71
> #3  0x00410f03 in do_local_ini (owner=0x1f0272) at ini.cc:76
> #4  0x00411a3b in do_ini_thread (h=0x400000, owner=0x1f0272) 
> at ini.cc:155 #5  0x00411f58 in do_ini_thread_reflector 
> (p=0x4723a8) at ini.cc:222 #6  0x77e602ed in _libwsock32_a_iname ()
> (gdb)
> 
> 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread
* RE: setup-2.243 Crash / Install from Local Directory / WinXP
@ 2002-05-22  7:32 Robert Collins
  2002-05-22  7:42 ` Re[2]: " Pavel Tsekov
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Collins @ 2002-05-22  7:32 UTC (permalink / raw)
  To: Max Bowsher, cygwin

C'mon Max, you *know* I need more detail than that.

Install from Local works fine here. Even though it's only a snapshot, I
wasn't aware of any -bugs- in the release.

Rob

> -----Original Message-----
> From: Max Bowsher [mailto:maxb@ukf.net] 
> Sent: Wednesday, May 22, 2002 10:17 PM
> To: cygwin@cygwin.com
> Subject: setup-2.243 Crash / Install from Local Directory / WinXP
> 
> 
> setup-2.243 crashes just after clicking next on the select 
> local package directory stage, when in Install from Local 
> Directory mode.
> 
> I know its only a snapshot, but this is just so you are aware 
> of the bug.
> 
> setup-2.218.2.9 works fine.
> 
> Max.
> 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-05-22 16:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-22 10:10 Re[3]: setup-2.243 Crash / Install from Local Directory / WinXP Robert Collins
2002-05-22 13:24 ` Re[5]: " Pavel Tsekov
  -- strict thread matches above, loose matches on Subject: below --
2002-05-22  7:32 Robert Collins
2002-05-22  7:42 ` Re[2]: " Pavel Tsekov
2002-05-22  8:21   ` Re[3]: " Pavel Tsekov
2002-05-22  9:53   ` Pavel Tsekov
2002-05-22  9:59     ` Pavel Tsekov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).