www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/04/22/01:00:12

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: "Alex Vinokur" <alexvn AT bigfoot DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: uclock_t & gcc 3.0.4 on Windows-2000
Date: Mon, 22 Apr 2002 07:58:14 +0200
Organization: Scopus
Lines: 149
Message-ID: <aa056g$6n1jt$1@ID-79865.news.dfncis.de>
References: <a9uahn$6ao8i$1 AT ID-79865 DOT news DOT dfncis DOT de> <7458-Sun21Apr2002182355+0300-eliz AT is DOT elta DOT co DOT il>
NNTP-Posting-Host: gateway.scopus.net (62.90.123.5)
X-Trace: fu-berlin.de 1019451409 7046781 62.90.123.5 (16 [79865])
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il> wrote in message news:7458-Sun21Apr2002182355+0300-eliz AT is DOT elta DOT co DOT il...
| > From: "Alex Vinokur" <alexvn AT bigfoot DOT com>
| > Newsgroups: comp.os.msdos.djgpp
| > Date: Sun, 21 Apr 2002 15:17:15 +0200
| >
| > start_uclock_ = 35292
| > end_uclock_   = 35306
| > start_uclock_ = -29321
| > end_uclock_   = -29307
| > Assertion failed at xxx.h line 34: start_uclock_ >= 0
| > Exiting due to signal SIGABRT
| > Raised at eip=00007c8e
| > eax=000bf9ec ebx=00000120 ecx=00000000 edx=00000000 esi=00000054 edi=0003fb60
| > ebp=000bfa98 esp=000bf9e8 program=D:\_T02_P~1\a.exe
| > cs: sel=01f7  base=01e80000  limit=000cffff
| > ds: sel=01ff  base=01e80000  limit=000cffff
| > es: sel=01ff  base=01e80000  limit=000cffff
| > fs: sel=01cf  base=00012150  limit=0000ffff
| > gs: sel=020f  base=00000000  limit=0010ffff
| > ss: sel=01ff  base=01e80000  limit=000cffff
| > App stack: [000bfb60..0003fb60]  Exceptn stack: [0003fabc..0003db7c]
| >
| > Call frame traceback EIPs:
| >   0x00007bb4
| >   0x00007c8e
| >   0x000057f9
| >   0x00017cc6
| >   0x0000161b
| >   0x00005278
| > #########################
| >
| > We can see that behavior of uclock_t is not long-long-behavior.
| >
| > Any explanation?
|
| I can suggest two possible explanations:
|
|   - the C++ library has a bug when printing long long variables via
|     cout (did you try an equivalent C program?);


An equivalent C program usually generates  the same result (sometimes it works OK).


###### C code : Source file : BEGIN ######
/* File yyy2.c */

#include <stdio.h>
#include <assert.h>
#include <time.h>

int main()
{
#define TOTAL_TIMES 1000

int  i;

uclock_t start_uclock;
uclock_t end_uclock;

  for (i = 0; i < TOTAL_TIMES; i++)
  {
    start_uclock = uclock();
    printf ("[%d] start_uclock = %ld\n", i, start_uclock);
    fflush (NULL);
    assert (start_uclock >= 0);

    end_uclock = uclock();
    printf ("[%d] end_uclock = %ld\n", i, end_uclock);
    fflush (NULL);
    assert (end_uclock >= 0);

    assert (start_uclock < end_uclock);
  }

  return 0;

}
###### C code : Source file : END ########


###### Compilation : BEGIN ######

%gcc yyy2.c

###### Compilation : END ########


######## Running : BEGIN ########

%a.exe

[0] start_uclock = 0
[0] end_uclock = 293
[1] start_uclock = 398
[1] end_uclock = 479
[2] start_uclock = 553
[2] end_uclock = 627

[omitted]

[477] start_uclock = 38988
[477] end_uclock = 39027
[478] start_uclock = 39065
[478] end_uclock = 39104
[479] start_uclock = 39142
[479] end_uclock = 39181
[480] start_uclock = -26316
Assertion failed at yyy2.c line 19: start_uclock >= 0
Exiting due to signal SIGABRT
Raised at eip=0000467e
eax=0074febc ebx=00000120 ecx=00000000 edx=00000000 esi=00000054 edi=0000fb60
ebp=0074ff68 esp=0074feb8 program=D:\_T02_P~1\a.exe
cs: sel=01f7  base=017f0000  limit=0075ffff
ds: sel=01ff  base=017f0000  limit=0075ffff
es: sel=01ff  base=017f0000  limit=0075ffff
fs: sel=01cf  base=00012150  limit=0000ffff
gs: sel=020f  base=00000000  limit=0010ffff
ss: sel=01ff  base=017f0000  limit=0075ffff
App stack: [00750000..006d0000]  Exceptn stack: [0000fac0..0000db80]

Call frame traceback EIPs:
  0x000045a4
  0x0000467e
  0x000036f9
  0x000016c8
  0x00003038

######## Running : END ##########



|
|   - uclock tries to reprogram the system timer chip, but Windows 2000,
|     being of the NT family, doesn't let you do so.


--
====================
  Alex Vinokur
    http://up.to/alexvn
    http://go.to/alexv_math
    mailto:alexvn AT bigfoot DOT com
    mailto:alexvn AT go DOT to
  ====================



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019