Bug#334337: hugs segfault if Show class in instancied but show method not defined.
Package: hugs Version: 98.200503.08-3 Severity: normal Hello Isaac, It looks like hugs segfault if you instancy Show but not define a show method and then implicitly use it: Let foo.hs = --->8- module Fibo where type Quad = (Integer,Integer) newtype Gauss = Karl Quad instance Eq Gauss where Karl (a,b) == Karl (c,d) = a == c && b == d instance Show Gauss where ---8<- in $ hugs fibo3.hs Type :? for help Fibo> Karl (1,2) zsh: segmentation fault hugs fibo3.hs Cheers, -- Bill. <[EMAIL PROTECTED]> Imagine a large red swirl here. -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (500, 'unstable') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.4.27 Locale: LANG=fr_FR, LC_CTYPE=fr_FR (charmap=ISO-8859-1) Versions of packages hugs depends on: ii libc6 2.3.5-6GNU C Library: Shared libraries an ii libncurses5 5.4-9 Shared libraries for terminal hand ii libreadline5 5.0-11 GNU readline and history libraries -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#334337: hugs segfault if Show class in instancied but show method not defined.
On Mon, Oct 17, 2005 at 11:52:56AM +0200, Bill Allombert wrote: > It looks like hugs segfault if you instance Show but not define a > show method and then implicitly use it: > > Let foo.hs = > --->8- > module Fibo where > type Quad = (Integer,Integer) > newtype Gauss = Karl Quad > instance Eq Gauss where >Karl (a,b) == Karl (c,d) = a == c && b == d > instance Show Gauss where > ---8<- > in > $ hugs fibo3.hs > Type :? for help > Fibo> Karl (1,2) > zsh: segmentation fault hugs fibo3.hs This is an instance of Hugs segfaulting on some infinite computations (here show -> showsPrec -> show). You can do the same thing with an empty Eq instance or just let f x = g x + 1; g x = f x + 2 in f 3 The general problem is documented in the User's Guide, but I believe it's fixed in CVS version (src/machine.c 1.25 and src/prelude.h 1.79 if anyone's interested in backporting). -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]