ghci byte compiler + FFI crashes when used with embedded R
|Reported by:||dsamperi||Owned by:|
|Operating System:||Linux||Architecture:||x86_64 (amd64)|
|Type of failure:||GHCi crash||Difficulty:||Unknown|
|Test Case:||Blocked By:|
The ghci interpreter destroys the C stack when initializing embedded R (the statistical
software system available at http://cran.r-project.org/). There is no problem using
embedded R with ghc (compiled code). I have had no problems using ghci with other FFI projects, and this does not appear to be a linking problem (there are no undefined references).
To reproduce the problem (under Fedora Linux using ghc 7.6.3) download the R source code, unpack, and (using haskellRtest.hs is attached):
- cd R-3.0.2
- ./configure --enable-R-shlib
- make install
- cd <haskelltestdir>
- ghci -L/usr/local/lib64/R/lib -lR haskellRtest.hs
- Main> main
Initialize R session...
Error: C stack usage is too close to the limit
- No computations are done, the failure happens during startup.
- The C functions called are in <R source>/src/unix/Rembedded.c
- The error message is issued from <R source>/src/main/errors.c
- I tried increasing the system level C stack size limit but this didn't help.
- As noted above, there are no problems when ghc is used.