Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,323
    • Issues 4,323
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 385
    • Merge Requests 385
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #8604

Closed
Open
Opened Dec 09, 2013 by clavin@trac-clavin

Some stack/vmem limits (ulimit) combinations causing GHC to fail

I have encountered a strange occurrence with GHC that was causing several GHC job failures on an SGE cluster. It turned out that there were other SGE users who needed an absurdly large stack size limit (set via 'ulimit -s') in the several gigabytes range. The default stack size limit had to be raised for the entire cluster.

Any job that was run on a machine where the virtual memory limit was less than or equal to 2X the stack size limit, GHC would crash with the following message:

ghc: failed to create OS thread: Cannot allocate memory

I am running on GHC 7.6.3 with a 64-bit RedHat Enterprise OS, version 5.5.

To reproduce the error, I was able to create the following test case:

\[ \~\]$ ulimit -v
unlimited
\[ \~\]$ ulimit -s
10240
\[ \~\]$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.3
\[ \~\]$ ulimit -v 2000000
\[ \~\]$ ulimit -s 1000000
\[ \~\]$ ghc --version
ghc: failed to create OS thread: Cannot allocate memory
\[ \~\]$ ulimit -s 500000
\[ \~\]$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.3

Several other programs work find using these settings, but GHC consistently has problems. Is this a fundamental issue with how GHC operates or can this be addressed?

Edited Sep 14, 2020 by Ben Gamari
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#8604