-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
compilation of unicode_segmentation crate hangs on nightly #32278
Comments
I unfortunately can't reproduce this on OSX:
Does this happen reproducibly for you in the repo on a normal |
Hmm, nope. I think it's not be I ran I assumed because a hang also happens on Travis that it's not something local to my environment, but might have jumped the gun in assigning blame. FWIW, everything compiles fine on older nightlies, e.g. Feb 14. |
This appears to be pathological behavior in the Some suspicious PRs merged during that time were:
After a few seconds the offending backtrace looks like:
@eddyb, @jseyfried, thoughts? |
Also, nominating as this seems like a pretty serious regression |
also cc @nikomatsakis, region inference infinite loop maybe? |
FYI, this also causes rustdoc to hang. |
hmm I have yet to be able to reproduce this :( |
ah, never mind. |
I think what is happening is some kind of poor interaction with the new coercion logic that @eddyb introduced. In particular, we are spending a lot of energy creating least-upper-bounds where likely we never did before, and creating a ton of region variables -- the logic around LUB is not particularly smart right now. This leads to a problem checking the large |
Indeed just compiling this file as an rlib causes the problem. |
@nikomatsakis I tried avoiding quadratic behavior, assuming O(1) LUB - is it even hitting the loops of preceding expressions in |
@eddyb the problem is that LUB creates a ton of region variables, I think. we could surely solve this particular case by just some simple checks (e.g., when we enter coerce, we already know that the two types are equal, so even |
In particular, each call to LUB creates a fresh region variable, at least. I'm not actually clear on why that scales up SO badly, perhaps region-inference just needs to be rewritten (that wouldn't surprise me, the cost is largely untouched for quite some time). I've been wanting to rewrite it anyway but mostly because it's model is outdated... but in any case here it seems like we should not generate these constraints to begin with. |
/me closed by accident |
(Yet another reason to pursue splitting typeck/regionck...) |
@nikomatsakis Right, just trying to make sure it's not hitting the worst possible case. |
OK, I think I've got this covered. Hopefully I'll have a patch up tomorrow, don't think I have time to finish it tonight. |
triage: P-high |
https://github.com/unicode-rs/unicode-segmentation
Both on Travis.yml (seemingly) and on a local box. Locally, strace gives:
Running Ubuntu 14.04 trusty.
The text was updated successfully, but these errors were encountered: