Modifying the "StgHeader" struct

Csaba Hruska csaba.hruska at gmail.com
Sun Feb 25 15:42:57 UTC 2024


Hi,
Are you using profiling mode?
Regards,
Csaba

On Sun, Feb 25, 2024 at 1:59 PM Adithya Kumar <adi.obilisetty at gmail.com>
wrote:

> Hello,
>
> I want to add a field for collecting information about the number of GCs a
> particular heap object survived.
>
> I've done the following to implement this:
> - Add a field "StgWord gc_id" to struct "StgHeader" and "StgThunkHeader"
> - Update "SET_HDR" macro in "ClosureMacros.h" to update the "gc_id"
> - Update the "closureTypeHeaderSize" function in "Heap/ClosureTypes.hs" to
>   account for that 1 extra word.
>
> Compilation leads to a segmentation fault. The stage 2 compiler is built.
> But
> usage of it leads to a segmentation fault.
>
> Build output:
> ```
> chmod +x
> inplace/bin/ghc-stage2
> "inplace/bin/ghc-stage2" -hisuf dyn_hi -osuf  dyn_o -hcsuf dyn_hc -fPIC
> -dynamic  -O0 -H64m -Wall      -hide-all-packages -package-env - -i
> -iutils/check-api-annotations/.
> -iutils/check-api-annotations/dist-install/build
> -Iutils/check-api-annotations/dist-install/build
> -iutils/check-api-annotations/dist-install/build/check-api-annotations/autogen
> -Iutils/check-api-annotations/dist-install/build/check-api-annotations/autogen
>     -optP-include
> -optPutils/check-api-annotations/dist-install/build/check-api-annotations/autogen/cabal_macros.h
> -package-id Cabal-3.2.1.0 -package-id base-4.14.3.0 -package-id
> containers-0.6.5.1 -package-id directory-1.3.6.0 -package-id
> ghc-8.10.7.20240224 -Wall -XHaskell2010  -no-user-package-db -rtsopts
> -Wnoncanonical-monad-instances  -outputdir
> utils/check-api-annotations/dist-install/build   -c
> utils/check-api-annotations/./Main.hs -o
> utils/check-api-annotations/dist-install/build/Main.dyn_o
> utils/check-api-annotations/ghc.mk:18: recipe for target
> 'utils/check-api-annotations/dist-install/build/Main.dyn_o' failed
> make[1]: *** [utils/check-api-annotations/dist-install/build/Main.dyn_o]
> Segmentation fault (core dumped)
> Makefile:123: recipe for target 'all' failed
> make: *** [all] Error 2
> ```
>
> Is there any other place I've missed follow-up modifications?
>
> I appreciate any help provided.
>
> Best,
> Adithya
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20240225/04f3eda2/attachment.html>


More information about the ghc-devs mailing list