Thread 1 "ghc" received signal SIGSEGV, Segmentation fault.0x00007ffff09f981c in LOOKS_LIKE_INFO_PTR_NOT_NULL (p=5260191916443929928) at rts/include/rts/storage/ClosureMacros.h:308308 return info->type != INVALID_OBJECT && info->type < N_CLOSURE_TYPES;(gdb) bt#0 0x00007ffff09f981c in LOOKS_LIKE_INFO_PTR_NOT_NULL (p=5260191916443929928) at rts/include/rts/storage/ClosureMacros.h:308#1 0x00007ffff09f9874 in LOOKS_LIKE_INFO_PTR (p=5260191916443929928) at rts/include/rts/storage/ClosureMacros.h:314#2 0x00007ffff09f98ce in LOOKS_LIKE_CLOSURE_PTR (p=0x7ffff0a75d30 <stg_ARR_WORDS_info>) at rts/include/rts/storage/ClosureMacros.h:322#3 0x00007ffff09f797c in heap_view_closureSize (closure=0x7ffff0a75d30 <stg_ARR_WORDS_info>) at rts/Heap.c:18#4 0x00007ffff0a73d52 in stg_unpackClosurezh () from /home/hsyl20/projects/ghc/master/_build/stage1/bin/../lib/x86_64-linux-ghc-9.11.20240424/libHSrts-1.0.2_thr_debug-ghc9.11.20240424.so#5 0x00000042004a8578 in ?? ()#6 0x0000000000000000 in ?? ()
It looks like it's trying to call unpackClosure# on an infotable.
Reconstruct type of nRTTI started with initial type a_IQe[rt]instScheme [a_IQe[rt]] a_IQe[rt] [a_aQh[tau:0]]check1 passedadd constraint: r_aQj[rutv:0] = a_aQh[tau:0]go r_aQj[rutv:0]GHC.Runtime.Interpreter.getClosureGHC.Exts.Heap.getClosureDataFromHeapObject[1] 341103 segmentation fault (core dumped) ~/projects/ghc/master/_build/stage1/bin/ghc --interactive test.hs -ddump-rtti
We try to reconstruct the type of n, but we already know it in main while we don't in foo. I think the CgBreakInfo are wrong in main. Maybe we should filter the free tyvars to only keep those in scope in GHC.Runtime.Eval.bindLocalsAtBreakpoint?
(Note that if we make fooNOINLINE, we don't have the bug.)