View Issue Details

IDProjectCategoryView StatusLast Update
0001167JEDI Code LibraryJclSysInfopublic2005-02-16 01:34
ReporteranonymousAssigned ToRobert Rossmair 
PrioritynormalSeveritycrashReproducibilitysometimes
Status closedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001167: EZeroDivide is raised in GetCPUSpeed
Descriptionconsole app, using jvFileUtils, fails to init 1 time of 5.
The problem is EZeroDevide exception.
Additional InformationException is raised in
GetCPUSpeed() from JclSysInfo.pas, called from GetCpuInfo(), called from SetupFunctions() called from initialization of JclGraphUtils, used by JclGraphics, used by jvFunctions used by jvFileUtils.
I was unable to produce the same error calling GetCPUSpeed directly from GUI App on the same machine, but console app crashes can be reproduced.
TagsNo tags attached.
Fixed in GIT commit
Fixed in SVN revision
IDE version

Relationships

duplicate of 0001023 closedobones JEDI VCL Nullpointer exception in jvcl200_d70 

Activities

gorepj

2003-12-19 23:38

reporter   ~0002756

I've installed the JCL 1.22 on a 3.2GHz Pentium 4 Laptop and find
that the GetCPUSpeed function in jclSysInfo frequently (not always) raises a
Divide By Zero exception. This happens when 'Ticks' evaluates to
zero and causes the exception on line 2303 when the division is
performed. Is this a speed or hyperthreading problem?

I think the severity class should be higher than normal. This could become a huge problem as Users start using faster PCs.

I've temporarily overcome the problem by forcing 'Ticks' to 1 when it evaluates to zero.

Regards
Peter Gore

FlyingAvatar

2003-12-23 11:56

reporter   ~0002760

Last edited: 2003-12-23 13:03

Same problem here. P4 3ghz with HT. I was just looking into bug 0001023 when this one was posted.

This appears to be the root problem of bug 0001023.

Here's what happens to me:

  Ticks := T1.LowPart - T0.LowPart; // (1023660100 - 1023658960)
  //Ticks becomes 1140

  Ticks := Ticks * 100000;
  //Ticks becomes 114000000

  Ticks := Round(Ticks / (CountFreq.LowPart / 10));
  //CountFreq.Lowpart = 2992760000
  //Ticks becomes Round(0.38091928520830270385864553121533) = 0
  
  TotalTicks := TotalTicks + Ticks;
  TotalCycles := TotalCycles + Cycles;
  //*******Now, divide by 0:
  Freq := Round(Cycles / Ticks);
  Total := Freq + Freq2 + Freq3;


The old GetCPUInfo noted in bug 0001023 appears to work.

edited on: 12-23 13:03

Issue History

Date Modified Username Field Change
2005-02-16 01:34 Robert Rossmair Status resolved => closed