content

While trying to add scotty support to the greencal project I was working on, I ran into this issue when trying to access a route at runtime:

CallStack (from HasCallStack):
  error, called at libraries/base/GHC/Event/Thread.hs:290:13 in base:GHC.Event.Thread
GHC.Event.Thread.getSystemTimerManager: the TimerManager requires linking against the threaded runtime
CallStack (from HasCallStack):
  error, called at libraries/base/GHC/Event/Thread.hs:290:13 in base:GHC.Event.Thread
GHCG.HECv.eEnvte.nTth.rTeharde.agde.tgSGeyHtsCSt.yeEsmvtTeeinmmtTe.irTmMhearrneMaaagdne.arggG:eeH trCtS:.hy Eestv theTeenim tmTT.eiiTrmmhMeerarrenMMaaaadgnn.eaagrgge eetrrrSe: yq rsutetihqereume iTsTri iemlmseie rnrlMkMiaiannnnkagaig gneaegrgr :a a irgtneahsqietun  isTtrtihe meste  hrtleMhi arntnekhaairgdneeegard d  aerrgdeua qnirutnuiisnrmttee is
tm Chelae
il CnltakShlitrlnaeSgcat kdaa ecg(dkaf  irr(noufsmnrt to Himtam hseHeC
a aCstlaChllarSlletSlaatSdcatekcad)kc : kr
()u f:n r
teo irm mr eeoHr
rarC,soa Crlca,lal SllctlSaaetlcdalk ce akd(t) f :arl
toi  mb l reiHarbarrrsioaCerras,il/ elbcsSaa/tslbaelac/eskGde)H /:CaG
/tH E C vl/eeiErnbvrtreo/anrTrt,hi/ reTceshaa/rldbel.aaehsddse. :/ha2Gst9H: 0C2l:/9i1E0b3v:r e1ain3rnt i /iebTnsah /srbbeeaa:assGdeeH.:/ChGG.sHHE:CCv2./e9EEn0vvt:ee.1nnT3tth ./riTTenhha rrdbee
aaasdde
.:hGsH:C2.9E0v:e1n3t .iTnh rbeaasde
:GHC.Event.Thread

I had no idea what this meant, and the output was probably garbled due to the error message being emitted multiple times at the same time. Looking up the exact, ungarbled error message, duck duck go found exactly one result: https://github.com/yesodweb/wai/issues/1019

However, this didn't help me understand what was going on with my project. I decided to look up the error message without quotes around it and found this page: https://downloads.haskell.org/~ghc/6.12.1/docs/html/users_guide/runtime-control.html

I searched for "threaded" and found:

-Iseconds

(default: 0.3) In the threaded and SMP versions of the RTS (see -threaded, Section 4.10.6, “Options affecting linking”) [...]

I was reminded that I had used this flag on previous projects before, so I went to Section 4.10.6:

-threaded

Link the program with the "threaded" version of the runtime system. [...]

Which sounds exactly like the thing I need to resolve the error message I was seeing. Sure enough, adding the flag to my cabal file...

common warnings
-  ghc-options: -Werror -Wall
+  ghc-options: -Werror -Wall -threaded

...fixes the issue. I can access pages in Scotty now!

meta

created:

commit: 33d465ef