Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segfault with Data.BitSet.Dynamic #12

Open
jwaldmann opened this issue Jan 28, 2014 · 3 comments
Open

segfault with Data.BitSet.Dynamic #12

jwaldmann opened this issue Jan 28, 2014 · 3 comments
Assignees

Comments

@jwaldmann
Copy link

with ghc-7.6.3, bitset-1.4.7 (current from hackage), on x86_64 fedora, in ghci I get this:

import Data.BitSet.Dynamic
fromList [11,63]

Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package bitset-1.4.7 ... linking ... done.
fromList [3,7,8,10,11,14,15,17,20,21,22,25,28,29,30,33,37,40,41,42,43,44,45,46,63]
ghc: internal error: evacuate: strange closure type 1103044792
    (GHC version 7.6.3 for x86_64_unknown_linux)

import Data.BitSet.Dynamic
fromList [1,64]

Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package bitset-1.4.7 ... linking ... done.
fromList [3,5,8,9,13,15,18,19,20,36,37,38,39,40,41,42,43,44,45,46,64]
Segmentation fault (core dumped)

it seems to work ok with Data.BitSet.Generic; so it would depend on a difference between Integer and FasterInteger?

@superbobry superbobry self-assigned this Feb 9, 2014
@superbobry
Copy link
Member

Thanks for reporting this, but unfortunately I was unable to reproduce the bug on OS X, @knsd can you try a Linux machine?

@jwaldmann
Copy link
Author

I was checking this on two other machines (all x86_64) and the behaviour seems to depend on libgmp version. It works fine with libgmp.so.3.5.2 (debian 6), libgmp.so.10.1.1 (fedora 19),
but breaks (as reported above) with libgmp.so.10.1.2 (fedora 20). All of this with ghc-7.6.3 compiled from source.

@superbobry
Copy link
Member

As far as I know GHC uses its own patched libgmp version. This also should be the version GHC links cbits/gmp-extras.cmm with, due to:

import "integer-gmp" __gmpz_init_set;
import "integer-gmp" __gmpz_popcount;
import "integer-gmp" __gmpz_tstbit;
import "integer-gmp" __gmpz_setbit;
import "integer-gmp" __gmpz_clrbit;

But since you have the issue with a specific system-wide libgmp version, I've tried reproducing it on the latest Ubuntu:

$ cat /etc/lsb-release                        
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.10
DISTRIB_CODENAME=saucy
DISTRIB_DESCRIPTION="Ubuntu 13.10"
$ sudo aptitude show libgmp-dev | grep Version
Version: 2:5.1.2+dfsg-2ubuntu1

but everything worked as expected. Are you sure it's libgmp which causes the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants