Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • 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,830
    • Issues 4,830
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 447
    • Merge requests 447
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #7588

Closed
Open
Created Jan 15, 2013 by thoughtpolice@trac-thoughtpolice

GHC HEAD built with LLVM on Mac OS X miscompiles RTS: SIGSEGV in stg_PAP_apply

After fixing #7571 (closed) and #7580 (closed), with those two patches, I now get a working stage1 compiler that can produce binaries using the LLVM backend. But all of them segfault:

$ cat no-op.hs
main = return ()
$ ~/code/haskell/ghc/inplace/bin/ghc-stage1 -fforce-recomp -fllvm no-op.hs
[1 of 1] Compiling Main             ( no-op.hs, no-op.o )
Linking no-op ...
$ ./no-op
[1]    12434 segmentation fault  ./no-op
$  

This looks like an error in stg_PAP_apply:

gdb -q ./no-op                                                                                                                            ⏎
Reading symbols for shared libraries .... done
(gdb) r
Starting program: /Users/a/t/no-op 
Reading symbols for shared libraries +++............................. done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x00000001002917d4 in stg_PAP_apply ()
(gdb) 

I imagine this is due to some miscompilation of rts/Apply.cmm using LLVM.

I'll rebuild the stage1 compiler with debugging support for sanity, and also enable the debug RTS in the test, and report back soon.

(I imagine this failure is certainly possible *because* of my patches in the other tickets, although my intuition tells me those are strictly correctness fixes and something else is afoot here.)

Trac metadata
Trac field Value
Version 7.7
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (LLVM)
Test case
Differential revisions
BlockedBy #7571 (closed), #7580 (closed)
Related
Blocking
CC dterei, simonmar
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