-
Notifications
You must be signed in to change notification settings - Fork 72
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
Using the GHC API on Mac OS X with ghci or runhaskell causes a segmentation fault #11
Comments
I'm not aware of that issue. Does the doctest test suite run flawlessly on your system? Say, the following reports no errors:
|
Btw, thx for reporting this! |
No errors were reported with runtests.sh. In my environement, compiled "Test.hs" can work well. |
BTW. My plan is to integrate doctest to test-framework-th. I have already implemented it and doctest really enpowers test-framework. I will release the package in this week. Thank you for your work on doctest! |
I think it is critical to make this work with Btw: Have you tried with doctest HEAD, or only with the latest release? |
I tested both on Linux Mac:
NG means bus error or seg fault or "Too late for parseStaticFlags: call it before newSession". I guess this bug is specific to Mac. |
I forgot to write what I did: Prelude> :m Test.DocTest |
We can forget test-framework-doctest. Let's just think about doctest. |
The "Too late for parseStaticFlags: call it before newSession" issue is a limitation of GHC (yes, GHC uses global state, see the code, if you are inclined). You can only run Maybe you are affected by GHC bug #5031/#5132. Can you try one of the minimal test cases given in the tickets? |
Thank you for your info. Due to this bug, I cannot install GHC 7.4.0 on my Mac at this moment. |
Can you verify that |
I keep this issue in mind. I will try this with GHC RC2. |
@kazu-yamamoto any new findings on that? |
Good timing. I have tried GHC 7.4.0 rc2 just before but many packages including doctest and xhtml limit version of "base" and "ghc". I was tiered to fix them and stopped this confirm job... |
@kazu-yamamoto Awesome! I saw you adapted test-framework-doctest to the latest version of Doctest. Have you tested this with runhaskell/ghci and ghc-7.4.1? |
Thank you for reminding. Now I can install all related packages. Unfortunately, runghc generated the following error: lookupSymbol failed in relocateSection (relocate external) If I use ghc to compile, the test program works well. Any thoughts? |
Yes, the library section in the cabal file probably does not list all modules. I'll fix that, and do a maintenance release. |
I will test this with GHC 7.4.1. |
@kazu-yamamoto Ok, done. Can you test with the latest version?
|
Hmm, I think it would be nice to require that version in the cabal file of |
Bravo! runghc 7.4.1 works well with doctest 0.6.0.1! |
I tested with test-framework-doctest which includes my patch exactly. |
Ok, I think we can finally close this ticket. |
Using the doctest library currently causes the tests to fail with the following message: reference: Too late for parseStaticFlags: call it before newSession There used to be an issue with that error message in an old version of ghc [1], not sure why we are triggering it again with a recent version. Regardless, the workaround is easy: use the executable version of doctest instead of the library version. [1] sol/doctest#11
If docTest is used with ghci or runghc, it causes segfault:
*Main> docTest ["../Data/RBTree.hs"] ["-i.."]
zsh: segmentation fault ghci Test2.hs
This is very inconvenient because "runghc Test.hs", for exmaple causes segfault, where
Test.hs contains test-framework-doctest.
Are there any work around on this?
I'm using GHC 7.0.4 on Mac.
The text was updated successfully, but these errors were encountered: