Skip to content

With biography profiling setNumCapabilities should error if N>1

Summary

In rts/ProfHeap.c we have the following check to ensure LDV profiling isn't done with multiple active capabilities:

#if defined(THREADED_RTS)
    // See #12019.
    if (doingLDVProfiling() && RtsFlags.ParFlags.nCapabilities > 1) {
        errorBelch("-hb cannot be used with multiple capabilities");
        stg_exit(EXIT_FAILURE);
    }
#endif

However users can circumvent this check by first running with n=1 and then using setNumCapabilities to increase the number of threads.

This is very likely to lead to a crash. We should add a check and error in setNumCapabilities if LDV profiling is active and n>1.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information