segfault with bitset package + ghci + OS X?

6 views
Skip to first unread message

Erik Rantapaa

unread,
Aug 31, 2015, 9:51:55 AM8/31/15
to HaskellMN

Hi fellow MN Haskellers,

I'd like to find out if a bug I found is reproducible on other people's Macs. It has to do with the `bitset` package, but it only seems to manifest itself when running under ghci.

I've got a test case prepared in this repo:


Just follow the instructions in the README. It uses `stack` with the resolver set to lts-2.15. You can also just build it normally if you install `bitset-1.4.8` and use ghc 7.8.4. Unfortunately `bitset` doesn't build with 7.10.

I'm hoping other people can duplicate the segfault - otherwise it means there probably something funky going on with my laptop.

Btw - I haven't been able to replicate the problem on a Linux box, but it would be helpful if you could try it out on whatever other Haskell platforms you have.

Thanks!
Erik

Kyle Marek-Spartz

unread,
Aug 31, 2015, 1:35:31 PM8/31/15
to Erik Rantapaa, HaskellMN
Mac OS X 10.10.5
Stack: Version 0.1.2.0, Git revision
65246552936b7da4b64b38372feac903d96a8911

kmarekspartz-mbp:test-bitset kmarekspartz$ stack ghci
Configuring GHCi with the following packages: test-bits
GHCi, version 7.8.4: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.5.0.0 ... linking ... done.
Loading package deepseq-1.3.0.2 ... linking ... done.
Loading package bitset-1.4.8 ... linking ... done.
Loading package test-bits-0.1.0.0 ... linking ... done.
[1 of 1] Compiling Road (
/Users/kmarekspartz/src/other/test-bitset/src/Road.hs, interpreted )
Ok, modules loaded: Road.
*Road> test
X
*Road> Segmentation fault: 11

It didn't fault until after the next prompt came up. Not sure if that's
significant or not. Could be GC related? Maybe there's some C FFI
with some incorrect assumptions about what's going on on the other side.
--
Kyle Marek-Spartz

Trevor Riles

unread,
Sep 9, 2015, 11:09:27 AM9/9/15
to HaskellMN
whale:test-bitset trevor.riles$ stack ghci
* * * * * * * *
The main module to load is ambiguous. Candidates are:
Package `test-bits' component exe:test-bits-exe with main-is file: /Users/trevor.riles/tmp/test-bitset/app/Main.hs
Package `test-bits' component test:test-bits-test with main-is file: /Users/trevor.riles/tmp/test-bitset/test/Spec.hs
None will be loaded. You can specify which one to pick by:
 1) Specifying targets to stack ghci e.g. stack ghci test-bits:exe:test-bits-exe
 2) Specifying what the main is e.g. stack ghci --main-is test-bits:exe:test-bits-exe
* * * * * * * *

Configuring GHCi with the following packages: test-bits
GHCi, version 7.8.4: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.5.0.0 ... linking ... done.
Loading package deepseq-1.3.0.2 ... linking ... done.
Loading package bitset-1.4.8 ... linking ... done.
[1 of 1] Compiling Road             ( /Users/trevor.riles/tmp/test-bitset/src/Road.hs, interpreted )

Ok, modules loaded: Road.
*Road> test
X
*Road> Segmentation fault: 11
whale:test-bitset trevor.riles$
Reply all
Reply to author
Forward
0 new messages