ANNOUNCE: GHC 6.10.2 Release Candidate 1

We are pleased to announce the first release candidate for GHC 6.10.2: http://www.haskell.org/ghc/dist/6.10.2-rc1/ This includes two source bundles: ghc-6.10.1.20090314-src.tar.bz2 ghc-6.10.1.20090314-src-extralibs.tar.bz2 Only the first of these is necessary. The "extralibs" package contains various extra packages that we normally supply with GHC - unpack the extralibs tarball on top of the source tree to add them, and they will be included in the build automatically. There are also installers for Windows (i386) and OS X (i386), and binary distributions for x86_64/Linux and i386/Linux. More may appear later. Please test as much as possible; bugs are much cheaper if we find them before the release! Thanks Ian, on behalf of the GHC team

On Sun, Mar 15, 2009 at 03:51:42PM +0000, Ian Lynagh wrote:
We are pleased to announce the first release candidate for GHC 6.10.2:
http://www.haskell.org/ghc/dist/6.10.2-rc1/
This includes two source bundles:
ghc-6.10.1.20090314-src.tar.bz2 ghc-6.10.1.20090314-src-extralibs.tar.bz2
Could you add a testsuite tarball too please? -- Exherbo KDE, X.org maintainer

On Sun, Mar 15, 2009 at 10:49:20PM +0000, Ingmar Vanhassel wrote:
Could you add a testsuite tarball too please?
There's already one there. Thanks Ian

I've tried the 6.10.2 RC with some performance-sensitive work code. The code uses the non-threaded runtime, and makes extensive use of signals. The results look very good. The slightly funny (but useful to us) benchmark measures bandwidth communicating between multiple unix processes. Here's a graph of how much better 6.10.2 is doing: http://galois.com/~dons/images/bandwidth.png Note we're over a 1G/s bandwidth now with 6.10.2 for the first time :) Thanks guys! (Note also we use a slightly modified runtime that has thread deadlock detection disabled). There have been quite a few runtime patches, enough that 6.10.2 is really quite a different runtime now: http://galois.com/~dons/rts.patches http://galois.com/~dons/6101-6102.diff Anyway, all those signal and thread handling changes are looking good. -- Don

I've tried the 6.10.2 RC with some performance-sensitive work code. The code uses the non-threaded runtime, and makes extensive use of signals. The results look very good.
The slightly funny (but useful to us) benchmark measures bandwidth communicating between multiple unix processes. Here's a graph of how much better 6.10.2 is doing:
http://galois.com/~dons/images/bandwidth.png
Note we're over a 1G/s bandwidth now with 6.10.2 for the first time :) Thanks guys!
(Note also we use a slightly modified runtime that has thread deadlock detection disabled).
There have been quite a few runtime patches, enough that 6.10.2 is really quite a different runtime now:
http://galois.com/~dons/rts.patches http://galois.com/~dons/6101-6102.diff
Anyway, all those signal and thread handling changes are looking good.
Looking back through what has gone into 6.10.2, I think the credit probably goes to the patch below. It's nice to hear this improves performance too - that was an unexpected benefit.
If you're able to test with the HEAD, I'd be very interested to see your results there too.
Cheers,
Simon
Fri Feb 20 14:32:00 GMT 2009 Ian Lynagh

Ian Lynagh wrote:
We are pleased to announce the first release candidate for GHC 6.10.2:
http://www.haskell.org/ghc/dist/6.10.2-rc1/
This includes two source bundles:
ghc-6.10.1.20090314-src.tar.bz2 ghc-6.10.1.20090314-src-extralibs.tar.bz2
Awesome! This release candidate is also available for testing purposes through the gentoo haskell overlay. http://code.haskell.org/gentoo/gentoo-haskell/ You can use the overlay either through layman (overlay called haskell) http://www.gentoo.org/proj/en/overlays/userguide.xml or by yourself a la old school, PORTDIR_OVERLAY in make.conf. We don't yet have any ebuilds for the extralibs. GHC is hard masked, meaning only available for testing purposes, use caution :) $ echo dev-lang/ghc >> /etc/portage/package.unmask It's also keyworded ~amd64 ~x86, meaning you'll have to allow potentially unstable packages: $ echo dev-lang/ghc >> /etc/portage/package.keywords Last but not least, the ebuild does not provide any bootstrapping binary to compile ghc, so you need to already have a version of ghc installed to bootstrap with. Then emerge with $ USE="ghcbootstrap -binary" emerge dev-lang/ghc Please report any issues in #gentoo-haskell @ freenode. Cheers, Lennart Kolmodin -- Gentoo Dev

