tweag / HaskellR

The full power of R in Haskell.

Home Page:https://tweag.github.io/HaskellR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

stack size problem on FreeBSD

sprock opened this issue · comments

Hello,
I installed inline-r from the hackage package on FreeBSD-11.2 using ghci-8.4.3.
I load this into ghci:

import Data.Int (Int32)
import H.Prelude.Interactive
import qualified Language.R.Instance as R

main :: IO()
main = do
R.initialize R.defaultConfig
return()

Then:
ghci> :set -XTemplateHaskell -XQuasiQuotes -XScopedTypeVariables -XDataKinds -XGADTs -XPartialTypeSignatures -XOverloadedLists -XViewPatterns

I then run this test:

ghci> x <- [r| 1 + 1 |]
Language.R.Interpreter: Cannot increase stack size limit.Try increasing your stack size limit manually:$ ulimit -s unlimited

:3:6: error:
* Exception when trying to run compile-time code:
setResourceLimit: permission denied (Operation not permitted)
Code: Language.Haskell.TH.Quote.quoteExp r " 1 + 1 "
* In the quasi-quotation: [r| 1 + 1 |]

This happens both on a 32-bit system with stack size set to 65536k and a 64-bit system with stack size 524288k.

Do you have a tip how can I get the similar system to test the issue myself?
Likely I can avoid running setResourceLimit on FreeBSD, but I'm not sure

I just added this:

#ifdef freebsd_HOST_OS
let stackLimit = ResourceLimit 67104768
#else
let stackLimit = ResourceLimitUnknown
#endif

at line 230 in inline-r-0.9.2/src/Language/R/Instance.hs

and now it works if I start ghci with the -fno-ghci-sandbox option, as per the FAQ.

@sprock thanks! let me add that to R.