From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20377 invoked by alias); 21 Apr 2005 14:05:07 -0000 Mailing-List: contact pthreads-win32-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sources.redhat.com Received: (qmail 20209 invoked from network); 21 Apr 2005 14:04:44 -0000 Received: from unknown (HELO mailout02.sul.t-online.com) (194.25.134.17) by sourceware.org with SMTP; 21 Apr 2005 14:04:44 -0000 Received: from fwd30.aul.t-online.de by mailout02.sul.t-online.com with smtp id 1DOcIO-0002pK-00; Thu, 21 Apr 2005 16:04:44 +0200 Received: from C2 (ZwuhLuZcZe1-dIHv7hWMf2U29WCsLiii9GOC0jXCknSnOe91eoAKge@[217.236.47.70]) by fwd30.sul.t-online.de with smtp id 1DOcIK-0z6QnQ0; Thu, 21 Apr 2005 16:04:40 +0200 Message-ID: <00a601c5467b$a5ac6e70$fe00a8c0@C2> From: "Uenal Mutlu" To: Subject: Some tests fail in VC++2005 Date: Thu, 21 Apr 2005 14:05:00 -0000 Organization: HUP MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-ID: ZwuhLuZcZe1-dIHv7hWMf2U29WCsLiii9GOC0jXCknSnOe91eoAKge X-TOI-MSGID: 168c3fa1-b55a-4d31-96e4-2899d1163966 X-SW-Source: 2005/txt/msg00075.txt.bz2 I've tried the latest 2 pthreads releases with MS compilers. VC++6 passes all tests, but VC++2005 fails with about 26 of the test programs (tested only in beta 1, beta 2 is out since last monday or so but I don't have it yet). The first one of the failing test programs is semaphore1.c, line 89: nmake clean VC ... ... Running VC test: mutex1r.exe ...... Passed cl /D__CLEANUP_C /O2 /Ob0 /W3 /WX /MD /nologo /Yd /Zi -I. semaphore1.c /Fesemaphore1.exe /link /INCREMENTAL:NO pthreadVC2.lib ws2_32.lib cl : Command line warning D9035 : option 'Yd' has been deprecated and will be removed in a future release semaphore1.c ... Running VC test: semaphore1.exe thread: sem_trywait 1: expected error: No error Assertion failed: (errno == EAGAIN), file semaphore1.c, line 89 NMAKE : fatal error U1077: '.\semaphore1.exe' : return code '0x1' Stop. NMAKE : fatal error U1077: 'nmake' : return code '0x2' Stop. Below is the function from semaphore1.c where the error occurs. It is the line assert(errno == EAGAIN); I wonder where errno gets set to this value. Is it done in sem_trywait() or maybe in perror()? And frankly I don't understand how the below code works at all because that branch is entered only if result is -1. The funny thing here (for me) is that then the program should stop in the previous assert(), but this isn't happening! Then I wonder how and why the if condition becomes true... void * thr(void * arg) { sem_t s; int result; assert(sem_init(&s, PTHREAD_PROCESS_PRIVATE, 0) == 0); assert((result = sem_trywait(&s)) == -1); if ( result == -1 ) { perror("thread: sem_trywait 1: expected error"); // No error assert(errno == EAGAIN); } ... I have posted this issue also in news://news.microsoft.com/microsoft.public.dotnet.languages.vc under the subject "VC++ 2005 beta1 fails with pthreads benchmark tests" but the MS guys say the code is broken. Maybe someone could clarify this.