<div dir="ltr">Hey folks,<br><br>I'm adding a field to "StgHeader" under a flag.<br><br>```<br>typedef struct {<br>    const StgInfoTable* info;<br>#if defined(NEW_WAY)<br>    StgWord             new_field;<br>#endif<br>#if defined(PROFILING)<br>    StgProfHeader         prof;<br>#endif<br>} StgHeader;<br><br>typedef struct {<br>    const StgInfoTable* info;<br>#if defined(NEW_WAY)<br>    StgWord             new_field;<br>#endif<br>#if defined(PROFILING)<br>    StgProfHeader         prof;<br>#endif<br>    StgSMPThunkHeader     smp;<br>} StgThunkHeader;<br>```<br><br>Follow-up changes:<br>==================<br><br>The following are the additional changes I've made following the `PROFILING`<br>flag:<br><br>Similar to `PROF_HDR_FIELDS` macro, I've added `NEW_HDR_FIELDS` macro:<br><br>```<br>#if defined(NEW_WAY)<br>#define NEW_HDR_FIELDS(w_,hdr) w_ hdr,<br>#else<br>#define NEW_HDR_FIELDS(w_,hdr) /* Nothing */<br>#endif<br>```<br>and updated the required stg code accordingly following the changes from<br>`PROF_HDR_FIELDS`.<br><br>I've also updated `GHC.Exts.Heap.ClosureTypes.closureTypeHeaderSize`<br>accordingly.<br><br>Error:<br>======<br><br>I'm greeted with the following error,<br>```<br>ASSERTION FAILED: file rts/StgStartup.cmm, line 100<br>```<br><br>Basically, the following assert fails<br>```<br>#define CHECK_SENSIBLE_REGS()                           \<br>    ASSERT(Hp != 0);                                    \<br>    ASSERT(HpAlloc == 0);                               \<br>    ASSERT(Sp != 0);                                    \<br>    ASSERT(SpLim != 0);                                 \<br>    ASSERT(SpLim - WDS(RESERVED_STACK_WORDS) <= Sp);<br>```<br><br>More context for the error:<br>===========================<br><br>Values for the correct version:<br>```<br>Hp      283468906488<br>HpAlloc 0<br>Sp      283468911440<br>SpLim   283468910784<br>SpLim - WDS(RESERVED_STACK_WORDS) 1069080<br>```<br><br>Values with the changes:<br>```<br>Hp      283468906488<br>HpAlloc 0<br>Sp      7532120<br>SpLim   9301536<br>SpLim - WDS(RESERVED_STACK_WORDS) 9301368<br>```<br><br>I recorded these values by calling a C print from the Cmm code.<br><br>Clearly, my changes messed up a lot of things. How do I go about this now? The<br>past 2 weeks I've only been looking at a lot of ghc code. If any more additional<br><div>context is required I can provide it.</div><div><br></div><div>Best,</div><div>Adithya<br></div></div>