I had a Haskell application crash today with this error message:
app: file descriptor 8758616 out of range for select (0--1024).
Recompile with -threaded to work around this.
How can I solve this? What does -threaded mean?
If you think you're already compiling with -threaded, you can use RTS options to verify:
$ ./app +RTS --info
[("GHC RTS", "YES")
,("GHC version", "9.4.8")
,("RTS way", "rts_thr")
,("Build platform", "x86_64-unknown-linux")
,("Build architecture", "x86_64")
,("Build OS", "linux")
,("Build vendor", "unknown")
,("Host platform", "x86_64-unknown-linux")
,("Host architecture", "x86_64")
,("Host OS", "linux")
,("Host vendor", "unknown")
,("Target platform", "x86_64-unknown-linux")
,("Target architecture", "x86_64")
,("Target OS", "linux")
,("Target vendor", "unknown")
,("Word size", "64")
,("Compiler unregisterised", "NO")
,("Tables next to code", "YES")
,("Flag -with-rtsopts", "")
]
If "RTS way" contains thr, as above, you have built the binary correctly and it should not have this issue. If it doesn't, e.g. "rts_v" (v for vanilla), then you need to rebuild it (perhaps some recompilation avoidance didn't notice the options changed?). See GHC docs for more about different RTS ways, and the other fields above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With