Opened 3 years ago

Closed 3 years ago

#9845 closed bug (duplicate)

GHC API evaluating some Cabal code fails with SegFault if executable is compiled statically

Reported by: JeanPhilippeMoresmau Owned by:
Priority: normal Milestone: 7.10.1
Component: GHC API Version: 7.8.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Runtime crash Test Case:
Blocked By: #9875 Blocking:
Related Tickets: #9480, #8935, #8376 Differential Rev(s):
Wiki Page:

Description

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

Attachments (2)

GHCBugs-0.1.tar.gz (1.8 KB) - added by JeanPhilippeMoresmau 3 years ago.
SDist of project containing the haskell file loaded dynamically
D349.patch (12.0 KB) - added by trommler 3 years ago.
Pabricator patch backported to ghc 7.8.4-RC1

Download all attachments as: .zip

Change History (8)

Changed 3 years ago by JeanPhilippeMoresmau

Attachment: GHCBugs-0.1.tar.gz added

SDist of project containing the haskell file loaded dynamically

Changed 3 years ago by trommler

Attachment: D349.patch added

Pabricator patch backported to ghc 7.8.4-RC1

comment:1 Changed 3 years ago by trommler

Status: newinfoneeded

Phab:D349 fixes the issue on openSUSE. I attached a back port to ghc 7.8.4-RC1. Could you give it a try?

comment:2 Changed 3 years ago 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?

comment:3 Changed 3 years ago by trommler

Status: infoneededmerge

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.

comment:4 Changed 3 years ago by trommler

Milestone: 7.8.4

comment:5 Changed 3 years ago by trommler

Blocked By: 9875 added
Milestone: 7.8.47.10.1
Status: mergenew

The fix for #8935 in HEAD introduces a regression on OS X. See ticket #9875.

comment:6 Changed 3 years ago by trommler

Resolution: duplicate
Status: newclosed

This is fixed in HEAD.

Note: See TracTickets for help on using tickets.