Opened 5 years ago

Closed 5 years ago

#7557 closed bug (invalid)

Default implementation for a type class function missing when profiling is enabled

Reported by: JohnWiegley Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


I tried to reduce this to a simpler case, but was unable to produce the bug.

At the following line you'll see the function loadObject' defined for the type class Updatable:

And on this line I create an instance of the Updatable type class, with no override for this function:

All is well until I build with profiling, as follows:

    cabal configure                             \
        --enable-tests                          \
        --enable-benchmarks                     \
        --enable-library-profiling              \
        --enable-executable-profiling           \
        --ghc-option=-rtsopts                   \
        --ghc-option=-prof                      \
        --ghc-option=-fprof-auto                \
    cabal build

When built with profiling, the linker thinks that Blob.hs is trying to call another version of loadObject', _gitlibzm0zi5zi3_DataziGitziInternal_loadObjectzq_C1h_cc, which is not defined anywhere. The default implementation in the type class definition is named _gitlibzm0zi5zi3_DataziGitziInternal_loadObjectzq_C1g_cc.

The happens with both 7.4.2 and 7.6.1.

Change History (4)

comment:1 Changed 5 years ago by simonpj

difficulty: Unknown

Urgh. So many dependencies! Can you:

  • Do ghc --show-iface on Data/Git/Internal.hi
  • Compile Data.Git.Internal with -ddump-simpl
  • Compile Data.Git.Blob with -ddump-ds -ddump-simpl

and let me have the output? thanks.


comment:2 Changed 5 years ago by ezyang

Status: newinfoneeded

GitHub links no longer work!

comment:3 Changed 5 years ago by JohnWiegley

The code has now moved on enough that it's going to be very hard to reproduce this. The best I can suggest is to clone the project and look back for a commit around the same date as this bug report. Or, just close this bug and see if someone else runs into it.

comment:4 Changed 5 years ago by simonpj

Resolution: invalid
Status: infoneededclosed

OK, I think I'll just close it then. Sorry!

Note: See TracTickets for help on using tickets.