diff --git a/SystemInformation.cxx b/SystemInformation.cxx index 4a9414267e2237d24ec43b9539026d1bbd0c277c..daf7ba3f7b411e86851a1ce690f0f8dba04608a5 100644 --- a/SystemInformation.cxx +++ b/SystemInformation.cxx @@ -2199,7 +2199,12 @@ int SystemInformationImplementation::RetreiveInformationFromCpuInfoFile() this->NumberOfPhysicalCPU= this->NumberOfLogicalCPU = atoi(cpucount.c_str()); #endif - + // gotta have one, and if this is 0 then we get a / by 0n + // beter to have a bad answer than a crash + if(this->NumberOfPhysicalCPU <= 0) + { + this->NumberOfPhysicalCPU = 1; + } // LogicalProcessorsPerPhysical>1 => hyperthreading. this->Features.ExtendedFeatures.LogicalProcessorsPerPhysical= this->NumberOfLogicalCPU/this->NumberOfPhysicalCPU;