Skip to content

Segmentation fault when encountering a TemplateHaskell splice #800

@istathar

Description

@istathar

We've had ghcide crashing, and the editor trying to reload it leads to a tight loop that the editor can't escape. Trying the ghcide binary from the command-line in test mode leads to a segfault:

Step 6/6: Type checking the files
Segmentation fault (core dumped)

This is triggered when using TemplateHaskell. We have a splice fromPackage :: Q Exp which returns some metadata from the project's .cabal file:

version :: Version
version = $(fromPackage)

removing this definition from the source file (in this case RenderMain.hs lines 13-14) allows the ghcide binary to complete its test run:

Step 6/6: Type checking the files

Completed (1 file worked, 0 files failed)

I had earlier speculated that QuasiQuotes were to blame, but the file checks ok with those [quote| ... |] blocks still in the file.

Other files in the project load and check fine, so long as you avoid having the problematic file open in an editor tab you can avoid the crash. Not ideal, but at least a workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    can-workaroundcomponent: ghcidetype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions