From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9163 invoked by alias); 19 Jul 2013 01:56:41 -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 9138 invoked by uid 89); 19 Jul 2013 01:56:40 -0000 X-Spam-SWARE-Status: No, score=1.4 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,FSL_HELO_BARE_IP_2,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,RCVD_NUMERIC_HELO,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO plane.gmane.org) (80.91.229.3) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 19 Jul 2013 01:56:39 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Uzzvp-00019z-Nj for cygwin@cygwin.com; Fri, 19 Jul 2013 03:56:29 +0200 Received: from 119.201.52.138 ([119.201.52.138]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 19 Jul 2013 03:56:29 +0200 Received: from jojelino by 119.201.52.138 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 19 Jul 2013 03:56:29 +0200 To: cygwin@cygwin.com From: jojelino Subject: Re: sqlite defect Date: Fri, 19 Jul 2013 07:55:00 -0000 Message-ID: References: <51E703FB.1010300@etr-usa.com> <51E74AB4.7010508@etr-usa.com> <20130718085953.GC9628@calimero.vinschen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows NT 5.2; rv:25.0) Gecko/20100101 Thunderbird/25.0a1 In-Reply-To: <20130718085953.GC9628@calimero.vinschen.de> X-SW-Source: 2013-07/txt/msg00384.txt.bz2 On 2013-07-18 PM 5:59, Corinna Vinschen wrote:> On Jul 18 17:11, jojelino wrote: >> On 2013-07-18 AM 10:53, Warren Young wrote: >>> Nothing so simple. Locking is handled at the OS and/or Cygwin DLL >>> level. The build change between 3.7.16.2 and 3.7.17-3 is that we're now >>> relying on new features in the Cygwin DLL to do Windows-style locking by >>> default. >>> >>> Older versions of Cygwin SQLite bypassed the Cygwin DLL entirely for >>> this, going straight to the Win32 API, thereby preventing the DLL from >>> interposing itself for the "posix" case. >>> >> Mandatory locking feature of cygwin used in sqlite is broken. > > Simple testcase in plain C? > > > Corinna > #include #include #include #include #include int main() { int fd = open("asdf.txt", O_BINARY | O_RDWR | O_NOINHERIT | O_CREAT); const char* buf = "KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK\0"; int i=0; write(fd, buf, strlen(buf)); fcntl(fd,F_LCK_MANDATORY,0); assert(flock(fd,F_SETOWN)==0); assert(flock(fd,F_SETOWN)==0); assert(flock(fd,LOCK_NB|LOCK_UN)==0); fcntl(fd,F_LCK_MANDATORY,1); assert(flock(fd,F_SETOWN)==0); assert(flock(fd,LOCK_NB|LOCK_UN)==0); assert(flock(fd,F_SETOWN)==0); assert(flock(fd,F_SETOWN)==0); /* assertion "flock(fd,F_SETOWN)==0" failed: file "f_lck.c", line 28, function: main */ return 0; } /**/ -- Regards. -- 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