The cardinality analysis patch broke profiling. This can be seen in the nightly builds, where the profasm and profthreaded ways show many, many failures. ghc:changeset:da4ff650 is good, and ghc:changeset:62653122 is bad; the intervening few changes are not buildable.
Trac metadata
Trac field
Value
Version
7.7
Type
Bug
TypeOfFailure
OtherFailure
Priority
normal
Resolution
Unresolved
Component
Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
I believe the remaining prof failures existed before the cardinality patch. The fix I just checked in should re-instate cost centres in non-top-level closures with no free variables.
If you have a segfaulting test case, please let us know!
I just ran into the same problem as parcs, in trying to fix a performance bug it seems I have introduced (in my own branch). Is there a page with advice on fixing performance problems other than Debugging/ProfilingGhc?
I've verified that cardinality + build fixes + mainland workaround result in a segfaulting ghc-stage2, e.g. my log looks like:
375cd37 Add a work-around for #7978.6265312 Wibbles (merg-os) to ticky-ticky507c897 Comments about the Name Cache99d4e5b Implement cardinality analysis
I've also verified that profiling is fine before the cardinality analysis patch.
My guess is cardinality analysis is tickling a latent bug in the code generator related to generating code for non-updatable thunks. If you disable cardinality analysis in the following way:
diff --git a/compiler/stgSyn/CoreToStg.lhs b/compiler/stgSyn/CoreToStg.lhsindex 1395c22..414a6d8 100644--- a/compiler/stgSyn/CoreToStg.lhs+++ b/compiler/stgSyn/CoreToStg.lhs@@ -807,7 +807,7 @@ mkStgRhs rhs_fvs srt bndr binder_info rhs (getFVs rhs_fvs) upd_flag srt [] rhs where- upd_flag = getUpdateFlag bndr+ upd_flag = Updatable {- SDM: disabled. Eval/Apply can't handle functions with arity zero very well; and making these into simple non-updatable thunks breaks other
I think the profiling build goes through as desired.
Edward: thanks for some great sleuthing. I think that points the finger at the RTS code for non-updatable selector thunks, which has probably never been tested before. I'll try to get around to looking at this, but feel free to dive in first.