From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19155 invoked by alias); 3 Jan 2017 11:17:50 -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 19135 invoked by uid 89); 3 Jan 2017 11:17:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.8 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=singhal, Singhal, pinfo, cygdrive X-HELO: m0.truegem.net Received: from m0.truegem.net (HELO m0.truegem.net) (69.55.228.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Jan 2017 11:17:48 +0000 Received: from localhost (mark@localhost) by m0.truegem.net (8.12.11/8.12.11) with ESMTP id v03BHlLo051572 for ; Tue, 3 Jan 2017 03:17:47 -0800 (PST) (envelope-from mark@maxrnd.com) Date: Tue, 03 Jan 2017 11:17:00 -0000 From: Mark Geisert To: cygwin@cygwin.com Subject: Re: Cygwin 2.6.0 Fork issue Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-SW-Source: 2017-01/txt/msg00006.txt.bz2 (Apologies if multiple copies of this show up. Not getting feedback on what the issue is. This attempt just has my comments on the strace file, without the strace itself.) Rashi Singhal wrote: > Please help me on this. This is strace output of my sample program > which is failing to open files after fork in child process. > > I am using 2.26 (32 bit) version of cygwin with Pervasive 12 . Windows > Os is win-2012. > > My sample program name is btrsamp.exe. > > Please give me some clue on what could be issue here. I see several unusual things in the strace. They're noted below... > --- Process 6704 created > --- Process 6704 loaded C:\Windows\SysWOW64\ntdll.dll at 771A0000 > --- Process 6704 loaded C:\Windows\SysWOW64\KernelBase.dll at 74C00000 > --- Process 6704 loaded \\blrvswdbm01\bmpc226\misys\bin\cygwin1.dll at > 61000000 ... > --- Process 6704 loaded > C:\Windows\WinSxS\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6910_none_d089c358442de345\msvcr80.dll > at 6F2D0000 The main process loaded cygwin1.dll further above, but is here loading the MS C runtime, which is incompatible with cygwin1.dll. ... > --- Process 6704 loaded C:\Program Files > (x86)\Actian\PSQL\bin\w3mif190.dll at 67D00000 > --- Process 6704 loaded C:\Windows\SysWOW64\clusapi.dll at 6FEC0000 > --- Process 6704 loaded C:\Windows\SysWOW64\cryptdll.dll at 70090000 > --- Process 6704 loaded C:\Program Files > (x86)\Actian\PSQL\bin\clientrb.dll at 02530000 > --- Process 6704, exception 000006d9 at 74C10192 Main process caused an exception in KernelBase.dll > --- Process 6704 loaded C:\Windows\SysWOW64\NapiNSP.dll at 74260000 > --- Process 6704 loaded C:\Windows\SysWOW64\nlaapi.dll at 74250000 > --- Process 6704 loaded C:\Windows\SysWOW64\mswsock.dll at 74180000 > --- Process 6704 thread 5568 created > --- Process 6704 loaded C:\Windows\SysWOW64\dnsapi.dll at 74100000 > --- Process 6704 loaded C:\Windows\SysWOW64\winrnr.dll at 740E0000 > --- Process 6704, exception e06d7363 at 74C10192 Main process caused another exception in KernelBase.dll ... > --- Process 6704, exception e06d7363 at 74C10192 And another exception, either a new one or a second-chance reporting of the previous one. Haven't even gotten to the fork() yet... ... > 58 629941 [main] btrsamp 6704 fork: entering Main process has just entered fork(). ... > --- Process 5876 created ... > --- Process 5876 loaded C:\Program Files > (x86)\Actian\PSQL\bin\clientrb.dll at 02530000 > --- Process 5876, exception 000006d9 at 74C10192 Child process causes an exception in KernelBase.dll just like the parent did at first... > --- Process 5876 thread 4956 exited with status 0x6d9 > --- Process 5876 thread 1212 exited with status 0x6d9 > --- Process 5876 thread 3544 exited with status 0x6d9 > --- Process 5876 thread 5868 created > --- Process 5876 exited with status 0x6d9 But this was enough to kill the child process. Not sure if relevant but the first exception reported by both parent and child came just after loading clientrb.dll. Is this DLL Cygwin-specific or Windows-native? > 487729 1281052 [waitproc] btrsamp 6704 > pinfo::maybe_set_exit_code_from_windows: pid 5876, exit value - old > 0x0, windows 0x6D9, cygwin 0x800D900 > 131 1281183 [waitproc] btrsamp 6704 sig_send: sendsig 0xAC, pid ... > 44 15806380 [main] btrsamp 6704 normalize_posix_path: > /cygdrive/l/bmpcunix/etc/gmon.out = normalize_posix_path (gmon.out) > 51 15806431 [main] btrsamp 6704 mount_info::conv_to_win32_path: > conv_to_win32_path (/cygdrive/l/bmpcunix/etc/gmon.out) > 52 15806483 [main] btrsamp 6704 mount_info::cygdrive_win32_path: > src '/cygdrive/l/bmpcunix/etc/gmon.out', dst > 'L:\bmpcunix\etc\gmon.out' > 44 15806527 [main] btrsamp 6704 set_flags: flags: binary (0x2) > 42 15806569 [main] btrsamp 6704 mount_info::conv_to_win32_path: > src_path /cygdrive/l/bmpcunix/etc/gmon.out, dst > L:\bmpcunix\etc\gmon.out, flags 0x4022, rc 0 > 433 15807002 [main] btrsamp 6704 symlink_info::check: 0x0 = > NtCreateFile (\??\L:\bmpcunix\etc\gmon.out) Above are several lines mentioning gmon.out. If you're trying to profile, you should postpone that until after you get the program working. In addition to what Brian and Eliot have suggested, you might try moving the cygwin/bin directory from the end of your PATH to the start of your PATH. I'm also wondering if every DLL being associated with your program was built for Cygwin, or if you might be mistakenly pulling in one or more Windows-native DLLs. ..mark -- 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