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,936
    • Issues 4,936
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 456
    • Merge requests 456
  • 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
  • #12622
Closed
Open
Created Sep 25, 2016 by Mathieu Boespflug@mboes

Unboxed static pointers lead to missing SPT entries

I found what appears to be a regression following the merge of the new FloatOut based static pointers support. See https://github.com/mboes/bug-ptr-not-in-spt for a fully developed minimal example.

It seems to be quite hard to trigger this bug:

  • I need to be using distributed-closure (not bare StaticPtr).
  • The static pointer needs to be defined in a separate module.
  • The static pointer must refer to a value with at least one polymorphic argument.
  • Compiler optimization level 1 needs to be turned on.

At any rate, I wasn't able to trigger it without all conditions above being true. Initial investigations by facundominguez point to static pointer unpacking in distributed-closure as the culprit. Likely unpacked static pointers are no longer recognized as such by the FloatOut pass and therefore never floated to top-level, hence breaking a fundamental invariant about static pointers.

This might explain why sometimes static pointers don't get added to the static pointer table (SPT), as in the above minimal example.

Edited Mar 10, 2019 by Mathieu Boespflug
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking