MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000719VCMIOtherpublic2011-03-31 13:252014-05-30 17:40
Reporterplush 
Assigned ToTow 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformAMD64OSFreeBSDOS Version8.2
Product Version0.84 
Target VersionFixed in Version0.85 
Summary0000719: [PATCH] Make VCMI work under FreeBSD
DescriptionVMCI compiles and installs under FreeBSD 8.2 but crashes upon start-up with a floating point exception. The problem lies in timeHandler.h, line 21:

return ret/(CLOCKS_PER_SEC/1000);

This code assumes that CLOCKS_PER_SEC > 1000. Under Linux, clocks() has microsecond resolution so that CLOCKS_PER_SEC = 1000000 and the code works as desired. Under FreeBSD, CLOCKS_PER_SEC = 128, leading to a division by zero.
Steps To ReproduceCompile, install and attempt to run under FreeBSD.
Additional InformationA clock with microsecond resolution is available under FreeBSD via the getrusage() system call. The attached patch introduces a private method clock() that returns a timestamp with microsecond resolution, mimicking the Linux function. The getDif() method is adjusted to divide by the correct number.

Additionally, the fields start, last, mem are made private so that no other class can access them and misinterpret the resolution of these timestamps.
TagsNo tags attached.
Attached Files? file icon patch_freebsd [^] (1,550 bytes) 2011-03-31 13:25 [Show Content]

- Relationships

-  Notes
(0001673)
Tow (developer)
2011-04-02 23:49

Hi, thanks for the detailed report and the patch! :)
I've committed a fix based on it (without whole class duplication, when the difference is in one method) in r2058.
Please check, if it solves your problem.
(0001674)
plush (reporter)
2011-04-02 23:51

Thanks, that's a nice clean-up of my patch.

- Issue History
Date Modified Username Field Change
2011-03-31 13:25 plush New Issue
2011-03-31 13:25 plush File Added: patch_freebsd
2011-04-02 23:49 Tow Note Added: 0001673
2011-04-02 23:49 Tow Status new => resolved
2011-04-02 23:49 Tow Fixed in Version => 0.89
2011-04-02 23:49 Tow Resolution open => fixed
2011-04-02 23:49 Tow Assigned To => Tow
2011-04-02 23:51 plush Note Added: 0001674
2014-05-30 17:40 beegee Status resolved => closed

Site | Forums | Wiki | Slack | GitHub


Copyright © 2000 - 2024 MantisBT Team
Hosting provided by DigitalOcean