Ticket #1865 (closed bug: duplicate)

Opened 6 years ago

Last modified 5 years ago

GHCi debugger crashes with :print

Reported by: cdsmith@… Owned by:
Priority: normal Milestone: 6.8.2
Component: GHCi Version: 6.9
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

To reproduce:

1. Enter the following code into a source file:

{-# LANGUAGE NoMonomorphismRestriction #-}

d (i, j) = i + j

dmerge xs     [] = xs
dmerge []     ys = ys
dmerge (x:xs) (y:ys) | d x <  d y = x : dmerge xs     (y:ys)
                     | d x == d y = x : dmerge xs     ys
                     | otherwise  = y : dmerge (x:xs) ys

pairs xs = head xs : pairs (tail xs `dmerge` map (\(i,j) -> (i+1,j+1)) xs
                                    `dmerge` map (\(i,j) -> (i,  j+1)) xs)

allpairs = pairs [(1,2)]

2. Start ghci, and pass this file as a parameter.

3. Type :print allpairs

GHCi will crash.

cdsmith@devtools:~/haskell/projects/euler$ ghci -ignore-dot-ghci BugTest.hs
GHCi, version 6.9.20071101: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
[1 of 1] Compiling Main             ( BugTest.hs, interpreted )
Ok, modules loaded: Main.
*Main> :print allpairs
*** Exception: ghci/Debugger.hs:84:11-72: Irrefutable pattern failed for pattern Data.Maybe.Just subst

ghc-6.9.20071101: panic! (the 'impossible' happened)
  (GHC version 6.9.20071101 for i386-unknown-linux):
        ghci/Debugger.hs:84:11-72: Irrefutable pattern failed for pattern Data.Maybe.Just subst


Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

Note that it does not crash without the LANGUAGE directive, so this appears to have something to do with the polymorphic type.

cdsmith@devtools:~/haskell/projects/euler$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.9.20071101

Change History

  Changed 6 years ago by igloo

  • difficulty set to Unknown
  • milestone set to 6.8 branch

Thanks for the report

  Changed 6 years ago by sorear

  • reporter guest deleted

I suspect this is a dup of < http://hackage.haskell.org/trac/ghc/ticket/1827> - does it still crash if 'dmerge' is assigned a non-overloaded type?

Also, it really helps if we have a way to contact you; the recommended way to do this is to put your e-mail address in the Reporter field (replacing 'guest').

follow-up: ↓ 4   Changed 6 years ago by guest

sorear, yeah that is almost certainly the same bug. I searched for existing reports, but missed that one. And yes, explicitly giving a non-overloaded type to dmerge fixes the error.

I don't see how to change the reporter; I did add myself as a CC when I submitted the bug.

in reply to: ↑ 3 ; follow-up: ↓ 5   Changed 6 years ago by sorear

  • cc cdsmith@… removed
  • status changed from new to closed
  • resolution set to duplicate
  • reporter set to cdsmith@…

Replying to guest:

sorear, yeah that is almost certainly the same bug. I searched for existing reports, but missed that one. And yes, explicitly giving a non-overloaded type to dmerge fixes the error.

Okay; I'll take the liberty of closing the ticket, then (if this proves wrong, it can be reopened just as easily).

I don't see how to change the reporter; I did add myself as a CC when I submitted the bug.

You use the big row of text-boxes at the bottom. Enter 'cdsmith@…' in the Reporter field, enter your comment, and click Submit. (The two acts of changing fields and adding a comment are NOT separable in Trac.)

in reply to: ↑ 4   Changed 6 years ago by igloo

Replying to sorear:

Replying to guest:

I don't see how to change the reporter; I did add myself as a CC when I submitted the bug.

You use the big row of text-boxes at the bottom. Enter 'cdsmith@…' in the Reporter field, enter your comment, and click Submit. (The two acts of changing fields and adding a comment are NOT separable in Trac.)

guest can't change the reporter field at the moment, but it is now possible to create your own account.

  Changed 5 years ago by igloo

  • milestone changed from 6.8 branch to 6.8.2

  Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

  Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.