Hello, interesting but I'm not able to build this on SunOS 5.11/x86. The build fails with: (echo dist/build/cbits/PrelIOUtils.p_o dist/build/cbits/WCsubst.p_o dist/build/cbits/Win32Utils.p_o dist/build/cbits/consUtils.p_o dist/build/cbits/dirUtils.p_o dist/build/cbits/inputReady.p_o dist/build/cbits/selectUtils.p_o `find dist/build -name "*_stub.p_o" -print`; find dist/build/Foreign/Concurrent_split dist/build/GHC/Arr_split dist/build/GHC/Base_split dist/build/GHC/Classes_split dist/build/GHC/Conc_split dist/build/GHC/ConsoleHandler_split dist/build/GHC/Desugar_split dist/build/GHC/Enum_split dist/build/GHC/Environment_split dist/build/GHC/Err_split dist/build/GHC/Exception_split dist/build/GHC/Exts_split dist/build/GHC/Float_split dist/build/GHC/ForeignPtr_split dist/build/GHC/Handle_split dist/build/GHC/IO_split dist/build/GHC/IOBase_split dist/build/GHC/Int_split dist/build/GHC/List_split dist/build/GHC/Num_split dist/build/GHC/PArr_split dist/build/GHC/Pack_split dist/build/GHC/Ptr_split dist/build/GHC/Read_split dist/build/GHC/Real_split dist/build/GHC/ST_split dist/build/GHC/STRef_split dist/build/GHC/Show_split dist/build/GHC/Stable_split dist/build/GHC/Storable_split dist/build/GHC/TopHandler_split dist/build/GHC/Unicode_split dist/build/GHC/Weak_split dist/build/GHC/Word_split dist/build/System/Timeout_split dist/build/Control/Applicative_split dist/build/Control/Arrow_split dist/build/Control/Category_split dist/build/Control/Concurrent_split dist/build/Control/Concurrent/Chan_split dist/build/Control/Concurrent/MVar_split dist/build/Control/Concurrent/QSem_split dist/build/Control/Concurrent/QSemN_split dist/build/Control/Concurrent/SampleVar_split dist/build/Control/Exception_split dist/build/Control/Exception/Base_split dist/build/Control/OldException_split dist/build/Control/Monad_split dist/build/Control/Monad/Fix_split dist/build/Control/Monad/Instances_split dist/build/Control/Monad/ST_split dist/build/Control/Monad/ST/Lazy_split dist/build/Control/Monad/ST/Strict_split dist/build/Data/Bits_split dist/build/Data/Bool_split dist/build/Data/Char_split dist/build/Data/Complex_split dist/build/Data/Dynamic_split dist/build/Data/Either_split dist/build/Data/Eq_split dist/build/Data/Data_split dist/build/Data/Fixed_split dist/build/Data/Foldable_split dist/build/Data/Function_split dist/build/Data/HashTable_split dist/build/Data/IORef_split dist/build/Data/Int_split dist/build/Data/Ix_split dist/build/Data/List_split dist/build/Data/Maybe_split dist/build/Data/Monoid_split dist/build/Data/Ord_split dist/build/Data/Ratio_split dist/build/Data/STRef_split dist/build/Data/STRef/Lazy_split dist/build/Data/STRef/Strict_split dist/build/Data/String_split dist/build/Data/Traversable_split dist/build/Data/Tuple_split dist/build/Data/Typeable_split dist/build/Data/Unique_split dist/build/Data/Version_split dist/build/Data/Word_split dist/build/Debug/Trace_split dist/build/Foreign_split dist/build/Foreign/C_split dist/build/Foreign/C/Error_split dist/build/Foreign/C/String_split dist/build/Foreign/C/Types_split dist/build/Foreign/ForeignPtr_split dist/build/Foreign/Marshal_split dist/build/Foreign/Marshal/Alloc_split dist/build/Foreign/Marshal/Array_split dist/build/Foreign/Marshal/Error_split dist/build/Foreign/Marshal/Pool_split dist/build/Foreign/Marshal/Utils_split dist/build/Foreign/Ptr_split dist/build/Foreign/StablePtr_split dist/build/Foreign/Storable_split dist/build/Numeric_split dist/build/Prelude_split dist/build/System/Console/GetOpt_split dist/build/System/CPUTime_split dist/build/System/Environment_split dist/build/System/Exit_split dist/build/System/IO_split dist/build/System/IO/Error_split dist/build/System/IO/Unsafe_split dist/build/System/Info_split dist/build/System/Mem_split dist/build/System/Mem/StableName_split dist/build/System/Mem/Weak_split dist/build/System/Posix/Internals_split dist/build/System/Posix/Types_split dist/build/Text/ParserCombinators/ReadP_split dist/build/Text/ParserCombinators/ReadPrec_split dist/build/Text/Printf_split dist/build/Text/Read_split dist/build/Text/Read/Lex_split dist/build/Text/Show_split dist/build/Text/Show/Functions_split dist/build/Unsafe/Coerce_split -name '*.p_o' -print) | xargs /usr/bin/ar q dist/build/libHSbase-4.1.0.0_p.a ar: creating dist/build/libHSbase-4.1.0.0_p.a internal error: error_message(58) gmake[3]: *** [dist/build/libHSbase-4.1.0.0_p.a] Error 100 gmake[2]: *** [all] Error 1 gmake[2]: Leaving directory `/var/tmp/ghc-6.10.1.20090314/libraries/base' gmake[1]: *** [make.library.base] Error 2 gmake[1]: Leaving directory `/var/tmp/ghc-6.10.1.20090314/libraries' gmake: *** [stage1] Error 2 I've configure with simple: ./configure --prefix=/tmp/ghc-6.10.1.20090314 and build with: gmake The interesting thing is that GHC stable builds on my buildbot well: http://darcs.haskell.org/buildbot/all/builders/kgardas%20stable Any idea what I'm doing wrong? Thanks, Karel

Hi Karel, On Mon, Mar 16, 2009 at 11:26:05AM +0100, Karel Gardas wrote:
interesting but I'm not able to build this on SunOS 5.11/x86. The build fails with:
(echo dist/build/cbits/PrelIOUtils.p_o dist/build/cbits/WCsubst.p_o dist/build/cbits/Win32Utils.p_o dist/build/cbits/consUtils.p_o dist/build/cbits/dirUtils.p_o dist/build/cbits/inputReady.p_o dist/build/cbits/selectUtils.p_o `find dist/build -name "*_stub.p_o" -print`; find dist/build/Foreign/Concurrent_split dist/build/GHC/Arr_split dist/build/GHC/Base_split
[...]
dist/build/Text/Show/Functions_split dist/build/Unsafe/Coerce_split -name '*.p_o' -print) | xargs /usr/bin/ar q dist/build/libHSbase-4.1.0.0_p.a ar: creating dist/build/libHSbase-4.1.0.0_p.a internal error: error_message(58) gmake[3]: *** [dist/build/libHSbase-4.1.0.0_p.a] Error 100 gmake[2]: *** [all] Error 1 gmake[2]: Leaving directory `/var/tmp/ghc-6.10.1.20090314/libraries/base' gmake[1]: *** [make.library.base] Error 2 gmake[1]: Leaving directory `/var/tmp/ghc-6.10.1.20090314/libraries' gmake: *** [stage1] Error 2
I've configure with simple: ./configure --prefix=/tmp/ghc-6.10.1.20090314
and build with:
gmake
The interesting thing is that GHC stable builds on my buildbot well: http://darcs.haskell.org/buildbot/all/builders/kgardas%20stable
The buildbot is putting "SplitObjs=NO" in mk/build.mk. The above log has object splitting enabled, which means that there are a lot more .o files, which is presumably causing some problem with your ar. If you have both a GNU ar and a Solaris ar then it might be worth seeing if the other one works. Otherwise, putting "SplitObjs=NO" in mk/build.mk will work, but at the expense of larger binaries. Thanks Ian

Hi Ian, Ian Lynagh wrote:
The buildbot is putting "SplitObjs=NO" in mk/build.mk. The above log has object splitting enabled, which means that there are a lot more .o files, which is presumably causing some problem with your ar.
If you have both a GNU ar and a Solaris ar then it might be worth seeing if the other one works. Otherwise, putting "SplitObjs=NO" in mk/build.mk will work, but at the expense of larger binaries.
I put just GNU ar into my PATH, so GHC build is using Sun ld and GNU ar and the build runs for much longer and breaks on: Building hsc2hs-0.67... [1 of 2] Compiling Paths_hsc2hs ( dist-install/build/autogen/Paths_hsc2hs.hs, dist-install/build/hsc2hs/hsc2hs-tmp/Paths_hsc2hs.o ) [2 of 2] Compiling Main ( Main.hs, dist-install/build/hsc2hs/hsc2hs-tmp/Main.o ) Linking dist-install/build/hsc2hs/hsc2hs ... gmake[3]: Leaving directory `/var/tmp/ghc-6.10.1.20090314/utils/hsc2hs' gmake -C haddock install-inplace gmake[3]: Entering directory `/var/tmp/ghc-6.10.1.20090314/utils/haddock' /var/tmp/ghc-6.10.1.20090314/utils/installPackage/install-inplace/bin/installPackage install '/var/tmp/ghc-6.10.1.20090314/utils/ghc-pkg/install-inplace/bin/ghc-pkg' '/var/tmp/ghc-6.10.1.20090314/inplace-datadir/package.conf' '' \ '/var/tmp/ghc-6.10.1.20090314/utils/haddock/install-inplace' \ '/var/tmp/ghc-6.10.1.20090314/utils/haddock/install-inplace' \ '$prefix/bin' \ '$prefix/lib' \ '$prefix/libexec' \ '$prefix/dynlib' \ '$prefix/share' \ '$prefix/doc' \ '$prefix/html' \ '$prefix/haddock' \ --distpref dist-install \ --enable-shell-wrappers Installing library in /var/tmp/ghc-6.10.1.20090314/utils/haddock/install-inplace/lib/haddock-2.4.2 Installing executable(s) in /var/tmp/ghc-6.10.1.20090314/utils/haddock/install-inplace/bin internal error: error_message(28) gmake[3]: *** [install-inplace] Error 100 gmake[3]: Leaving directory `/var/tmp/ghc-6.10.1.20090314/utils/haddock' gmake[2]: *** [with-stage-2] Error 2 gmake[2]: Leaving directory `/var/tmp/ghc-6.10.1.20090314/utils' gmake[1]: *** [stage2] Error 2 gmake[1]: Leaving directory `/var/tmp/ghc-6.10.1.20090314' gmake: *** [bootstrap2] Error 2 The message `internal error: error_message(28)' looks suspiciously, is there any Sun ar invoked behind the scene? Or isn't this message from the AR but coming from something else? Thanks, Karel

