Repository navigation
ICE when nesting managed pointers to a depth of 500 #5009
Description
Activity
This specific depth may be fixed by #3695
I think the "bug" here is basically OOM, no? I mean our stacks currently have no defined upper limit on their size? (@brson?)
Tried this with haskell, with a type
data X a = X a. It appears to be able to handle both typechecking and evaluation, although it gets seriously slow and takes multiple gigs of RAM at the 1024 nesting depth. I didn't bother to measure the asymptotic nature of the growth.But, I think it'd be ok to impose an arbitrary limit on type structure depth. The hard question there would be how can we know what the depth is...
SML/NJ is actually quite fast, and can handle 8000+ nesting depth with O(1) memory consumption, although it seems to take superlinear time.
Using ghc instead of ghci appears to work for 1000+, although I have to set the
-fcontext-stackoption to much bigger than the default of 200 (i used 6400).This no longer ICEs, at least for me. Closing.
This would probably be a good candidate for a test
Actually, when compiling this with
-O, this program causes rustc to consume > 2G of ram. Even though it's a bit of an absurd test, the compiler probably shouldn't be taking up gigs of ram and this may be an indication of a deeper problem. Also, the compile time is 2 minutes.Removing the needstest tag.
@alexcrichton just said this now works. Flagging as
needstestand assigning P-low.(Also, the test now passes in part because the threshold for stack exhaustion has increased; using 2500 instead of 500 causes rustc to blow its stack.)
Note that going deeper to something like 2500
@sigils causes rustc to overflow its stack. This is somewhat reasonable perhaps...Flagged as needtest
I confirm what's been said in the previous comments
A test for this specific issue is unnecessary because managed pointers are being removed, so it would be counter-productive to start adding new tests for the feature. A new example of this issue with a non-deprecated type would be worthy of a new issue.
- added a commit that references this issue
on May 2, 2020
Hitting a recursion limit, perhaps?
Yeah, this is silly.