Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,976
    • Issues 4,976
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 479
    • Merge requests 479
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #8371
Closed
Open
Created Sep 27, 2013 by dsamperi@trac-dsamperi

ghci byte compiler + FFI crashes when used with embedded R

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):

  1. cd R-3.0.2
  2. ./configure --enable-R-shlib
  3. make
  4. make install
  5. cd <haskelltestdir>
  6. ghci -L/usr/local/lib64/R/lib -lR haskellRtest.hs
  7. Main> main

Loading... Initialize R session... Error: C stack usage is too close to the limit

Notes:

  1. No computations are done, the failure happens during startup.
  2. The C functions called are in <R source>/src/unix/Rembedded.c
  3. The error message is issued from <R source>/src/main/errors.c
  4. I tried increasing the system level C stack size limit but this didn't help.
  5. As noted above, there are no problems when ghc is used.
Trac metadata
Trac field Value
Version 7.6.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC hvr
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking