This is the mail archive of the cygwin@sourceware.cygnus.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]

Cygwin1.dll 05/24 snapshot (#2) problem with chdir(".")


I've run into a strange problem with chdir(".") failing under some specific
situations with the 05/24 snapshot of cygwin1.dll (the second variation, as
posted here previously to check out for textmode mount fixes), when compared
to the 1.1.0 (and 1.1.1) versions of the DLL.

I've tried to narrow down what is going on and gather some traces, but as
I'm beginning to get bogged down within the path handling code in path.cc, I
was hoping that perhaps the information I do have might let someone more
familiar with that code identify the issue more rapidly.

My problem originated when I found that the rsync utility was unable to
issue a chdir(".") call (errno 2, ENOENT) if I happened to be running it
from the root of a drive.  Further investigation led to discovering it only
happened when I had that drive mounted in a specific way.  For example, if
rsync starts in C:\ using the following mount table:

   (ctwd0143-db3l) /c> mount
   Device              Directory           Type         Flags
   d:                  /                   system       textmode
   c:                  /c                  system       textmode

it will fail, but if I unmount c:, then it works fine.  Being in some other
directory than C:\ will also work fine.  And finally, even if I choose a
slightly different mount for c: (say, "/dev/c") it also works.

A small utility I wrote just to issue a chdir() call always seems to
succeed, but what appears to be corruption in some strace output with the
newer DLL may indicate that it's just luck that is the case with a simple
test routine, I'm not sure.  rsync itself is doing very few system calls
prior to the initial chdir() that fails, but it is certainly doing some more
stuff than my test code.

I've included excerpts from an strace of each of the rsync runs.  Notice
that in the early portion of the excerpt there appears to be an uninitalized
pointer or a garbage buffer being given to mount_info::conv_to_posix_path
instead of "." (which should be "." from the first entry in my path).  It's
can't quite be the actual problem, since that same corruption is in my test
case that works, but it may or may not be a useful hint.  (Removing "." from
my path doesn't change the overall bug).  But clearly in the bad case,
mount_info::conv_to_win32_path is doing something wrong, since it returns
garbage.

I have the full traces and source to rsync/test utility available if it
would help.

Thanks.

-- David

/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l@fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/

===== Trace from rsync that works using the 1.1.0 DLL =====
(it also appears to run fine with the 1.1.1 DLL)

**********************************************
Program name: c:\rsync.exe
App version:  1001.1, api: 0.20
DLL version:  1001.0, api: 0.17
DLL build:    2000-03-01 00:15:19
OS version:   Windows NT-4.0
Date/Time:    2000-05-29 17:42:12
**********************************************

  460   19382 [main] rsync 1010 getwinenv: can't set native for PATH= since
no environ yet
  362   19744 [main] rsync 1010 mount_info::conv_to_posix_path:
conv_to_posix_path (., keep-rel)
  187   19931 [main] rsync 1010 mount_info::conv_to_posix_path: . =
conv_to_posix_path (.)

(...)

  238  507461 [main] rsync 1010 mount_info::conv_to_win32_path:
conv_to_win32_path (.)
  203  507664 [main] rsync 1010 getcwd_inner: 0x247F484 (/c) = getcwd_inner
(0x247F484, 260, posix) (cached)
  206  507870 [main] rsync 1010 normalize_posix_path: /c/. =
normalize_posix_path (.)
  211  508081 [main] rsync 1010 mount_info::conv_to_win32_path: .(rel),
c:\.(abs) 0x8(flags) = conv_to_win32_path (.)
  357  508438 [main] rsync 1010 symlink_check_one: 0 = symlink_check_one
(c:\., 0x247FA49, 260) (0x8)
 1190  509628 [main] rsync 1010 chdir: 0 = chdir (.) (dos .)


===== Trace from rsync using the 05/24 DLL =====

("Good" in this case is with current directory <> C:\)
("Bad" in this case is with current directory = C:\)

**********************************************
Program name: c:\rsync.exe
App version:  1001.1, api: 0.20
DLL version:  1001.2, api: 0.21
DLL build:    2000-05-24 23:55SNP
OS version:   Windows NT-4.0
Date/Time:    2000-05-29 17:31:59
**********************************************

Good:

  394   19886 [main] rsync 1097 getwinenv: can't set native for PATH= since
no environ yet
  364   20250 [main] rsync 1097 mount_info::conv_to_posix_path:
conv_to_posix_path (., keep-rel, no-add-slash)
  189   20439 [main] rsync 1097 mount_info::conv_to_posix_path: . =
conv_to_posix_path (.)

(...)

  202  525846 [main] rsync 1097 mount_info::conv_to_win32_path:
conv_to_win32_path (.)
  191  526037 [main] rsync 1097 getcwd_inner: 0x247F344 (/cygdrive/c) =
getcwd_inner (0x247F344, 260, posix) (cached)
  609  526646 [main] rsync 1097 normalize_posix_path: /cygdrive/c =
normalize_posix_path (.)
  201  526847 [main] rsync 1097 mount_info::cygdrive_win32_path: src
'/cygdrive/c', dst 'c:\'
  194  527041 [main] rsync 1097 mount_info::conv_to_win32_path: .(rel),
c:\(abs) 0x20(flags) = conv_to_win32_path (.)
  357  527398 [main] rsync 1097 symlink_info::check: not a symlink
  195  527593 [main] rsync 1097 symlink_info::check: 0 = symlink.check (c:\,
0x247F809) (0x20)
  534  528127 [main] rsync 1097 path_conv::check: GetVolumeInformation(c:\)
= OK, full_path(c:\), set_has_acls(8)
 1005  529132 [main] rsync 1097 chdir: 0 = chdir (.) (dos .)



Bad:

  392   20896 [main] rsync 1114 getwinenv: can't set native for PATH= since
no environ yet
  364   21260 [main] rsync 1114 mount_info::conv_to_posix_path:
conv_to_posix_path (dH, keep-rel, no-add-slash)
  190   21450 [main] rsync 1114 mount_info::conv_to_posix_path: dH =
conv_to_posix_path (dH)

(...)

  205  512013 [main] rsync 1114 mount_info::conv_to_win32_path:
conv_to_win32_path (.)
  194  512207 [main] rsync 1114 getcwd_inner: 0x247F344 (/c) = getcwd_inner
(0x247F344, 260, posix) (cached)
  199  512406 [main] rsync 1114 normalize_posix_path: /c =
normalize_posix_path (.)
  199  512605 [main] rsync 1114 mount_info::conv_to_win32_path: (rel),
c:(abs) 0x8(flags) = conv_to_win32_path (.)
  383  512988 [main] rsync 1114 symlink_info::check: not a symlink
  200  513188 [main] rsync 1114 symlink_info::check: 0 = symlink.check (c:\,
0x247F809) (0x8)
  563  513751 [main] rsync 1114 path_conv::check: GetVolumeInformation(c:\)
= OK, full_path(c:\), set_has_acls(8)
  609  514360 [main] rsync 1114 ../../../../csrc/winsup/cygwin/path.cc:2510
seterrno: 123 (INVALID_NAME) -> 2
  755  515115 [main] rsync 1114 chdir: -1 = chdir (.) (dos )


===== Trace from test code using the 05/24 DLL =====

**********************************************
Program name: c:\chdir.exe
App version:  1001.1, api: 0.20
DLL version:  1001.2, api: 0.21
DLL build:    2000-05-24 23:55SNP
OS version:   Windows NT-4.0
Date/Time:    2000-05-29 17:44:20
**********************************************

  394   19562 [main] chdir 1009 getwinenv: can't set native for PATH= since
no environ yet
  362   19924 [main] chdir 1009 mount_info::conv_to_posix_path:
conv_to_posix_path (dH, keep-rel, no-add-slash)
  189   20113 [main] chdir 1009 mount_info::conv_to_posix_path: dH =
conv_to_posix_path (dH)

(...)

  221  317400 [main] chdir 1009 mount_info::conv_to_win32_path:
conv_to_win32_path (.)
  195  317595 [main] chdir 1009 getcwd_inner: 0x245F3A4 (/c) = getcwd_inner
(0x245F3A4, 260, posix) (cached)
  197  317792 [main] chdir 1009 normalize_posix_path: /c =
normalize_posix_path (.)
  197  317989 [main] chdir 1009 mount_info::conv_to_win32_path: .(rel),
c:(abs) 0x8(flags) = conv_to_win32_path (.)
  349  318338 [main] chdir 1009 symlink_info::check: not a symlink
  196  318534 [main] chdir 1009 symlink_info::check: 0 = symlink.check (c:\,
0x245F869) (0x8)
  542  319076 [main] chdir 1009 path_conv::check: GetVolumeInformation(c:\)
= OK, full_path(c:\), set_has_acls(8)
  848  319924 [main] chdir 1009 chdir: 0 = chdir (.) (dos .)

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


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