Skip to content

Segmentation fault in retainer profiler

Summary

When trying to use the retainer profiler on my program, it crashes with a segmentation fault.

Steps to reproduce

I created a MWE repository for the source code:

$ git clone https://gitlab.haskell.org/tau-mask/mwe-segfault.git
$ cd mwe-segfault
$ stack build --profile
$ stack exec oberon -- mwedata/ +RTS -hr

Environment

  • GHC version used: 8.6.5

Optional:

  • Operating System: Linux
  • System Architecture: x86-64

This is the backtrace from the core dump:

#0  isRetainer (c=<optimized out>) at rts/RetainerProfile.c:1034
#1  retainClosure (c0=<optimized out>, cp0=<optimized out>, r0=<optimized out>) at rts/RetainerProfile.c:1574
#2  0x000000000175204f in markCapability (evac=evac@entry=0x1758880 <retainRoot>, user=user@entry=0x0, cap=0x1b2a900 <MainCapability>, 
no_mark_sparks=no_mark_sparks@entry=false) at rts/Capability.c:1171
#3  0x00000000017520dd in markCapabilities (evac=evac@entry=0x1758880 <retainRoot>, user=user@entry=0x0) at rts/Capability.c:1196
#4  0x0000000001758ad9 in computeRetainerSet () at rts/RetainerProfile.c:1744
#5  retainerProfile () at rts/RetainerProfile.c:1969
#6  0x000000000174a194 in heapCensus (t=<optimized out>) at rts/ProfHeap.c:1174
#7  0x000000000175eff3 in GarbageCollect (collect_gen=collect_gen@entry=1, do_heap_census=do_heap_census@entry=true, gc_type=gc_type@entry=0, 
cap=cap@entry=0x1b2a900 <MainCapability>, idle_cap=idle_cap@entry=0x0) at rts/sm/GC.c:773
#8  0x00000000017502ec in scheduleDoGC (pcap=pcap@entry=0x7ffcffd27778, task=task@entry=0x38b9d00, force_major=force_major@entry=false)
at rts/Schedule.c:1799
#9  0x0000000001750caf in schedule (task=0x38b9d00, initialCapability=<optimized out>) at rts/Schedule.c:545
#10 scheduleWaitThread (tso=<optimized out>, ret=ret@entry=0x0, pcap=pcap@entry=0x7ffcffd277d8) at rts/Schedule.c:2533
#11 0x00000000017519d4 in rts_evalLazyIO (cap=cap@entry=0x7ffcffd277d8, p=p@entry=0x1961c80, ret=ret@entry=0x0) at rts/RtsAPI.c:530
#12 0x000000000175bc9e in hs_main (argc=2, argv=0x7ffcffd279c8, main_closure=0x1961c80, rts_config=...) at rts/RtsMain.c:72
#13 0x000000000042ee92 in main ()
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information