Ticket #3157 (closed bug: wontfix)

Opened 4 years ago

Last modified 4 years ago

ghci segmentation fault when computation is interrupted

Reported by: fft1976 Owned by:
Priority: normal Milestone: 6.10 branch
Component: libraries (other) Version: 6.10.2
Keywords: ghci Cc:
Operating System: Linux Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

This is using Ubuntu 8.04. Both source-compiled and binary (libedit2) show this behavior.

GHCi, version 6.10.2: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
Prelude> let a = a
Prelude> a

Then I press Ctrl-C

Segmentation fault
$ 

Potentially relevant:

$ dpkg -l | grep libedit
ii  libedit-dev                                2.9.cvs.20050518-4                                   BSD editline and history libraries (developm
ii  libedit2                                   2.9.cvs.20050518-4                                   BSD editline and history libraries

Attachments

libedit-20090111-3.0-use-sigaction.patch Download (3.0 KB) - added by int-e 4 years ago.
Patch against libedit-20090111-3.0 from  http://www.thrysoee.dk/editline/; it applies to Debian's 20050518 version as well (using patch -p2 in the libedit-20050518 subdirectory), but I haven't tested the result.

Change History

Changed 4 years ago by fft1976

Actually

let a = a
a

isn't necessary. Ctrl-C causes Segfault regardless.

I should also add that the installation didn't go very smoothly: rts and other error messages. See follow-up messages in #3151

Changed 4 years ago by int-e

If this is on x86, libedit is responsible for the segfault. It installs its own SIGINT signal handler using signal() and then reinstalls the RTS signal handler using signal again. This causes the SA_SIGINFO flag to be lost. As a result, the RTS' signal handler does not receive the siginfo_t data that it needs. I have a patch for editline, but I haven't reported this anywhere yet.

N.B. This does not happen in x86_64 because there the siginfo_t is always passed to the signal handler.

Changed 4 years ago by int-e

Patch against libedit-20090111-3.0 from  http://www.thrysoee.dk/editline/; it applies to Debian's 20050518 version as well (using patch -p2 in the libedit-20050518 subdirectory), but I haven't tested the result.

Changed 4 years ago by benl

Pressing Ctrl-C in ghci on sparc/solaris also causes a segfault.

Changed 4 years ago by igloo

  • difficulty set to Unknown
  • milestone set to 6.10 branch

6.12 won't use libedit, so we only need to worry about this if we do a 6.10.3 release.

Changed 4 years ago by cmcq

  • status changed from new to closed
  • resolution set to duplicate

See #2812. I don't get a segfault in 6.10.3.

Changed 4 years ago by simonmar

  • status changed from closed to reopened
  • resolution duplicate deleted

Changed 4 years ago by simonmar

  • status changed from reopened to closed
  • resolution set to wontfix
  • component changed from Runtime System to libraries (other)
Note: See TracTickets for help on using tickets.