-
Notifications
You must be signed in to change notification settings - Fork 20
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
Tests hang with ghc 7.10 #148
Comments
My last comment was that it hangs inside GHC.typecheckModule. I have annotated that part of the GHC source, and I can now say that it hangs at the following line inside that function:
I have no idea what any of those things (except liftIO) mean. |
The last commit which touched this line says "Fix GHC API with respect to safe haskell", so I guess this is the code which determines whether the code is "inferred safe", "trusted", etc. |
What? It didn't hang at the same line inside |
Nope, same line three times in a row. Did I misread the line number the first time? Or did the IO commands I added to pinpoint this line somehow change the behaviour? Recompiling GHC takes forever, so I'm not really inclined to revert my changes to see if the number reverts from 860 to 868. I'm using the 7.10.2 release candidate, because it has a nice |
I just timed it and "forever" is actually just 16 minutes. It's not that bad. |
Yup, looks like I simply misread the number. I reverted my changes, and the hang is still at 860:
|
This makes no sense.
|
No, that would be silly. It doesn't hang anymore? |
Oh! |
Indeed, in hangs inside
I almost looked at the wrong line again, and now I know why: I'm debugging by inserting print statements, but since I don't know what's the equivalent of |
|
On the second of four warnings. |
|
This message gets printed over and over (see #142). The hang is at the first occurrence of this particular message. The previous very similar message, about an earlier line, does not cause any hang:
|
The hang is deterministic, in the sense that running the tests multiple times causes a hang at the exact same line, but it's also unstable, in the sense that the extra test calls to |
I can reproduce the problem by running
That computation eventually calls Next, I plan to add more loops between |
The very first loop at the beginning of |
Yes I can. Next, how much of doctest's setup can I skip while still reproducing the hang? |
How much can I remove? All of it. |
Very strange. The hang disappeared! I can't reproduce it at all. I was happy to have such a minimal program which could reliably reproduce the hang, so I decided to write down the steps to reproduce it from scratch. To test those steps, I scrapped and re-created my sandbox... and now I can no longer reproduce the bug. I can't even compile the test suite: in order to follow the steps from TravisCI as closely as possible, I was using cabal-1.18, but when I clear the sandbox and try to build with that version and GHC 7.10.1, I encountered an error I have never seen before:
Googling this error tells me that I should upgrade to a more recent version of cabal. When I do, the hang no longer occurs. This isn't entirely surprising: the hang was only occurring when using cabal to run the tests, so it makes sense that using a different version of cabal would hide the problem. But since the hang is occurring inside the latest version of GHC, not inside an old version of cabal, I don't think the conclusion is simply that cabal was broken in 1.18, is fixed in 1.22, and we don't need to worry anymore. |
The hang is real: Travis CI hangs on the tests when using GHC head. But I can no longer reproduce it on my machine (why??), so I'll have to postpone working on it. |
I can reproduce the problem on my linux VM, by following all the steps from the Travis CI including the
|
I'd like to test with other versions of cabal and ghc, but:
I think the latter error is because of my custom |
With the Simple setup method, cabal-1.18 and ghc-head, the |
That's weird: I pass the path of the main source and autogenerated files to doctest, but not the path of the runtime. How did that ever work before? I guess the runtime was always already installed for the tests? Come to think of it, the runtime does need to be installed in order for the tests to succeed, that's the entire point of the custom |
Adding an extra step |
Nope, works fine with ghc-7.10, only fails with ghc-head. We'll cross that bridge when we get there. I'll disable that part of the test for the purpose of investigating this bug. |
So, with ghc-head (7.11.20150717) and cabal-1.18.1.3, the tests pass when I use the simple build type, but fail when I use the custom build type. What is different in the two cases? Calling
That's clearly related to the error when I try to use ghc 7.10! That's weird though, the error message clearly says that ghc no longer supports it. Maybe support was reintroduced in head?
Well that looks doubly useless.
Why would the simple and custom methods differ on this? Are they using a different version of the Cabal library behind the scenes again?
Another indication of a different version of Cabal, or a simple consequence of the
Interestingly, both are using
Still useless.
Straightforward consequence of the
Hmm, the fact that |
Since running |
Aha! Now, which input did it expect? Does |
What's especially weird is that running the With |
I guess I'll have to modify the source of cabal itself. But cabal-1.18 doesn't build with ghc-head. Which means that using cabal-1.18 to build with ghc-head was probably a stretch already, but whatever anticated practices cabal-1.18 used, it shouldn't cause ghc-head to hang, should it? |
I'm trying to modify cabal, but it's tricky: the part I want to modify is actually in the Cabal library, not in the cabal-install executable, and even though I have linked cabal-install with my modified Cabal library, running |
Before I get too far off track, here's how I reproduce the problem using a custom cabal-install and a custom Cabal library (which doesn't get used, but whatever). Earlier I got into a state from which I couldn't reproduce the problem anymore, and I don't want to make that mistake again.
|
I think the reason why my custom Cabal library isn't being used by |
Yes, via This worked! But it did not hang. Why not? |
Continuing from #147.
The text was updated successfully, but these errors were encountered: