GHCI 9.4.{5,6} hangs on start on FreeBSD
Simply running ghci
results in a single thread busy loop. Backtrace:
(gdb) thread apply all bt
Thread 5 (LWP 103394 of process 61909 "ghc_worker"):
#0 _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:40
#1 0x000000084114bd12 in _thr_umtx_timedwait_uint (mtx=0x1802d69a1050, id=id@entry=0, clockid=<optimized out>, abstime=<optimized out>, shared=15, shared@entry=0) at /usr/src/lib/libthr/thread/thr_umtx.c:236
#2 0x0000000841142309 in _thr_sleep (curthread=curthread@entry=0x1802d5e13500, clockid=0, abstime=abstime@entry=0x0) at /usr/src/lib/libthr/thread/thr_kern.c:199
#3 0x000000084113d88d in cond_wait_user (cvp=0x1802d5e381c0, mp=0x1802d6400d08, abstime=0x0, cancel=1) at /usr/src/lib/libthr/thread/thr_cond.c:320
#4 cond_wait_common (cond=<optimized out>, mutex=<optimized out>, abstime=0x0, cancel=1) at /usr/src/lib/libthr/thread/thr_cond.c:380
#5 0x000000083b9e04f6 in waitCondition () from /usr/local/lib/ghc-9.4.5/bin/../lib/x86_64-freebsd-ghc-9.4.5/libHSrts-1.0.2_thr-ghc9.4.5.so
#6 0x000000083b9917d2 in yieldCapability () from /usr/local/lib/ghc-9.4.5/bin/../lib/x86_64-freebsd-ghc-9.4.5/libHSrts-1.0.2_thr-ghc9.4.5.so
#7 0x000000083b9ae964 in ?? () from /usr/local/lib/ghc-9.4.5/bin/../lib/x86_64-freebsd-ghc-9.4.5/libHSrts-1.0.2_thr-ghc9.4.5.so
#8 0x000000083b9af3bd in scheduleWorker () from /usr/local/lib/ghc-9.4.5/bin/../lib/x86_64-freebsd-ghc-9.4.5/libHSrts-1.0.2_thr-ghc9.4.5.so
#9 0x000000083b9b566a in ?? () from /usr/local/lib/ghc-9.4.5/bin/../lib/x86_64-freebsd-ghc-9.4.5/libHSrts-1.0.2_thr-ghc9.4.5.so
#10 0x000000084113ea15 in thread_start (curthread=0x1802d5e13500) at /usr/src/lib/libthr/thread/thr_create.c:292
#11 0x0000000000000000 in ?? ()
Backtrace stopped: Cannot access memory at address 0x8458e3000
Thread 4 (LWP 103393 of process 61909 "ghc_worker"):
#0 _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:40
#1 0x000000084114bd12 in _thr_umtx_timedwait_uint (mtx=0x1802d69a1038, id=id@entry=0, clockid=<optimized out>, abstime=<optimized out>, shared=15, shared@entry=0) at /usr/src/lib/libthr/thread/thr_umtx.c:236
#2 0x0000000841142309 in _thr_sleep (curthread=curthread@entry=0x1802d6c08000, clockid=0, abstime=abstime@entry=0x0) at /usr/src/lib/libthr/thread/thr_kern.c:199
#3 0x000000084113d88d in cond_wait_user (cvp=0x1802d6c07000, mp=0x1802d6400c88, abstime=0x0, cancel=1) at /usr/src/lib/libthr/thread/thr_cond.c:320
#4 cond_wait_common (cond=<optimized out>, mutex=<optimized out>, abstime=0x0, cancel=1) at /usr/src/lib/libthr/thread/thr_cond.c:380
#5 0x000000083b9e04f6 in waitCondition () from /usr/local/lib/ghc-9.4.5/bin/../lib/x86_64-freebsd-ghc-9.4.5/libHSrts-1.0.2_thr-ghc9.4.5.so
#6 0x000000083b9914c1 in ?? () from /usr/local/lib/ghc-9.4.5/bin/../lib/x86_64-freebsd-ghc-9.4.5/libHSrts-1.0.2_thr-ghc9.4.5.so
#7 0x000000083b99140e in waitForCapability () from /usr/local/lib/ghc-9.4.5/bin/../lib/x86_64-freebsd-ghc-9.4.5/libHSrts-1.0.2_thr-ghc9.4.5.so
#8 0x000000083b9ae330 in resumeThread () from /usr/local/lib/ghc-9.4.5/bin/../lib/x86_64-freebsd-ghc-9.4.5/libHSrts-1.0.2_thr-ghc9.4.5.so
#9 0x0000000839003d2a in ?? () from /usr/local/lib/ghc-9.4.5/bin/../lib/x86_64-freebsd-ghc-9.4.5/libHSbase-4.17.1.0-ghc9.4.5.so
#10 0x0000000000000000 in ?? ()
Thread 3 (LWP 103392 of process 61909 "ghc_worker"):
#0 _kevent () at _kevent.S:4
#1 0x000000084114abb1 in __thr_kevent (kq=3, changelist=0x0, nchanges=0, eventlist=0x42007fb010, nevents=64, timeout=0x0) at /usr/src/lib/libthr/thread/thr_syscalls.c:400
#2 0x0000000838ff530a in base_GHCziEventziKQueue_new12_info () from /usr/local/lib/ghc-9.4.5/bin/../lib/x86_64-freebsd-ghc-9.4.5/libHSbase-4.17.1.0-ghc9.4.5.so
#3 0x0000000000000000 in ?? ()
Thread 2 (LWP 103391 of process 61909 "ghc_ticker"):
#0 _nanosleep () at _nanosleep.S:4
--Type <RET> for more, q to quit, c to continue without paging--c
#1 0x000000084114a51c in __thr_nanosleep (time_to_sleep=0x842f60f78, time_remaining=0x842f60f78) at /usr/src/lib/libthr/thread/thr_syscalls.c:289
#2 0x000000083b9ab93b in rtsSleep () from /usr/local/lib/ghc-9.4.5/bin/../lib/x86_64-freebsd-ghc-9.4.5/libHSrts-1.0.2_thr-ghc9.4.5.so
#3 0x000000083b9dfa3b in ?? () from /usr/local/lib/ghc-9.4.5/bin/../lib/x86_64-freebsd-ghc-9.4.5/libHSrts-1.0.2_thr-ghc9.4.5.so
#4 0x000000084113ea15 in thread_start (curthread=0x1802d5e12700) at /usr/src/lib/libthr/thread/thr_create.c:292
#5 0x0000000000000000 in ?? ()
Backtrace stopped: Cannot access memory at address 0x842f61000
Thread 1 (LWP 103066 of process 61909):
#0 munmap () at munmap.S:4
#1 0x000000083b9c244b in mmapForLinker () from /usr/local/lib/ghc-9.4.5/bin/../lib/x86_64-freebsd-ghc-9.4.5/libHSrts-1.0.2_thr-ghc9.4.5.so
#2 0x000000083b990190 in alloc_adjustor () from /usr/local/lib/ghc-9.4.5/bin/../lib/x86_64-freebsd-ghc-9.4.5/libHSrts-1.0.2_thr-ghc9.4.5.so
#3 0x000000083b9df60f in createAdjustor () from /usr/local/lib/ghc-9.4.5/bin/../lib/x86_64-freebsd-ghc-9.4.5/libHSrts-1.0.2_thr-ghc9.4.5.so
#4 0x0000000823ee2dcd in ?? () from /usr/local/lib/ghc-9.4.5/bin/../lib/x86_64-freebsd-ghc-9.4.5/libHSterminfo-0.4.1.5-ghc9.4.5.so
#5 0x0000000000000000 in ?? ()