From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36834 invoked by alias); 20 Apr 2018 13:11:32 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 36753 invoked by uid 89); 20 Apr 2018 13:11:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=H*R:D*ca, HContent-Transfer-Encoding:8bit X-HELO: smtp-out-so.shaw.ca Received: from smtp-out-so.shaw.ca (HELO smtp-out-so.shaw.ca) (64.59.136.137) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 20 Apr 2018 13:11:29 +0000 Received: from [192.168.1.100] ([24.64.240.204]) by shaw.ca with ESMTP id 9Vp1faPJPYxCT9Vp2fbKiV; Fri, 20 Apr 2018 07:11:28 -0600 X-Authority-Analysis: v=2.3 cv=cav8UELM c=1 sm=1 tr=0 a=MVEHjbUiAHxQW0jfcDq5EA==:117 a=MVEHjbUiAHxQW0jfcDq5EA==:17 a=IkcTkHD0fZMA:10 a=2MZV_eq1Q6pihxzkXFQA:9 a=QEXdDO2ut3YA:10 Reply-To: Brian.Inglis@SystematicSw.ab.ca Subject: Re: Fails to launch batch script in some directories To: cygwin@cygwin.com References: <76873039-f459-5534-ce8a-bb8fcbd35274@gmail.com> From: Brian Inglis Message-ID: <6d4b0108-d3cc-7dab-af95-3856faf3ebaf@SystematicSw.ab.ca> Date: Fri, 20 Apr 2018 13:11:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <76873039-f459-5534-ce8a-bb8fcbd35274@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfPco3s9oxyNuk/0Wj3veVhfKJtjakSjaQ7vAWNtvFdvOWwkCVFfPJmlEWbSTnxuyrw0PI0QDmhLxvCJflsw645gGigX52AypTjRbtsjPkHk2kxBaXIJI spuSzSrhzLsQ6kJ6q8rs1XS0/ZXod/VYCCNUgQT8eqDIpuNF60dCE54z03lzJ3VRWdeMag69OHZpHA== X-IsSubscribed: yes X-SW-Source: 2018-04/txt/msg00252.txt.bz2 On 2018-04-20 06:33, David Macek wrote: > Whoa, an interesting bug.  I'm forwarding this to the Cygwin mailing list for > reference.  I might take a deeper look over the weekend if no-one beats me to it. > > It seems like running batch files (.bat, .cmd) inside a directory with an at > sign and a space (such as '@ x' or 'x @') fails. > > /w/temp/@ x$ ./hello.bat > 'W:\temp\@' is not recognized as an internal or external command, > operable program or batch file. >From strace on cmd run from directory created with same name, looks like child_info_spawn::worker may need to escape/double quote the name if it contains spaces: 65 119143 [main] bash 9384 spawnve: spawnve (./ntpstatus.cmd, ./ntpstatus.cmd, 0x60006F6B0) 34 119177 [main] bash 9384 child_info_spawn::worker: mode = 3, prog_arg = ./ntpstatus.cmd 36 119213 [main] bash 9384 perhaps_suffix: prog './ntpstatus.cmd' 30 119243 [main] bash 9384 normalize_posix_path: src ./ntpstatus.cmd 28 119271 [main] bash 9384 cwdstuff::get: posix /proc/cygdrive/c/.../@ x 29 119300 [main] bash 9384 cwdstuff::get: (/proc/cygdrive/c/.../@ x) = cwdstuff::get (0x600000010, 32768, 1, 0), errno 108 29 119329 [main] bash 9384 normalize_posix_path: /proc/cygdrive/c/.../@ x/ntpstatus.cmd = normalize_posix_path (./ntpstatus.cmd) 30 119359 [main] bash 9384 mount_info::conv_to_win32_path: conv_to_win32_path (/proc/cygdrive/c/.../@ x/ntpstatus.cmd) 33 119392 [main] bash 9384 mount_info::cygdrive_win32_path: src '/proc/cygdrive/c/.../@ x/ntpstatus.cmd', dst 'C:\...\@ x\ntpstatus.cmd' 33 119425 [main] bash 9384 set_flags: flags: binary (0x2) 28 119453 [main] bash 9384 mount_info::conv_to_win32_path: src_path /proc/cygdrive/c/.../@ x/ntpstatus.cmd, dst C:\...\@ x\ntpstatus.cmd, flags 0x4022, rc 0 153 119606 [main] bash 9384 symlink_info::check: 0x0 = NtCreateFile (\??\C:\...\@ x\ntpstatus.cmd) 85 119691 [main] bash 9384 symlink_info::check: not a symlink 79 119770 [main] bash 9384 symlink_info::check: 0 = symlink.check(C:\...\@ x\ntpstatus.cmd, 0xFFFFA850) (0x4022) 55 119825 [main] bash 9384 path_conv::check: this->path(C:\...\@ x\ntpstatus.cmd), has_acls(1) 35 119860 [main] bash 9384 perhaps_suffix: buf C:\...\@ x\ntpstatus.cmd, suffix found '' 90 119950 [main] bash 9384 child_info_spawn::worker: priority class 32 95 120045 [main] bash 9384 fhandler_console::need_invisible: invisible_console 0 39 120084 [main] bash 9384 build_env: envp 0x60006F6B0 38 120122 [main] bash 9384 spenv::retrieve: no_envblock 0 40 120162 [main] bash 9384 spenv::retrieve: duping existing value for 'USERDOMAIN=' 48 120210 [main] bash 9384 spenv::retrieve: no_envblock 0 39 120249 [main] bash 9384 spenv::retrieve: duping existing value for 'USERNAME=' 29 120278 [main] bash 9384 spenv::retrieve: no_envblock 0 28 120306 [main] bash 9384 spenv::retrieve: duping existing value for 'LOGONSERVER=' 35 120341 [main] bash 9384 spenv::retrieve: no_envblock 0 32 120373 [main] bash 9384 spenv::retrieve: no_envblock 0 27 120400 [main] bash 9384 spenv::retrieve: duping existing value for 'USERPROFILE=' 29 120429 [main] bash 9384 spenv::retrieve: no_envblock 0 27 120456 [main] bash 9384 spenv::retrieve: duping existing value for 'SYSTEMROOT=' 43 120499 [main] bash 9384 spenv::retrieve: no_envblock 0 31 120530 [main] bash 9384 spenv::retrieve: duping existing value for 'WINDIR=' 37 120567 [main] bash 9384 spenv::retrieve: no_envblock 0 30 120597 [main] bash 9384 spenv::retrieve: no_envblock 0 27 120624 [main] bash 9384 spenv::retrieve: duping existing value for 'HOMEDRIVE=' 33 120657 [main] bash 9384 spenv::retrieve: no_envblock 0 28 120685 [main] bash 9384 spenv::retrieve: duping existing value for 'HOMEPATH=' 34 120719 [main] bash 9384 build_env: env count 108, bytes 9407 324 121043 [main] bash 9384 build_env: envp 0x180306DA8, envc 108 34 121077 [main] bash 9384 child_info::child_info: subproc_ready 0x0 20253 141330 [main] bash 9384 child_info_spawn::worker: pid 9384, prog_arg ./ntpstatus.cmd, cmd line "C:\...\@ x\ntpstatus.cmd") 102 141432 [main] bash 9384! child_info_spawn::worker: new process name \\?\C:\...\@ x\ntpstatus.cmd 56 141488 [main] bash 9384! fhandler_base::close_with_arch: line 1129: /dev/pty0<0x1803054F0> usecount + -1 = 3 31 141519 [main] bash 9384! fhandler_base::close_with_arch: not closing archetype 67 141586 [main] bash 9384! fhandler_base::close_with_arch: line 1129: /dev/pty0<0x1803054F0> usecount + -1 = 2 33 141619 [main] bash 9384! fhandler_base::close_with_arch: not closing archetype 34 141653 [main] bash 9384! fhandler_base::close_with_arch: line 1129: /dev/pty0<0x1803054F0> usecount + -1 = 1 35 141688 [main] bash 9384! fhandler_base::close_with_arch: not closing archetype 38 141726 [main] bash 9384! child_info_spawn::worker: spawned windows pid 9260 52 141778 [main] bash 9384! proc_subproc: args: 1, -2145357536 --- Process 9260 created --- Process 9384 thread 8320 created 306 142084 [main] bash 9384! pinfo::wait: created tracking thread for pid 9384, winpid 0x242C, rd_proc_pipe 0x284 48 142132 [main] bash 9384! proc_subproc: added pid 9384 to proc table, slot 0 45 142177 [main] bash 9384! proc_subproc: returning 1 --- Process 9260 loaded C:\Windows\System32\ntdll.dll at 00007ffb92730000 89 142266 [waitproc] bash 9384! cygthread::stub: thread 'waitproc', id 0x2080, stack_ptr 0x329CCD0 --- Process 9260 loaded C:\Windows\System32\kernel32.dll at 00007ffb918e0000 --- Process 9260 loaded C:\Windows\System32\KernelBase.dll at 00007ffb8f750000 --- Process 9260 loaded C:\Windows\System32\msvcrt.dll at 00007ffb91840000 --- Process 9260 thread 5056 created --- Process 2844 created --- Process 2844 loaded C:\Windows\System32\ntdll.dll at 00007ffb92730000 --- Process 2844 loaded C:\Windows\System32\kernel32.dll at 00007ffb918e0000 --- Process 2844 loaded C:\Windows\System32\KernelBase.dll at 00007ffb8f750000 --- Process 2844 loaded C:\Windows\System32\msvcrt.dll at 00007ffb91840000 --- Process 2844 thread 5964 created --- Process 2844 thread 32 created --- Process 2844 loaded C:\Windows\System32\ulib.dll at 00007ffb7dcd0000 --- Process 2844 thread 6228 created --- Process 2844 loaded C:\Windows\System32\fsutilext.dll at 00007ffb8a980000 --- Process 2844 thread 5964 exited with status 0x0 --- Process 2844 thread 6228 exited with status 0x0 --- Process 2844 thread 32 exited with status 0x0 --- Process 2844 exited with status 0x0 --- Process 9260 thread 5056 exited with status 0x1 --- Process 9260 exited with status 0x1 45516 187782 [waitproc] bash 9384! pinfo::maybe_set_exit_code_from_windows: pid 9384, exit value - old 0x0, windows 0x1, cygwin 0x8000100 110 187892 [waitproc] bash 9384! proc_waiter: exiting wait thread for pid 9384 47 187939 [main] bash 9384! proc_terminate: nprocs 1 81 188020 [main] bash 9384! proc_subproc: args: 5, 1 80 188100 [main] bash 9384! proc_subproc: clear waiting threads 47 188147 [main] bash 9384! proc_subproc: finished clearing 34 188181 [main] bash 9384! proc_subproc: returning 1 30 188211 [main] bash 9384! cygthread::terminate_thread: thread '(null)', id 0x2080, inuse 0, stack_ptr 0x329CCD0 31 188242 [main] bash 9384! proc_terminate: leaving 30 188272 [main] bash 9384! pinfo::maybe_set_exit_code_from_windows: pid 9384, exit value - old 0x8000100, windows 0xDEADBEEF, cygwin 0x8000100 55 188327 [main] bash 9384! pinfo::exit: Calling ExitProcess n 0x4000000, exitcode 0x1 -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple