X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Message-ID: <4E56EB24.5000505@acm.org> Date: Thu, 25 Aug 2011 17:39:00 -0700 From: David Rothenberger User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20110812 Thunderbird/6.0 MIME-Version: 1.0 To: cygwin Subject: STC for libapr1 failure Content-Type: multipart/mixed; boundary="------------070305030504010506040401" X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com --------------070305030504010506040401 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit For a while now, the test cases that come with libapr1 have been bombing with this message: *** fatal error - NtCreateEvent(lock): 0xC0000035 I finally took some time to investigate and have extracted a STC that demonstrates the problem. It's been a decade since I did any C programming, so I'm not really sure that the STC is valid. However, it does work on my Debian box. (I know that doesn't really mean anything, but it's the best I can do.) I've tried this on my Win7-64 box running the 20110822 snapshot and on a WinXP VM running 1.7.9. I get the same results in both places. Regards, David -- David Rothenberger ---- daveroth AT acm DOT org The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet. -- Michael Jackson --------------070305030504010506040401 Content-Type: text/plain; name="stc-flock-fork.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="stc-flock-fork.c" /*********************************************************************** * This is a STC that causes the following error on my test machine: * NtCreateEvent(lock): 0xC0000035 * * It tries to use flock() for file locking. It creates a temporary * file, the uses fork to spawn a number of children. Each child opens * the file, then repeatedly uses flock to lock and unlock it. * * This test was extracted from the APR test suite. * * Compile: gcc -Wall -o stc-flock-fork stc-flock-fork.c ***********************************************************************/ #include #include #include #include #include #include #include #include #define MAX_ITER 2000 #define CHILDREN 6 /* A temporary file used for flock. */ char tmpfilename[] = "/tmp/flocktstXXXXXX"; /* Fork and use flock to lock and unlock the file repeatedly in the child. */ void make_child(int trylock, pid_t *pid) { if ((*pid = fork()) < 0) { perror("fork failed"); exit(1); } else if (*pid == 0) { int fd2 = open(tmpfilename, O_RDONLY); if (fd2 < 0) { perror("child open"); exit(1); } int rc; int i; for (i=0; i