[GHC] #9845: GHC API evaluating some Cabal code fails with SegFault if executable is compiled statically

#9845: GHC API evaluating some Cabal code fails with SegFault if executable is compiled statically -------------------------------------+------------------------------------- Reporter: | Owner: JeanPhilippeMoresmau | Status: new Type: bug | Milestone: Priority: normal | Version: 7.8.3 Component: GHC API | Operating System: Keywords: | Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: Runtime Difficulty: Unknown | crash Blocked By: | Test Case: Related Tickets: 9480, 8935, 8376 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- This is code from the dynamic-cabal project, but I've distilled it into an easier test case. Basically you load a module that calls the Cabal configure function, and we try to call a function and get the result. This works fine if the executable is compiled with -dynamic, but segfaults (on Ubuntu at least) if the executable is static. I've had that behavior since 7.8.1 and I've seen several similar bugs come and be fixed, but the issue is still present in 7.8.4 rc1 (ghc-7.8.3.20141119) I attach the full project, with the cabal file, the Main.hs module that loads the DynamicCabalQuery.hs module -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9845 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9845: GHC API evaluating some Cabal code fails with SegFault if executable is compiled statically -------------------------------------+------------------------------------- Reporter: | Owner: JeanPhilippeMoresmau | Status: infoneeded Type: bug | Milestone: Priority: normal | Version: 7.8.3 Component: GHC API | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: Runtime | Related Tickets: #9480, #8935, crash | #8376 Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by trommler): * status: new => infoneeded * related: 9480, 8935, 8376 => #9480, #8935, #8376 Comment: Phab:D349 fixes the issue on openSUSE. I attached a back port to ghc 7.8.4-RC1. Could you give it a try? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9845#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9845: GHC API evaluating some Cabal code fails with SegFault if executable is compiled statically -------------------------------------+------------------------------------- Reporter: | Owner: JeanPhilippeMoresmau | Status: infoneeded Type: bug | Milestone: Priority: normal | Version: 7.8.3 Component: GHC API | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: Runtime | Related Tickets: #9480, #8935, crash | #8376 Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by JeanPhilippeMoresmau): As far as can tell, after building 7.8.4 rc1 with the attached patch, the problem has gone away and the code works! Thanks a million! Will that patch be part of the final release of 7.8.4? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9845#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9845: GHC API evaluating some Cabal code fails with SegFault if executable is compiled statically -------------------------------------+------------------------------------- Reporter: | Owner: JeanPhilippeMoresmau | Status: merge Type: bug | Milestone: Priority: normal | Version: 7.8.3 Component: GHC API | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: Runtime | Related Tickets: #9480, #8935, crash | #8376 Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by trommler): * status: infoneeded => merge Comment: Any chance the fix for #8935 could still be merged into 7.8.4? A cherry pick would result in a conflict in `Linker.lhs` so you might want to try the patch attached to this ticket. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9845#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9845: GHC API evaluating some Cabal code fails with SegFault if executable is compiled statically -------------------------------------+------------------------------------- Reporter: | Owner: JeanPhilippeMoresmau | Status: merge Type: bug | Milestone: 7.8.4 Priority: normal | Version: 7.8.3 Component: GHC API | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: Runtime | Related Tickets: #9480, #8935, crash | #8376 Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by trommler): * milestone: => 7.8.4 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9845#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9845: GHC API evaluating some Cabal code fails with SegFault if executable is compiled statically -------------------------------------+------------------------------------- Reporter: | Owner: JeanPhilippeMoresmau | Status: new Type: bug | Milestone: 7.10.1 Priority: normal | Version: 7.8.3 Component: GHC API | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: 9875 Type of failure: Runtime | Related Tickets: #9480, #8935, crash | #8376 Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by trommler): * status: merge => new * blockedby: => 9875 * milestone: 7.8.4 => 7.10.1 Comment: The fix for #8935 in HEAD introduces a regression on OS X. See ticket #9875. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9845#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9845: GHC API evaluating some Cabal code fails with SegFault if executable is compiled statically -------------------------------------+------------------------------------- Reporter: | Owner: JeanPhilippeMoresmau | Status: closed Type: bug | Milestone: 7.10.1 Priority: normal | Version: 7.8.3 Component: GHC API | Keywords: Resolution: duplicate | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: 9875 Type of failure: Runtime | Related Tickets: #9480, #8935, crash | #8376 Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by trommler): * status: new => closed * resolution: => duplicate Comment: This is fixed in HEAD. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9845#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC