MantisBT - VCMI |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0000719 | VCMI | Other | public | 2011-03-31 13:25 | 2014-05-30 17:40 |
|
Reporter | plush | |
Assigned To | Tow | |
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | AMD64 | OS | FreeBSD | OS Version | 8.2 |
Product Version | 0.84 | |
Target Version | | Fixed in Version | 0.85 | |
|
Summary | 0000719: [PATCH] Make VCMI work under FreeBSD |
Description | VMCI 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 Reproduce | Compile, install and attempt to run under FreeBSD. |
Additional Information | A 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. |
Tags | No tags attached. |
Relationships | |
Attached Files | patch_freebsd (1,550) 2011-03-31 13:25 https://bugs.vcmi.eu/file_download.php?file_id=703&type=bug |
|
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 |