Re: ghc vs gmp

2019-10-02 Thread Matthias Kilian
Hi,

On Tue, Oct 01, 2019 at 06:56:17PM -0700, Greg Steuck wrote:
> On Mon, Sep 23, 2019 at 2:40 PM Matthias Kilian  
> wrote:
> > Instead of adding more madness (like a patch to diff in this case),
> > I compared the bundled gmp sources against the upstream used by
> > devel/gmp (which are identical except for the remoced coeumentation
> > in ghc's version) and hat a look at at the patch to gmp contained
> > in the ghc sources (libraries/integer-gmp/gmp/gmpsrc.patch, which
> > only adds -fPIC for some systems).
> 
> I was browsing the old ghc patches and we switched from the ports to
> the bundled gmp some 7 years ago
> https://github.com/openbsd/ports/commit/47aa23534d85b9287ed8fe026c98a13d9e2599e4

Back then, the bundled libgmp was patched for real. Which isn't the case
any longer. So those problems really shouldn't appear again.

> I couldn't get my "large Fibonacci numbers" to crash anything. I'm
> curious if anybody has a
> bottled testcase to try or knows how to modify the one below to stress
> things more.

The problem back in 2012 was that for some people (including bulk
builders), ghc crashed regularly -- for bulk builders as often as
every 2nd or 3rd run. For others (including me) it took many dozens
of builds to run into the crash.  So: no, there's no obvious test
case for it.

Ciao,
Kili



ghc vs gmp

2019-10-01 Thread Greg Steuck
Hi Matthias,

On Mon, Sep 23, 2019 at 2:40 PM Matthias Kilian  wrote:
> Instead of adding more madness (like a patch to diff in this case),
> I compared the bundled gmp sources against the upstream used by
> devel/gmp (which are identical except for the remoced coeumentation
> in ghc's version) and hat a look at at the patch to gmp contained
> in the ghc sources (libraries/integer-gmp/gmp/gmpsrc.patch, which
> only adds -fPIC for some systems).

I was browsing the old ghc patches and we switched from the ports to
the bundled gmp some 7 years ago
https://github.com/openbsd/ports/commit/47aa23534d85b9287ed8fe026c98a13d9e2599e4

I couldn't get my "large Fibonacci numbers" to crash anything. I'm
curious if anybody has a
bottled testcase to try or knows how to modify the one below to stress
things more.

{-# Language BangPatterns #-}
main = mapM_ (putStrLn . take 20 . show . fib) [0..]

fib :: Integer -> Integer
fib n = fibs 1 1 n
  where fibs !a !b !n
 | n == 0 = a
 | otherwise = fibs b (a+b) (n-1)

Thanks
Greg