Opened 6 years ago

Closed 5 years ago

Last modified 4 years ago

#8549 closed bug (fixed)

GHCI incorrectly link symbols defined with foreign import ccall

Reported by: qnikst Owned by:
Priority: normal Milestone:
Component: GHCi Version: 7.6.3
Keywords: Cc: hvr
Operating System: Linux Architecture: Unknown/Multiple
Type of failure: GHCi crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


I have a problem that ghci when loads modules that uses external symbols incorrectly links them, the problem is not reproducible if I'm compiling executable or load modules with :load command.

As a result every Pointer value is equivalent to constant 0x0000fffffff225ff.

A minimal example is in attached link, it contains a small package and description how to reproduce a bug.

Problem is also reproduces on the ghc-HEAD.

Attachments (1)

test-case.tar (20.0 KB) - added by qnikst 6 years ago.
project with example of the problem

Download all attachments as: .zip

Change History (7)

comment:1 Changed 6 years ago by hvr

I assume this is on Linux/x86_64?

comment:2 in reply to:  1 Changed 6 years ago by qnikst

Replying to hvr:

I assume this is on Linux/x86_64?


I've tested it on Linux/x86 before and it also failed, I'll update information as soon as I'll be able to run it on that box again.

comment:3 Changed 6 years ago by carter

theres no attachement on this ticket.

Changed 6 years ago by qnikst

Attachment: test-case.tar added

project with example of the problem

comment:4 Changed 6 years ago by qnikst

Operating System: Unknown/MultipleLinux

comment:5 Changed 5 years ago by rwbarton

Resolution: fixed
Status: newclosed

I can reproduce this in 7.6 and ghci's behavior is quite baffling to me, but happily 7.8 exhibits the expected behavior.

comment:6 Changed 4 years ago by qnikst

Looks like this issue still have happen in some weird situation, currently I have the same issue, in a file that uses constant in quasi-quoter, but only when I'm using haddock (ghc builds fine). Not sure that it will be easy to write a minimal example because this problem involves many parts (quasiquotes, foreing-interface, external library), but many it will give an ideas of what is happening. This issue is reproducible on 7.8 and 7.10.

Should I fill a separate bug for that?

Note: See TracTickets for help on using tickets.