Fork fails to pause

Teo Camarasu
2025-12-19T13:06:31Z

I am trying to use the fork method to pause a process so I can take a snapshot from a production application. When I test this locally it works, but with a production server under load, the forked process fails to actually pause with this backtrace:
```
#0 0x00007f236025b38e in __futex_abstimed_wait_common () from /nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib/libc.so.6
#1 0x00007f236025e010 in pthread_cond_wait@@GLIBC_2.3.2 () from /nix/store/cg9s562sa33k78m63njfn1rw47dp9z0i-glibc-2.40-66/lib/libc.so.6
#2 0x000000000a03d709 in waitCondition (pCond=pCond@entry=0x7f2144000bd0, pMut=pMut@entry=0x7f2144000c08) at rts/posix/OSThreads.c:143
#3 0x0000000009fee59b in waitForReturnCapability (task=task@entry=0x7f2144000bc0) at rts/Capability.c:794
#4 0x0000000009fef14c in waitForCapability (pCap=pCap@entry=0x7f214e39d368, task=task@entry=0x7f2144000bc0) at rts/Capability.c:921
#5 0x000000000a003d27 in acquireAllCapabilities (cap=cap@entry=0x0, task=task@entry=0x7f2144000bc0) at rts/Schedule.c:1554
#6 0x000000000a003ee8 in stopAllCapabilitiesWith (pCap=pCap@entry=0x0, task=task@entry=0x7f2144000bc0, sync_type=sync_type@entry=SYNC_OTHER) at rts/Schedule.c:1440
#7 0x000000000a003f27 in stopAllCapabilities (pCap=pCap@entry=0x0, task=task@entry=0x7f2144000bc0) at rts/Schedule.c:1422
#8 0x0000000009ff8a7f in rts_pause () at rts/RtsAPI.c:758
#9 0x0000000000968623 in pause_mutator ()
#10 0x0000000000969c07 in ?? ()
#11 0x000000000096c251 in ?? ()
#12 0x000000000096c895 in start_over_un ()
#13 0x0000000000961ca6 in ghczmdebugzmstubzm0zi7zi0zi0zm1uPMX2kmdMl39NMgrQK9Gq_GHCziDebugziStub_startzuoverzuunzuc_info ()
#14 0x0000000000000000 in ?? ()
```
Note that it only has one thread so this is the sum of all backtraces.