delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/06/03/18:00:34

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Tue, 3 Jun 2003 18:00:28 -0400
From: Christopher Faylor <cgf AT redhat DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: SEGV in conv_path_list_buf_size with xemacs-21.5-b13 and cygwin-1.3.22-1
Message-ID: <20030603220028.GA3704@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <16092 DOT 62778 DOT 903944 DOT 717787 AT gargle DOT gargle DOT HOWL>
Mime-Version: 1.0
In-Reply-To: <16092.62778.903944.717787@gargle.gargle.HOWL>
User-Agent: Mutt/1.4.1i

On Tue, Jun 03, 2003 at 02:21:30PM -0500, Pete McCann wrote:
>I don't understand why "path" is filled with junk.  Also, note that
>normalized_path is NULL, which I think is the culprit with respect to
>strlen.  Perhaps it is this code:
>
>
>  /* 100: slop */en = (to_posix
>  size = strlen (path_list)unt_table->mount[i].posix_pathlen
>    + (num_elms * max_mount_path_len)>mount[i].native_pathlen);
>    + (nrel * strlen (to_posix ? pc.get_win32 () : pc.normalized_path))
>    + 100;
>  return size;
>
>which is causing the problem.  If I understand correctly, this
>should be accessing pc.normalized_path (to_posix = false).

Very nice analysis.  Much appreciated.

I don't have much time to look into this right now, but it sure seems like
a test in conv_path_list_buf_size is reversed.  If so, it's incredible that
this ever worked.  Does the following fix the problem?

cgf

Index: path.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/path.cc,v
retrieving revision 1.254
diff -u -p -r1.254 path.cc
--- path.cc	30 May 2003 23:43:24 -0000	1.254
+++ path.cc	3 Jun 2003 21:59:02 -0000
@@ -3551,7 +3551,7 @@ conv_path_list_buf_size (const char *pat
   /* 100: slop */
   size = strlen (path_list)
     + (num_elms * max_mount_path_len)
-    + (nrel * strlen (to_posix ? pc.get_win32 () : pc.normalized_path))
+    + (nrel * strlen (to_posix ? pc.normalized_path : pc.get_win32 ()))
     + 100;
   return size;
 }

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019