Re: VC++ 2005 beta1 fails with pthreads benchmark tests

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



BTW, here is the output:

Microsoft (R) Program Maintenance Utility Version 8.00.40607.16
Copyright (C) Microsoft Corporation. All rights reserved.

NMAKE : warning U4004: too many rules for target 'sizes.pass'
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: (errnoSav == EAGAIN), file semaphore1.c, line 91
NMAKE : fatal error U1077: '.\semaphore1.exe' : return code '0x1'
Stop.
NMAKE : fatal error U1077: 'nmake' : return code '0x2'
Stop.


"um" wrote
> "David Schwartz" wrote
> > "um" wrote
> > > "David Schwartz" wrote
> > >> "um" wrote
> > >>
> > >> > It is the last assert which fails in the first of the failing test
> > >> > programs.
> > >>
> > >> Why should 'perror' be expected to cause an 'EGAIN' error? You need
> > >> to
> > >> test 'errno' before calling any library functions that might change its
> > >> value. This code is broken.
> > >
> > > The code is not broken.
> >
> > It is.
> >
> > > In your quote you have left out the
> > > relevant part of the code.
> > > It is not perror which sets errno (funny imagination, btw).
> >
> > How do you know that?
>
> Experience, and simple testing. Here is the proof. Take a look to the
> lines with comments marked with "// UM"
>
> void *
> thr(void * arg)
> {
> sem_t s;
> int result;
> int errnoSav; // UM
>
> assert(sem_init(&s, PTHREAD_PROCESS_PRIVATE, 0) == 0);
>
> assert((result = sem_trywait(&s)) == -1);
> errnoSav = errno; // UM
> if ( result == -1 )
> {
> perror("thread: sem_trywait 1: expected error"); // No error
> assert(errnoSav == EAGAIN); // UM: was "errno"; Error happens here
(still)
> }
> else
> {
> printf("thread: ok 1\n");
> }
>
> ...
>
> > > errno is set by sem_trywait(). The code is:
> >
> > yes, it's set by 'sem_trywait', but then the code calls 'perror' before
> > checking it!
> >
> > > assert((result = sem_trywait(&s)) == -1);
> > > if ( result == -1 )
> > > {
> > > perror("thread: sem_trywait 1: expected error"); // No error
> > > assert(errno == EAGAIN);
> >
> > Again, why would you expect 'perror' to set errno to 'EAGAIN'? Do you
> > have some documentation that says 'perror' is guaranteed not to change
> > errno?
>
> No, it's not me, it's you who falsely thinks so. Therefore I've changed the
code
> to satisfy your view. But: the result is the same. The generated code of
> VC++2005 crashes at the same location with the same error. Need more?
> FYI: there are 122 test programs in total. 26 of them do fail with VC++2005
> (see original posting for the list of the failing tests). Funny thing: VC++6
> passes all tests flawlessly, so does the GNU compiler.
>
> I hope it helps the developers at MS to fix the product. If more
> info needed just let me know. BTW, I'm not involved in the
> pthreads development; I'm just testing both products for suitability
> and usability for some portable low-level hi-speed application projects
> for Windows and Linux. Some of the developers insist on using
> the latest product version, so I've first to check whether it makes sense,
> or rather creates problems...





.



Relevant Pages

  • Re: Xerox 7760 on DCPS?
    ... know or care about VMS are Sue and the remaining developers! ... Paul Anderson has historically alwatys provided good communicatiosn with ... BTW, Mr Anderson, if you read this: The NPMANAGE utility for the mac can ...
    (comp.os.vms)
  • Re: OT: Dont rock the globalwarming boat.....
    ... Many a Uni student of those days made their first liaisons with the ... They must have been late developers. ... BTW, Sweaty Betty was a resident of Macclesfield immortalised in an ...
    (uk.radio.amateur)
  • Re: Software product activation solution
    ... programmers do always trust source codes. ... That will bring trouble to developers who ... BTW, do you actually use the drive letters G: and J: for everyday work? ... if you expect people to believe that you can use artificial languages ...
    (comp.programming)
  • RE: Adding a Row With an AutoIncrement Field
    ... you're supplying when adding the new row. ... keyword. ... C# developers would use null. ... © 2005 Microsoft Corporation. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: RTC Remote Tools 2.0
    ... did I preorder then? ... Btw ... ... I have sent an E-Mail to all developers who have made a pre-order on ...
    (borland.public.delphi.thirdpartytools.general)