On Thu, Mar 19, 2009 at 11:31:33AM +0100, Karel Gardas wrote:
/var/tmp/ghc-6.10.1.20090314/utils/installPackage/install-inplace/bin/installPackage install '/var/tmp/ghc-6.10.1.20090314/utils/ghc-pkg/install-inplace/bin/ghc-pkg' '/var/tmp/ghc-6.10.1.20090314/inplace-datadir/package.conf' '' \ '/var/tmp/ghc-6.10.1.20090314/utils/haddock/install-inplace' \ '/var/tmp/ghc-6.10.1.20090314/utils/haddock/install-inplace' \ '$prefix/bin' \ '$prefix/lib' \ '$prefix/libexec' \ '$prefix/dynlib' \ '$prefix/share' \ '$prefix/doc' \ '$prefix/html' \ '$prefix/haddock' \ --distpref dist-install \ --enable-shell-wrappers
The message `internal error: error_message(28)' looks suspiciously, is there any Sun ar invoked behind the scene? Or isn't this message from the AR but coming from something else?
Try running the above command but with -v2 or -v3 appended, and it should show you what is being run. Looks like strip is probably the culprit. Thanks Ian

Ian Lynagh wrote:
We are pleased to announce the first release candidate for GHC 6.10.2:
Under Solaris grep does not understand "-q" in configure: checkMake380() { if $1 --version 2>&1 | head -1 | grep -q 'GNU Make 3\.80' it fails with: grep: illegal option -- q Usage: grep -hblcnsviw pattern file . . . grep: illegal option -- q Usage: grep -hblcnsviw pattern file . . . C.

GHC 6.10.2 will have a problem with cabal-install-0.6.2! When I tried to install cabal-install-0.6.2 for ghc-6.10.1.20090314 I needed to change #!/bin/sh to #!/bin/bash in bootstrap.sh to avoid the following errors: -bash-3.00$ ./bootstrap.sh Checking installed packages for ghc-6.10.1.20090314... ./bootstrap.sh: !: not found parsec is already installed and the version is ok. ./bootstrap.sh: !: not found network is already installed and the version is ok. ./bootstrap.sh: !: not found Cabal is already installed and the version is ok. ./bootstrap.sh: !: not found HTTP is already installed and the version is ok. ./bootstrap.sh: !: not found zlib is already installed and the version is ok. ./bootstrap.sh: !: not found ./bootstrap.sh: !: not found ./bootstrap.sh: !: not found Under Solaris sh is not bash! Next, ghc-6.10.1.20090314 comes with package unix-2.4.0.0, but cabal-install.cabal requests: unix >= 2.0 && < 2.4 Changing to "<= 2.4" was not sufficient, so I changed it to "<= 2.5". This will affect any OS! Testsuite results are bad for ghc-6.10.1.20090314, see http://hackage.haskell.org/trac/ghc/ticket/3106 Cheers Christian Christian Maeder wrote:
Ian Lynagh wrote:
We are pleased to announce the first release candidate for GHC 6.10.2:
Under Solaris grep does not understand "-q" in configure:
checkMake380() { if $1 --version 2>&1 | head -1 | grep -q 'GNU Make 3\.80'
it fails with:
grep: illegal option -- q Usage: grep -hblcnsviw pattern file . . . grep: illegal option -- q Usage: grep -hblcnsviw pattern file . . .
C.

Christian Maeder wrote:
Testsuite results are bad for ghc-6.10.1.20090314, see http://hackage.haskell.org/trac/ghc/ticket/3106
Patch for the cygpath not found issue is attached to the ticket. Please (Windows/Cygwin/Mingw users especially) test it. Thanks, Karel

On Tue, Mar 17, 2009 at 12:51:23PM +0100, Karel Gardas wrote:
Christian Maeder wrote:
Testsuite results are bad for ghc-6.10.1.20090314, see http://hackage.haskell.org/trac/ghc/ticket/3106
Patch for the cygpath not found issue is attached to the ticket. Please (Windows/Cygwin/Mingw users especially) test it.
Thanks; I'll apply one of the fixes and test on Windows platforms. Thanks Ian

On Tue, 2009-03-17 at 11:09 +0100, Christian Maeder wrote:
GHC 6.10.2 will have a problem with cabal-install-0.6.2!
When I tried to install cabal-install-0.6.2 for ghc-6.10.1.20090314 I needed to change #!/bin/sh to #!/bin/bash in bootstrap.sh to avoid the following errors:
-bash-3.00$ ./bootstrap.sh Checking installed packages for ghc-6.10.1.20090314... ./bootstrap.sh: !: not found
Under Solaris sh is not bash!
Indeed. According to the OpenGroup that syntax should be fine: http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_... It works for me under Solaris 10. Perhaps Solaris 9 or older do not have a standard compliant /bin/sh program. What do you suggest we use instead as a workaround?
Next, ghc-6.10.1.20090314 comes with package unix-2.4.0.0, but cabal-install.cabal requests:
unix >= 2.0 && < 2.4
Changing to "<= 2.4" was not sufficient, so I changed it to "<= 2.5". This will affect any OS!
Hmm, it's a bit suspicious that the major version number is changing in a minor ghc release. Do we know what the API breakage is? This could affect any program. Duncan

On 2009 Mar 17, at 20:28, Duncan Coutts wrote:
On Tue, 2009-03-17 at 11:09 +0100, Christian Maeder wrote:
Under Solaris sh is not bash!
Indeed.
According to the OpenGroup that syntax should be fine: http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_...
It works for me under Solaris 10. Perhaps Solaris 9 or older do not have a standard compliant /bin/sh program. What do you suggest we use instead as a workaround?
For backward compatibility reasons sh in Solaris 9 and earlier is not POSIX compliant. Use /usr/xpg4/bin/sh or /bin/bash instead. (Unfortunately you can't cheat and define a shell function, although you could create a program called "!": #! /bin/sh if ${1+"$@"}; then exit 1 else exit 0 fi .) -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

On Tue, 2009-03-17 at 21:12 -0400, Brandon S. Allbery KF8NH wrote:
On 2009 Mar 17, at 20:28, Duncan Coutts wrote:
It works for me under Solaris 10. Perhaps Solaris 9 or older do not have a standard compliant /bin/sh program. What do you suggest we use instead as a workaround?
For backward compatibility reasons sh in Solaris 9 and earlier is not POSIX compliant. Use /usr/xpg4/bin/sh or /bin/bash instead.
(Unfortunately you can't cheat and define a shell function, although you could create a program called "!":
if ${1+"$@"}; then exit 1 else exit 0 fi
Actually this is what the script used 'til someone pointed out to me that sh has the ! syntax :-). I'll switch it back to using this style with a note to say why. Duncan - ! grep " ${PKG}-${VER_MATCH}" ghc-pkg.list > /dev/null 2>&1 + if grep " ${PKG}-${VER_MATCH}" ghc-pkg.list > /dev/null 2>&1 + then + return 1; + else + return 0; + fi + #Note: we cannot use "! grep" as Solaris 9 /bin/sh doesn't like it.

Duncan Coutts wrote:
On Tue, 2009-03-17 at 11:09 +0100, Christian Maeder wrote:
./bootstrap.sh: !: not found
Under Solaris sh is not bash!
Indeed.
According to the OpenGroup that syntax should be fine: http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_...
It works for me under Solaris 10. Perhaps Solaris 9 or older do not have a standard compliant /bin/sh program. What do you suggest we use instead as a workaround?
The Isabelle people use "#!/usr/bin/env bash" as first line. Btw I had this problem under Solaris 10 (but I don't know how it was installed). Cheers Christian

On Wed, Mar 18, 2009 at 12:28:50AM +0000, Duncan Coutts wrote:
On Tue, 2009-03-17 at 11:09 +0100, Christian Maeder wrote:
unix >= 2.0 && < 2.4
Changing to "<= 2.4" was not sufficient, so I changed it to "<= 2.5". This will affect any OS!
Hmm, it's a bit suspicious that the major version number is changing in a minor ghc release. Do we know what the API breakage is? This could affect any program.
This looks like a braino to me. Things have been added to the API, but I don't see anything that's been removed or change. I'll put the version number back to 2.3.2.0. Thanks Ian

On Mon, Mar 16, 2009 at 04:00:09PM +0100, Christian Maeder wrote:
Under Solaris grep does not understand "-q" in configure:
checkMake380() { if $1 --version 2>&1 | head -1 | grep -q 'GNU Make 3\.80'
it fails with:
grep: illegal option -- q Usage: grep -hblcnsviw pattern file . . . grep: illegal option -- q Usage: grep -hblcnsviw pattern file . . .
OK, I'll just redirect stdout to /dev/null then. Presumably these print 0 and 1 respectively? echo foo | grep foo > /dev/null; echo $? echo foo | grep bar > /dev/null; echo $? Thanks Ian

Ian Lynagh wrote:
On Mon, Mar 16, 2009 at 04:00:09PM +0100, Christian Maeder wrote:
Under Solaris grep does not understand "-q" in configure:
checkMake380() { if $1 --version 2>&1 | head -1 | grep -q 'GNU Make 3\.80'
it fails with:
grep: illegal option -- q Usage: grep -hblcnsviw pattern file . . . grep: illegal option -- q Usage: grep -hblcnsviw pattern file . . .
OK, I'll just redirect stdout to /dev/null then.
Presumably these print 0 and 1 respectively?
echo foo | grep foo > /dev/null; echo $? echo foo | grep bar > /dev/null; echo $?
Yes, Christian -bash-3.00$ echo foo | grep foo > /dev/null; echo $? 0 -bash-3.00$ echo foo | grep bar > /dev/null; echo $? 1

Hello, On Sunday 15 March 2009 16:51, Ian Lynagh wrote:
We are pleased to announce the first release candidate for GHC 6.10.2: ... Please test as much as possible; bugs are much cheaper if we find them before the release! ...
thorkil-naurs-intel-mac-mini:~/tn/test/GHC/release/GHC-6.10.2-rc1
dyld: loaded: /bin/sh dyld: loaded: /usr/lib/libncurses.5.4.dylib dyld: loaded: /usr/lib/libiconv.2.dylib dyld: loaded: /usr/lib/libSystem.B.dylib dyld: loaded: /usr/lib/libgcc_s.1.dylib dyld: loaded: /usr/lib/system/libmathCommon.A.dylib dyld: loaded: /Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.1.20090314/ghc dyld: loaded: /usr/lib/libedit.2.dylib dyld: loaded: /usr/lib/libncurses.5.4.dylib dyld: loaded: /usr/lib/libSystem.B.dylib dyld: loaded: /usr/lib/libgcc_s.1.dylib dyld: loaded: /usr/lib/system/libmathCommon.A.dylib The Glorious Glasgow Haskell Compilation System, version 6.10.1.20090314 thorkil-naurs-intel-mac-mini:~/tn/test/GHC/release/GHC-6.10.2-rc1
thorkil-naurs-intel-mac-mini:~/tn/test/GHC/release/GHC-6.10.2-rc1
dyld: loaded: /bin/sh dyld: loaded: /usr/lib/libncurses.5.4.dylib dyld: loaded: /usr/lib/libiconv.2.dylib dyld: loaded: /usr/lib/libSystem.B.dylib dyld: loaded: /usr/lib/libgcc_s.1.dylib dyld: loaded: /usr/lib/system/libmathCommon.A.dylib dyld: loaded: /Users/thorkilnaur/tn/install/ghc-6.8.3/lib/ghc-6.8.3/ghc-6.8.3 dyld: loaded: /opt/local/lib/libreadline.5.2.dylib dyld: loaded: /opt/local/lib/libncurses.5.dylib dyld: loaded: /usr/lib/libSystem.B.dylib dyld: loaded: /opt/local/lib/libgmp.3.dylib dyld: loaded: /usr/lib/libgcc_s.1.dylib dyld: loaded: /usr/lib/system/libmathCommon.A.dylib The Glorious Glasgow Haskell Compilation System, version 6.8.3 thorkil-naurs-intel-mac-mini:~/tn/test/GHC/release/GHC-6.10.2-rc1
I have tried the Intel Mac installer and the source package on both FreeBSD and PPC Mac OS X. Some comments follow, first on GHC-6.10.1.20090314-i386.pkg: 1. An important property of such installers is that you are told, right from the start, that all the information you are presented with during the installation process can be accessed at any time, after completion of the installation, and you are told how. In case of GHC, something like a reference to a suitable spot, given as part of the output from ghc --help. I don't see any trace of such a facility on the introduction screen. (I know that other installers don't do this either, which is part of the reason why I try to avoid them.) 2. The introduction screen says "This package must be installed on the system volume" which seems to imply that there is some kind of choice involved at a later stage. But I don't recall having to perform any choice that related to this. So perhaps this should be "This package will be installed on the system volume" instead. 3. I can copy and paste the text of the introduction screen, excellent. I cannot copy and paste the header. 4. On the License screen, GMP is denoted "GNU MP Bignum Library" in two places. I suggest using "GNU Multiple Precision Arithmetic Library" (from http://gmplib.org/) instead. 5. On the License screen, replace "licence" by "license", twice. 6. The License screen explains "that by default the GMP will be statically linked into any binary produced by GHC. Software with a non-GPL compatible licence [sic] will have to ensure that the conditions of the LGPL are met; for example, by forcing GMP to link dynamically instead." Some details or a reference to an explanation of how to do this would be nice. Also, shouldn't "non-GPL compatible" be plain "non-GPL"? 7. I may very well be wrong, but as far as I have been able to tell, the ghc executable itself that is distributed (/Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.1.20090314/ghc) contains GMP, statically linked. For example: thorkilnaur$ DYLD_PRINT_LIBRARIES=YES /usr/bin/ghc --version thorkilnaur$ where I fail to observe anything that seems to relate to GMP. This is in contrast to the corresponding information for an earlier GHC installation thorkilnaur$ DYLD_PRINT_LIBRARIES=YES ghc --version thorkilnaur$ where one observes the presence of "dyld: loaded: /opt/local/lib/libgmp.3.dylib" that loads the separately installed dynamic GMP library. I am no expert in these matters, but this seems to activate requirement d) 0) under section "4. Combined Works" of the LGPL "GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007" (http://www.fsf.org/licensing/licenses/lgpl.html) which talks about providing material and giving instructions about how to re-link with a new version of the library and all that. If this material and the instructions are present in the installation package, I have failed to notice it. Alternatively, if the ghc executable links to GMP dynamically, requirement d) 1) of the LGPL comes into effect and that talks about a "mechanism ...that ... uses at run time a copy of the Library already present on the user's computer system". In the latter case, I would expect a mentioning of this requirement of a separate GMP installation and I have not seen such a requirement mentioned. 8. I can copy and paste the text of the License screen (without the header), excellent. (I can also Print and Save, I haven't tried that.) 9. I cannot copy and paste the text or the header of the Installation Type screen, the one that says "This will take 448 MB of space on your computer. Click Install to perform a standard installation of this software for all users of this computer." 10. On the Summary screen, I am told to find additional documentation at "/usr/share/doc/ghc/index.html". Should that, perhaps, be "file:///usr/share/doc/ghc/index.html" or something else, that more directly indicates how to access this documentation? And also mention the use of a browser? 11. And there is an uninstaller, excellent. Not least because reading that allows me to figure out where (the author of the uninstaller believes) things are installed. I didn't check before installing, but certainly, running the uninstaller increased the available space on the disk by about 500 MBytes, the expected amount. 12. What happens if I have a GHC installed already? To check this, I tried running the installer twice, without uninstalling in between. I didn't notice any difference between the first and second install. So I guess that the first installation was simply being overwritten. I realise that the /Library/Framework conventions allow multiple versions of the same thing to be installed. But the way the GHC package is supposed to be accessed is via symbolic links in /usr/bin (and elsewhere?) and these links are surely being overwritten. If there is a mechanism for changing between versions, I haven't noticed it. 13. Looking inside /usr/share/doc/ghc, I find LICENSE, but this is not the same as the text of the License screen. 14. I also find /usr/share/doc/ghc/docbook-cheat-sheet which could be left out without doing much harm, as far as I can tell. 15. I didn't run the testsuite for the Intel Mac installer. Then we are getting to the source distribution (ghc-6.10.1.20090314-src-extralibs.tar.bz2, ghc-6.10.1.20090314-src.tar.bz2 and also the testsuite-6.10.1.20090314.tar.gz). I tried that on a FreeBSD and also a PPC Mac OS X. First comes
$ uname -a FreeBSD tn12.thorkilnaur.dk 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 10:40:27 UTC 2007 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 $ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.10.1
16. The build, using ./configure + make, went fine. Running the tests ran into the issue described as http://hackage.haskell.org/trac/ghc/ticket/3106. Using the proposed fix provided by kgardas (my own proposed fix wasn't ready until later), the testsuite (make stage=2) ended with this summary:
OVERALL SUMMARY for test run started at Tue Mar 17 14:03:34 CET 2009 2334 total tests, which gave rise to 12487 test cases, of which 0 caused framework failures 2460 were skipped
9680 expected passes 262 expected failures 15 unexpected passes 70 unexpected failures
Unexpected passes: galois_raytrace(hpc,optasm,profasm,threaded2,profthreaded) getEnvironment01 (normal,optc,hpc,optasm,profc,profasm,ghci,threaded1,threaded2,profthreaded)
Unexpected failures: apirecomp001(normal) barton-mangler-bug(hpc,profc)
bits(normal,optc,hpc,optasm,profc,profasm,ghci,threaded1,threaded2,profthreaded)
break017(ghci) cabal01(normal) concprog001(ghci) derefnull(profc,profthreaded) divbyzero(profc,profthreaded)
genUpTo(normal,optc,hpc,optasm,profc,profasm,ghci,threaded1,threaded2,profthreaded)
hpc_raytrace(profc) joao-circular(profc) length001(optc,hpc,optasm,profc,profasm,threaded2,profthreaded) num009 (normal,optc,hpc,optasm,profc,profasm,ghci,threaded1,threaded2,profthreaded) num012 (normal,optc,hpc,optasm,profc,profasm,ghci,threaded1,threaded2,profthreaded) process007 (normal,optc,hpc,optasm,profc,profasm,ghci,threaded1,threaded2,profthreaded) seward-space-leak(ghci)
Details may be found at: thorkilnaur.dk/~tn/test/GHC/release/GHC-6.10.2-rc1/ghc-6.10.1.20090314-freebsd.tar.gz Second comes
$ uname -a Darwin thorkil-naurs-mac-mini.local 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24 17:39:01 PST 2008; root:xnu-1228.9.59~1/RELEASE_PPC Power Macintosh $ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.6.1
17. Again, building with ./configure + make went fine. Test summary (make stage=2):
OVERALL SUMMARY for test run started at Tue Mar 17 08:48:51 CET 2009 2334 total tests, which gave rise to 12487 test cases, of which 0 caused framework failures 2453 were skipped
9726 expected passes 254 expected failures 0 unexpected passes 54 unexpected failures
Unexpected failures: 2469(ghci) apirecomp001(normal) barton-mangler-bug(profc)
bits(normal,optc,hpc,optasm,profc,profasm,ghci,threaded1,threaded2,profthreaded)
break017(ghci) derefnull(profc,profthreaded)
divbyzero(normal,optc,hpc,optasm,profc,profasm,ghci,threaded1,threaded2,profthreaded)
ffi009(ghci) galois_raytrace(optc,profc)
genUpTo(normal,optc,hpc,optasm,profc,profasm,ghci,threaded1,threaded2,profthreaded)
hpc_raytrace(profc) joao-circular(profc) length001(optc,hpc,optasm,profc,profasm,threaded2,profthreaded) seward-space-leak(ghci) signals002(ghci) signals004(ghci,threaded1,threaded2,profthreaded)
Details at: thorkilnaur.dk/~tn/test/GHC/release/GHC-6.10.2-rc1/ghc-6.10.1.20090314-ppc-macosx.tar.gz Best regards Thorkil

On Wed, Mar 18, 2009 at 12:35:01PM +0100, Thorkil Naur wrote:
I have tried the Intel Mac installer and the source package on both FreeBSD and PPC Mac OS X. Some comments follow
Thanks!
1. An important property of such installers is that you are told, right from the start, that all the information you are presented with during the installation process can be accessed at any time, after completion of the installation, and you are told how. In case of GHC, something like a reference to a suitable spot, given as part of the output from ghc --help. I don't see any trace of such a facility on the introduction screen. (I know that other installers don't do this either, which is part of the reason why I try to avoid them.)
I didn't follow that; can you say exactly what text you want where, please?
2. The introduction screen says "This package must be installed on the system volume" which seems to imply that there is some kind of choice involved at a later stage. But I don't recall having to perform any choice that related to this. So perhaps this should be "This package will be installed on the system volume" instead.
Good point, done.
3. I can copy and paste the text of the introduction screen, excellent. I cannot copy and paste the header.
I don't think there's anything we can do about this.
4. On the License screen, GMP is denoted "GNU MP Bignum Library" in two places. I suggest using "GNU Multiple Precision Arithmetic Library" (from http://gmplib.org/) instead.
The title of that page is "The GNU MP Bignum Library", and the docs seem to be mostly consistent in calling it the "GNU MP Library", so I'm going to leave it as it is unless there's consensus for a change.
5. On the License screen, replace "licence" by "license", twice.
Thanks, changed to make it consistent.
6. The License screen explains "that by default the GMP will be statically linked into any binary produced by GHC. Software with a non-GPL compatible licence [sic] will have to ensure that the conditions of the LGPL are met; for example, by forcing GMP to link dynamically instead." Some details or a reference to an explanation of how to do this would be nice.
I don't think we want details in the installer, but we should have something in the docs somewhere.
Also, shouldn't "non-GPL compatible" be plain "non-GPL"?
No, I believe (IANAL etc) any license that provides the appropriate freedoms is OK.
7. I may very well be wrong, but as far as I have been able to tell, the ghc executable itself that is distributed (/Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.1.20090314/ghc) contains GMP, statically linked. For example:
thorkil-naurs-intel-mac-mini:~/tn/test/GHC/release/GHC-6.10.2-rc1 thorkilnaur$ DYLD_PRINT_LIBRARIES=YES /usr/bin/ghc --version dyld: loaded: /bin/sh dyld: loaded: /usr/lib/libncurses.5.4.dylib dyld: loaded: /usr/lib/libiconv.2.dylib dyld: loaded: /usr/lib/libSystem.B.dylib dyld: loaded: /usr/lib/libgcc_s.1.dylib dyld: loaded: /usr/lib/system/libmathCommon.A.dylib dyld: loaded: /Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.1.20090314/ghc dyld: loaded: /usr/lib/libedit.2.dylib dyld: loaded: /usr/lib/libncurses.5.4.dylib dyld: loaded: /usr/lib/libSystem.B.dylib dyld: loaded: /usr/lib/libgcc_s.1.dylib dyld: loaded: /usr/lib/system/libmathCommon.A.dylib The Glorious Glasgow Haskell Compilation System, version 6.10.1.20090314 thorkil-naurs-intel-mac-mini:~/tn/test/GHC/release/GHC-6.10.2-rc1 thorkilnaur$
where I fail to observe anything that seems to relate to GMP. This is in contrast to the corresponding information for an earlier GHC installation
thorkil-naurs-intel-mac-mini:~/tn/test/GHC/release/GHC-6.10.2-rc1 thorkilnaur$ DYLD_PRINT_LIBRARIES=YES ghc --version dyld: loaded: /bin/sh dyld: loaded: /usr/lib/libncurses.5.4.dylib dyld: loaded: /usr/lib/libiconv.2.dylib dyld: loaded: /usr/lib/libSystem.B.dylib dyld: loaded: /usr/lib/libgcc_s.1.dylib dyld: loaded: /usr/lib/system/libmathCommon.A.dylib dyld: loaded: /Users/thorkilnaur/tn/install/ghc-6.8.3/lib/ghc-6.8.3/ghc-6.8.3 dyld: loaded: /opt/local/lib/libreadline.5.2.dylib dyld: loaded: /opt/local/lib/libncurses.5.dylib dyld: loaded: /usr/lib/libSystem.B.dylib dyld: loaded: /opt/local/lib/libgmp.3.dylib dyld: loaded: /usr/lib/libgcc_s.1.dylib dyld: loaded: /usr/lib/system/libmathCommon.A.dylib The Glorious Glasgow Haskell Compilation System, version 6.8.3 thorkil-naurs-intel-mac-mini:~/tn/test/GHC/release/GHC-6.10.2-rc1 thorkilnaur$
where one observes the presence of "dyld: loaded: /opt/local/lib/libgmp.3.dylib" that loads the separately installed dynamic GMP library.
Hmm, I'm note sure why that changed. Manuel, do you know?
9. I cannot copy and paste the text or the header of the Installation Type screen, the one that says "This will take 448 MB of space on your computer. Click Install to perform a standard installation of this software for all users of this computer."
That looks like it's baked into the installer generator, i.e. i don't think we can change it.
10. On the Summary screen, I am told to find additional documentation at "/usr/share/doc/ghc/index.html". Should that, perhaps, be "file:///usr/share/doc/ghc/index.html" or something else, that more directly indicates how to access this documentation? And also mention the use of a browser?
I think /usr/share/doc/ghc/index.html will work in any web browser. I've tweaked the text a bit.
12. What happens if I have a GHC installed already? To check this, I tried running the installer twice, without uninstalling in between. I didn't notice any difference between the first and second install. So I guess that the first installation was simply being overwritten.
I realise that the /Library/Framework conventions allow multiple versions of the same thing to be installed. But the way the GHC package is supposed to be accessed is via symbolic links in /usr/bin (and elsewhere?) and these links are surely being overwritten. If there is a mechanism for changing between versions, I haven't noticed it.
I don't know enough about the OS X installers to know if we can do better on this. I'll take a look at your testsuite failures separately. Thanks Ian

Hello, On Thursday 19 March 2009 18:03, Ian Lynagh wrote:
On Wed, Mar 18, 2009 at 12:35:01PM +0100, Thorkil Naur wrote: ...
1. An important property of such installers is that you are told, right from the start, that all the information you are presented with during the installation process can be accessed at any time, after completion of the installation, and you are told how. In case of GHC, something like a reference to a suitable spot, given as part of the output from ghc --help. I don't see any trace of such a facility on the introduction screen. (I know that other installers don't do this either, which is part of the reason why I try to avoid them.)
I didn't follow that; can you say exactly what text you want where, please?
The point of this item is to avoid the uneasiness that I often feel when running though such a sequence of screens, that some piece of information that I am given is not available anywhere else and that it is forever gone, once the screen that contains it has been replaced by the next in the sequence. Hence also my interest in being able to copy and paste the contents of these screens. A suggested way to reduce this uneasiness would be: 1a. Add this text to the Introduction screen: "The complete text of the installation session will be available after installation at /usr/share/doc/ghc/INSTALL_SESSION_MACOSX.txt [say]. Invoking the command 'ghc --help' in a Terminal window will mention the location of this file." So, all I have to remember now is 'ghc --help'. 1b. And, of course, now we have to produce this file INSTALL_SESSION_MACOSX.txt, somehow, and include it in the installation. I am not sure what this file should be, but let me say first that I am not thinking of an installation log or something like that, I am thinking of something that can be produced statically, as part of producing the installation package. Ideally, if the package is produced by some tool, it would be possible to extract the contents of various screens in text form and use that. Or perhaps there is some script for generating the installation package that could be used directly or with a few edits. In any case, the file should contain, in text form, whatever text is presented to the user during installation. So a list of header, contents, in the order used during installation. 1c. And 'ghc --help' should be extended to mention the INSTALL_SESSION_MACOSX.txt file. Not necessarily a trivial change, I admit, but I would consider it very useful.
...
Best regards Thorkil

I've installed a GUI application based on gtk2hs. It frequently crashes with the error: leksah: error: a C finalizer called back into Haskell. use Foreign.Concurrent.newForeignPtr for Haskell finalizers. This error did never occur with the 6.10 released version. It was verified that this happens on different machines. I've no idea how to isolate this bug. Any idea about this? Jürgen Nicklisch-Franken Ian Lynagh wrote:
We are pleased to announce the first release candidate for GHC 6.10.2:
http://www.haskell.org/ghc/dist/6.10.2-rc1/
This includes two source bundles:
ghc-6.10.1.20090314-src.tar.bz2 ghc-6.10.1.20090314-src-extralibs.tar.bz2
Only the first of these is necessary. The "extralibs" package contains various extra packages that we normally supply with GHC - unpack the extralibs tarball on top of the source tree to add them, and they will be included in the build automatically.
There are also installers for Windows (i386) and OS X (i386), and binary distributions for x86_64/Linux and i386/Linux. More may appear later.
Please test as much as possible; bugs are much cheaper if we find them before the release!
Thanks Ian, on behalf of the GHC team
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-- View this message in context: http://www.nabble.com/ANNOUNCE%3A-GHC-6.10.2-Release-Candidate-1-tp22524567p... Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com.

jutaro wrote:
I've installed a GUI application based on gtk2hs.
It frequently crashes with the error: leksah: error: a C finalizer called back into Haskell. use Foreign.Concurrent.newForeignPtr for Haskell finalizers.
This error did never occur with the 6.10 released version. It was verified that this happens on different machines. I've no idea how to isolate this bug.
This will need to be fixed in gtk2hs. Previously GHC allowed finalizers to call back into Haskell, but this was never officially supported. Now it is officially unsupported, because finalizers created via Foreign.mkForeignPtr are run directly by the garbage collector. See http://hackage.haskell.org/trac/ghc/ticket/1364 Cheers, Simon

Hello Simon, I've put a request about the issue on the gtk2hs users mailing list:
I've tried a gtk2hs app on ghc 6.10.2 release candidate. It crashes frequently and Simon (as you can read down here) assumes it is gtk2hs problem. My question is: Is this problem known to gtk2hs developers? Is it really a gtk2hs problem? How difficult is it to fix the problem? When will we have a patch to use gtk2hs with 6.10.2, is it already in the repo?
However, I'm a little surprised that a little version upgrade from 6.10.1 to 6.10.2 may break all gui apps based on gtk2hs. May it be that many more apps are affected because of this change? What's about wxhaskell e.g.? Well, maybe we have only few Haskell applications around, but usually I wouldn't expect such a dramatic effect from such a moderate upgrade. Is this fix so important to introduce it now? What does it help when it was never officially supported if it causes such troubles? Jürgen Simon Marlow-7 wrote:
jutaro wrote:
I've installed a GUI application based on gtk2hs.
It frequently crashes with the error: leksah: error: a C finalizer called back into Haskell. use Foreign.Concurrent.newForeignPtr for Haskell finalizers.
This error did never occur with the 6.10 released version. It was verified that this happens on different machines. I've no idea how to isolate this bug.
This will need to be fixed in gtk2hs. Previously GHC allowed finalizers to call back into Haskell, but this was never officially supported. Now it is officially unsupported, because finalizers created via Foreign.mkForeignPtr are run directly by the garbage collector.
See
http://hackage.haskell.org/trac/ghc/ticket/1364
Cheers, Simon _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-- View this message in context: http://www.nabble.com/ANNOUNCE%3A-GHC-6.10.2-Release-Candidate-1-tp22524567p... Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com.

We must have the gtk2hs team invovled in this discussion. They were using an undocumented feature. It may be trivial to fix. --Don jnf:
Hello Simon, I've put a request about the issue on the gtk2hs users mailing list:
I've tried a gtk2hs app on ghc 6.10.2 release candidate. It crashes frequently and Simon (as you can read down here) assumes it is gtk2hs problem. My question is: Is this problem known to gtk2hs developers? Is it really a gtk2hs problem? How difficult is it to fix the problem? When will we have a patch to use gtk2hs with 6.10.2, is it already in the repo?
However, I'm a little surprised that a little version upgrade from 6.10.1 to 6.10.2 may break all gui apps based on gtk2hs. May it be that many more apps are affected because of this change? What's about wxhaskell e.g.? Well, maybe we have only few Haskell applications around, but usually I wouldn't expect such a dramatic effect from such a moderate upgrade. Is this fix so important to introduce it now? What does it help when it was never officially supported if it causes such troubles?
Jürgen
Simon Marlow-7 wrote:
jutaro wrote:
I've installed a GUI application based on gtk2hs.
It frequently crashes with the error: leksah: error: a C finalizer called back into Haskell. use Foreign.Concurrent.newForeignPtr for Haskell finalizers.
This error did never occur with the 6.10 released version. It was verified that this happens on different machines. I've no idea how to isolate this bug.
This will need to be fixed in gtk2hs. Previously GHC allowed finalizers to call back into Haskell, but this was never officially supported. Now it is officially unsupported, because finalizers created via Foreign.mkForeignPtr are run directly by the garbage collector.
See
http://hackage.haskell.org/trac/ghc/ticket/1364
Cheers, Simon _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-- View this message in context: http://www.nabble.com/ANNOUNCE%3A-GHC-6.10.2-Release-Candidate-1-tp22524567p... Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com.
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

On Thu, 2009-03-19 at 16:34 -0700, Don Stewart wrote:
We must have the gtk2hs team invovled in this discussion. They were using an undocumented feature. It may be trivial to fix.
This will need to be fixed in gtk2hs. Previously GHC allowed finalizers to call back into Haskell, but this was never officially supported. Now it is officially unsupported, because finalizers created via Foreign.mkForeignPtr are run directly by the garbage collector.
I had a quick look but so far I cannot see where any callback into Haskell is happening. The only interesting case I've found is one finaliser which is implemented in C and uses hs_free_stable_ptr. Duncan

Hello Don, Friday, March 20, 2009, 2:34:09 AM, you wrote: the question is wider - how many other programs already used this behavior? it may be asked on main haskell list. what is the cost of reverting it back for 6.10.*?
We must have the gtk2hs team invovled in this discussion. They were using an undocumented feature. It may be trivial to fix.
--Don
jnf:
Hello Simon, I've put a request about the issue on the gtk2hs users mailing list:
I've tried a gtk2hs app on ghc 6.10.2 release candidate. It crashes frequently and Simon (as you can read down here) assumes it is gtk2hs problem. My question is: Is this problem known to gtk2hs developers? Is it really a gtk2hs problem? How difficult is it to fix the problem? When will we have a patch to use gtk2hs with 6.10.2, is it already in the repo?
However, I'm a little surprised that a little version upgrade from 6.10.1 to 6.10.2 may break all gui apps based on gtk2hs. May it be that many more apps are affected because of this change? What's about wxhaskell e.g.? Well, maybe we have only few Haskell applications around, but usually I wouldn't expect such a dramatic effect from such a moderate upgrade. Is this fix so important to introduce it now? What does it help when it was never officially supported if it causes such troubles?
Jürgen
Simon Marlow-7 wrote:
jutaro wrote:
I've installed a GUI application based on gtk2hs.
It frequently crashes with the error: leksah: error: a C finalizer called back into Haskell. use Foreign.Concurrent.newForeignPtr for Haskell finalizers.
This error did never occur with the 6.10 released version. It was verified that this happens on different machines. I've no idea how to isolate this bug.
This will need to be fixed in gtk2hs. Previously GHC allowed finalizers to call back into Haskell, but this was never officially supported. Now it is officially unsupported, because finalizers created via Foreign.mkForeignPtr are run directly by the garbage collector.
See
http://hackage.haskell.org/trac/ghc/ticket/1364
Cheers, Simon _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-- View this message in context: http://www.nabble.com/ANNOUNCE%3A-GHC-6.10.2-Release-Candidate-1-tp22524567p... Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com.
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat Ziganshin wrote:
Hello Don,
Friday, March 20, 2009, 2:34:09 AM, you wrote:
the question is wider - how many other programs already used this behavior? it may be asked on main haskell list. what is the cost of reverting it back for 6.10.*?
We could revert it, but lots of people asked for this feature (predictable finalizers), which is why we put it in 6.10.2. The fix is fiarly easy: use Foreign.Concurrent.mkForeignPtr with a foreign import. Cheers, Simon
We must have the gtk2hs team invovled in this discussion. They were using an undocumented feature. It may be trivial to fix.
--Don
jnf:
Hello Simon, I've put a request about the issue on the gtk2hs users mailing list:
I've tried a gtk2hs app on ghc 6.10.2 release candidate. It crashes frequently and Simon (as you can read down here) assumes it is gtk2hs problem. My question is: Is this problem known to gtk2hs developers? Is it really a gtk2hs problem? How difficult is it to fix the problem? When will we have a patch to use gtk2hs with 6.10.2, is it already in the repo? However, I'm a little surprised that a little version upgrade from 6.10.1 to 6.10.2 may break all gui apps based on gtk2hs. May it be that many more apps are affected because of this change? What's about wxhaskell e.g.? Well, maybe we have only few Haskell applications around, but usually I wouldn't expect such a dramatic effect from such a moderate upgrade. Is this fix so important to introduce it now? What does it help when it was never officially supported if it causes such troubles?
Jürgen
Simon Marlow-7 wrote:
jutaro wrote:
I've installed a GUI application based on gtk2hs.
It frequently crashes with the error: leksah: error: a C finalizer called back into Haskell. use Foreign.Concurrent.newForeignPtr for Haskell finalizers.
This error did never occur with the 6.10 released version. It was verified that this happens on different machines. I've no idea how to isolate this bug. This will need to be fixed in gtk2hs. Previously GHC allowed finalizers to call back into Haskell, but this was never officially supported. Now it is officially unsupported, because finalizers created via Foreign.mkForeignPtr are run directly by the garbage collector.
See
http://hackage.haskell.org/trac/ghc/ticket/1364
Cheers, Simon _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-- View this message in context: http://www.nabble.com/ANNOUNCE%3A-GHC-6.10.2-Release-Candidate-1-tp22524567p... Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com.
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

This is the first answer I got from the gtk2hs mailing list. Please consider this issue seriously. Jürgen Axel Simon wrote:
Phew,
I think we're doomed. We have many, many little methods that take a user-given function, wrap it into a foreign export wrapper which is freed by using an on-destroy callback to Haskell. These functions are most likely installed into some widgets (or other reference-counted objects) that will be eventually destroyed by the Haskell garbage collector. So, basically, we can't easily change Gtk2Hs. It will involve many modifications. I can understand that not allowing callbacks during GC is a great simplification in the runtime but it seemed to be common practice to free Stable and function pointers from within Haskell using a callback.
So, unless I'm wrong on why finalizers call back into Haskell land, then this means that Gtk2Hs is fundamentally broken for the foreseeable future.
Axel.
-- View this message in context: http://www.nabble.com/ANNOUNCE%3A-GHC-6.10.2-Release-Candidate-1-tp22524567p... Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com.

jutaro:
This is the first answer I got from the gtk2hs mailing list. Please consider this issue seriously.
Well there is a simple fix as Simon Marlow wrote,
The fix is fiarly easy: use Foreign.Concurrent.mkForeignPtr with a foreign import.
In fact, if as Axel writes, these finalisers are Haskell functions that are exported using foreign import wrapper, then using Foreign.Concurrent.mkForeignPtr is actually the *simpler* thing to do (you don't need any wrapping and exporting). Manuel
Axel Simon wrote:
Phew,
I think we're doomed. We have many, many little methods that take a user-given function, wrap it into a foreign export wrapper which is freed by using an on-destroy callback to Haskell. These functions are most likely installed into some widgets (or other reference-counted objects) that will be eventually destroyed by the Haskell garbage collector. So, basically, we can't easily change Gtk2Hs. It will involve many modifications. I can understand that not allowing callbacks during GC is a great simplification in the runtime but it seemed to be common practice to free Stable and function pointers from within Haskell using a callback.
So, unless I'm wrong on why finalizers call back into Haskell land, then this means that Gtk2Hs is fundamentally broken for the foreseeable future.
Axel.

Manuel M T Chakravarty wrote:
jutaro:
This is the first answer I got from the gtk2hs mailing list. Please consider this issue seriously.
Well there is a simple fix as Simon Marlow wrote,
The fix is fiarly easy: use Foreign.Concurrent.mkForeignPtr with a foreign import.
In fact, if as Axel writes, these finalisers are Haskell functions that are exported using foreign import wrapper, then using Foreign.Concurrent.mkForeignPtr is actually the *simpler* thing to do (you don't need any wrapping and exporting).
Right. Admittedly we hadn't realised that this would affect gtk2hs when we decided to bring this change into 6.10.2, and if we had, perhaps we would have decided to wait until 6.12.1. Patchlevel releases are not supposed to break existing working code - however in this case the code that is broken is using undocumented features. So we *could* back out the change. let's talk about whether that's the right course of action. There's a GHC meeting this afternoon, come long to #ghc on Freenode at 1600 UTC (in just under 2.5 hours). To summarise the issues: * gtk2hs is broken by this change, and possibly others. Unfortunately we can't easily find out whether code is affected, because this is a dynamic property. * gtk2hs can be fixed, but that means doing a new release etc. * the error message is pretty clear (not a crash) * there was some demand for the new feature (e.g Conal Elliot). If we back out, then these people will have to wait until 6.12.1 (~ 6 months). * backing out now will delay the GHC release. Cheers, Simon

On Thu, Mar 19, 2009 at 01:43:26PM -0700, jutaro wrote:
Is this fix so important to introduce it now? What does it help when it was never officially supported if it causes such troubles?
The reason it's now not allowed is that 6.10.2 provides guarantees about running C finalizers that 6.10.1 did not. See http://hackage.haskell.org/trac/ghc/ticket/1364 for more details. Thanks Ian
participants (14)
-
Brandon S. Allbery KF8NH
-
Bulat Ziganshin
-
Christian Maeder
-
Don Stewart
-
Duncan Coutts
-
Ian Lynagh
-
Ingmar Vanhassel
-
jutaro
-
Karel Gardas
-
Lennart Kolmodin
-
Manuel M T Chakravarty
-
Simon Marlow
-
Simon Marlow
-
Thorkil Naur