#8754 closed bug (fixed)

:set +s always says space usage is 0 bytes

Reported by: George Owned by:
Priority: high Milestone: 7.8.1
Component: GHCi Version: 7.8.1-rc1
Keywords: Cc: hvr
Operating System: MacOS X Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

:set +s always says space usage is 0 bytes

 ghci
GHCi, version 7.8.20140130:...
...
sumOfPrimes2 40000000 25
1677366278943
it :: Int
(14.84 secs, 0 bytes)

setting to high as this is a regression

Change History (16)

comment:1 Changed 18 months ago by carter

i've also had this problem with my independent mac build.

comment:2 in reply to: ↑ description Changed 18 months ago by hvr

Replying to George:

setting to high as this is a regression

...are you saying, this worked in 7.6.3?

comment:3 Changed 18 months ago by George

Right, a regression from 7.6.3

comment:4 Changed 18 months ago by darchon

It is probably related to the fact that ghci is now dynamically linked:

7.8-RC1:

GHCi, version 7.8.20140130: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> :set +s
Prelude> sum [1,2,3,4]
10
(0.03 secs, 0 bytes)

Statically linked HEAD (DYNAMIC_BY_DEFAULT = NO; DYNAMIC_GHC_PROGRAMS=NO; GhcLibWays = v p):

GHCi, version 7.9.20140207: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> :set +s
Prelude> sum [1,2,3,4]
10
(0.05 secs, 8283104 bytes)

AFAIK, we can't have dynamic linking and profiling at the same time; so I don't know if this can be resolved before the release of 7.8.1

Edit: ignore my comment about profiling, +s doesn't need profiling libs

Last edited 18 months ago by darchon (previous) (diff)

comment:5 Changed 18 months ago by hvr

I wonder what's different on OSX, as on Linux :set +s works even with dynamic (non-profiling) libs

comment:6 Changed 18 months ago by thoughtpolice

  • Milestone set to 7.8.1

comment:7 Changed 18 months ago by Austin Seipp <austin@…>

In 5023c91780e90947680fe0640f7564a4f6448bea/ghc:

Fix #8754 in a round-about way.

For some reason on OS X, it seems like -Bsymbolic (which we use for
hooks into the RTS) isn't working, which results in #8754, where stats
don't work because defaultHooks doesn't initialize the stats flag. This
seems to work on Linux static/dynamically, but only on OS X statically.

After talking with Simon, really, the entire hooks thing is a bit
fragile. For now, we just work around it (since GHCi is dynamically
linked) by calling into the defaultHooks ourselves when GHC starts.

Signed-off-by: Austin Seipp <[email protected]>

comment:8 Changed 18 months ago by thoughtpolice

  • Status changed from new to merge

comment:9 Changed 18 months ago by Austin Seipp <austin@…>

In b626c3d4ce0e66216705ba8355c914dc809e3fe7/ghc:

Add comments explaining #8754

Signed-off-by: Austin Seipp <[email protected]>

comment:10 Changed 18 months ago by thoughtpolice

  • Resolution set to fixed
  • Status changed from merge to closed

Merged.

comment:11 Changed 18 months ago by Austin Seipp <austin@…>

In 642bba349fda1508aa136f7169c0ba63fb00a6f9/ghc:

Revert "Add comments explaining #8754"

This reverts commit b626c3d4ce0e66216705ba8355c914dc809e3fe7.

comment:12 Changed 18 months ago by Austin Seipp <austin@…>

In e789a4f51b6205160a696e3e6e13ecefb5ae16f7/ghc:

Revert "Fix #8754 in a round-about way."

This reverts commit 5023c91780e90947680fe0640f7564a4f6448bea.

comment:13 Changed 18 months ago by hvr

  • Resolution fixed deleted
  • Status changed from closed to new

re-opened (see also ghc-dev post)

comment:14 Changed 18 months ago by Austin Seipp <austin@…>

In c72e8898447b2a8e55f2d16594b5944c2ae13e24/ghc:

Fix #8754 again.

This time, we carefully initialize the GC stats only if they're not
already initialized - this way the user can override them (e.g. `+RTS -t
--machine-readable`).

Signed-off-by: Austin Seipp <[email protected]>

comment:15 Changed 18 months ago by thoughtpolice

  • Status changed from new to merge

Fixed in HEAD and in 7.8.

comment:16 Changed 18 months ago by thoughtpolice

  • Resolution set to fixed
  • Status changed from merge to closed
Note: See TracTickets for help on using tickets.