Skip to content

GitLab

    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    • Menu
    Projects Groups Snippets
  • Get a free trial
  • Sign up
  • Login
  • Sign in / Register
  • H hoppy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 17
    • Issues 17
    • List
    • Boards
    • Service Desk
    • Milestones
    • Requirements
  • Merge requests 1
    • Merge requests 1
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar

GitLab 15.0 has launched! Please visit Breaking changes in 15.0 and 15.0 Removals to see which breaking changes may impact your workflow.

  • Bryan Gardiner
  • hoppy
  • Issues
  • #34
Closed
Open
Created Jun 20, 2018 by Bryan Gardiner@khumba🐹Owner

Callback destruction after RTS shutdown

As issue #33 (closed) points out, if a callback is saved into a C++ variable that persists past the lifetime of the GHC RTS, then it's too late to be calling back into Haskell to do freeHaskellFunPtr, and we get the following warning as the program shuts down:

hoppy-example: newBoundTask: RTS is not initialised; call hs_init() first

If we can check whether the RTS is alive from a callback's destructor, then we could do nothing if it's dead. Or perhaps we can use hs_free_fun_ptr(). One problem with both of these is that if the RTS is shut down and started up again as is explicitly allowed by hs_exit()/hs_init(), then our function pointers will be garbage, so it might be better to see whether we can use finalizers or some RTS shutdown hook to invalidate callbacks.

Assignee
Assign to
Time tracking