#4247: getCPUTime on x86_64 Mac OS X 10.6
-------------------------------+--------------------------------------------
Reporter: quark | Owner: igloo
Type: bug | Status: new
Priority: normal | Milestone: 7.0.2
Component: libraries/base | Version: 6.10.4
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: MacOS X | Blocking:
Architecture: x86_64 (amd64) | Failure: Incorrect result at runtime
-------------------------------+--------------------------------------------
Comment(by Atze):
The problem can be traced to OSX 64 bits using two different sized types
for the rusage.ru_utime.tv_sec and rusage.ru_utime.tv_usec fields, the
first a time_t, the second a useconds_t. On most platforms these are
equally sized, and equal to time_t. However, when different (in this case
64 bits and 32 bits resp.) the code in CPUTime.hs incorrectly assumes that
both fields are of type CTime. The solution is probably to introduce a new
type for useconds_t, like CUSeconds, check for its size at configuration
time, and adapt CPUTime.hs to take this into account.
I ran into this problem with UHC as well.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4247#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs