Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upcompilation of unicode_segmentation crate hangs on nightly #32278
Comments
This comment has been minimized.
This comment has been minimized.
|
I unfortunately can't reproduce this on OSX:
Does this happen reproducibly for you in the repo on a normal |
This comment has been minimized.
This comment has been minimized.
|
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 comment has been minimized.
This comment has been minimized.
|
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? |
This comment has been minimized.
This comment has been minimized.
|
Also, nominating as this seems like a pretty serious regression |
This comment has been minimized.
This comment has been minimized.
|
also cc @nikomatsakis, region inference infinite loop maybe? |
This comment has been minimized.
This comment has been minimized.
|
FYI, this also causes rustdoc to hang. |
This comment has been minimized.
This comment has been minimized.
|
hmm I have yet to be able to reproduce this :( |
This comment has been minimized.
This comment has been minimized.
|
ah, never mind. |
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
|
Indeed just compiling this file as an rlib causes the problem. |
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis I tried avoiding quadratic behavior, assuming O(1) LUB - is it even hitting the loops of preceding expressions in |
This comment has been minimized.
This comment has been minimized.
|
@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 |
This comment has been minimized.
This comment has been minimized.
|
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. |
nikomatsakis
closed this
Mar 16, 2016
nikomatsakis
reopened this
Mar 16, 2016
This comment has been minimized.
This comment has been minimized.
|
/me closed by accident |
This comment has been minimized.
This comment has been minimized.
|
(Yet another reason to pursue splitting typeck/regionck...) |
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis Right, just trying to make sure it's not hitting the worst possible case. |
This comment has been minimized.
This comment has been minimized.
|
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. |
nikomatsakis
self-assigned this
Mar 17, 2016
This comment has been minimized.
This comment has been minimized.
|
triage: P-high |
djudd commentedMar 16, 2016
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.