Ticket #950 (closed bug: fixed)

Opened 5 years ago

Last modified 3 years ago

Timing stats in GHCi don't work

Reported by: simonpj Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.6
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by simonpj) (diff)

The GHCi set +s flag doesn't give sensible timings:

  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |      GHC Interactive, version 6.6, for Haskell 98.
/ /_\\/ __  / /___| |      http://www.haskell.org/ghc/
\____/\/ /_/\____/|_|      Type :? for help.

Loading package base ... linking ... done.
[1 of 3] Compiling Primes           ( Primes.hs, interpreted )
[2 of 3] Compiling ContFrac         ( ContFrac.hs, interpreted )
[3 of 3] Compiling Euler44          ( Euler44.hs, interpreted )
Ok, modules loaded: Euler44, ContFrac, Primes.
*Euler44> :set +s
*Euler44> smallest
(2167,1020,2395,1912)
(0.02 secs, 910618996 bytes)
*Euler44>

The run actually took 23 seconds.

Reported by daniel.is.fischer@…

Change History

Changed 5 years ago by simonpj

  • description modified (diff)

Changed 5 years ago by igloo

I can't reproduce this on Linux/amd64 or Windows/x86 with the expression length [1.. 2^28]. Has anyone got a testcase for it?

Changed 5 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

This turned out to be caused by an old Linux threads bug; from pthreads(7):

       Some NPTL non-conformances only occur with older kernels:

       -  The  information returned by times(2) and getrusage(2) is per-thread
          rather than process-wide (fixed in kernel 2.6.9).

The solution is to use a newer kernel, or to compile ghc(i) without -threaded.

Changed 3 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 3 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.