-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
nightly 1.71-2023-04-17 overflows the recursion limit #110475
Comments
Have you tried raising the recursion limit like it suggests? We don't have stability guarantees for the recursion limit. If that doesn't help, please link to an exact version of your crate so it's possible to reproduce the error. |
The lack of a span on this error suggests that this is due to an overflow during codegen. Given the I'll bisect this I guess. Seems to reproduce on |
Well bisection came back with garbage: searched nightlies: from nightly-2023-04-01 to nightly-2023-04-18 bisected with cargo-bisect-rustc v0.6.5Host triple: aarch64-unknown-linux-gnu cargo bisect-rustc --start 2023-04-01 --end 2023-04-18 -- build --release --all-features Though given the regression happened a few days ago, I'm suspicious of #109247. The overflow is actually happening in the MIR inliner. Here's a snippet of the call stack of the error:
|
From preliminary investigation, |
@cjgillot they do not, until some recent nightly compilers, in which they now start emitting errors. |
@cjgillot sorry, I am incorrect. Callers do emit errors. Previously this would happen later in the compile stage, and provide line number information, and only occur if they actually try to use the function. Now it occurs earlier, with no line number information, and regardless of whether the function is actually used. |
I think we're hitting this on georust/geo#1010, but I can't actually reproduce it. Could it only fire intermittently or for some specific platforms? The problematic code is https://github.com/georust/geo/blob/0.24.1/geo/src/algorithm/map_coords.rs#L850. |
Looks like this bug has hit stable now :(. |
Newly-released rustc 1.71 no longer compiles our rust-miniscript dependency. Patch rust-miniscript, then elements-miniscript, then this, to hack around it.
Newly-released rustc 1.71 no longer compiles our rust-miniscript dependency. Patch rust-miniscript, then elements-miniscript, then this, to hack around it.
b608ec1 Cargo.toml: patch for rust-lang/rust#110475 (Andrew Poelstra) ab184db human_encoding: use ErrorSet when finalizing NamedConstructNode (Andrew Poelstra) 70b989a human_encoding: introduce Error and ErrorSet (Andrew Poelstra) 9d379ce human_encoding: introduce NamedConstructNode (Andrew Poelstra) 64c6ea4 human_encoding: change assertl/assertr syntax (Andrew Poelstra) 2252354 types: replace 1 + A with A? in display (Andrew Poelstra) 8193fd2 types: don't put parentheses around display of outermost type (Andrew Poelstra) 2adb0a8 node: some more utility methods on Inner (Andrew Poelstra) a516651 clippy: fix some new lints (Andrew Poelstra) 07ac274 analysis: feature-gate an import (Andrew Poelstra) Pull request description: After/during review of #152 we decided to change the syntax in a couple ways: * We introduced the `?` syntax in types where `A?` is shorthand for `1 + A` * We changed the CMR syntax from `#expr` to `#{expr}` * We added a new `#<64 hex chars>` format for directly specifying CMRs without giving an expression This PR also includes some cleanups and new types and utility methods that will be used by the parser. Let me know if you want me to move any to the next PR, or if you'd like me to pull the parser into this one. Fixes #157 ACKs for top commit: uncomputable: ACK b608ec1 Feel free to address the nit. Tree-SHA512: 91488059ab119d724cda84065256fd7941f09f39ee91b6f7b7453bc65a8b201164059a0cfc456a091916d920f2a1757caf9e2d613ec11cf5c607ebb6a620cac7
I'm new to rust, having this error, but also am worried my amatuerity? will probably mean anything I could add here would be more noise than signal. :D So forgive me if that is the case here. I wanted to contribute my path to duplicating this. My project uses SurrealDB which depends on the geo library mentioned above. When I compile locally on my windows machine there is no issue. However, when I use the official rust docker image https://hub.docker.com/_/rust which builds using the When I modify the docker to do a normal |
@NotGovernor I'm not familiar with SurrealDB, but the problematic code was removed in geo 0.25.0, and SurrealDB bumped that dependency from 0.25.0 to 0.25.1 about three weeks ago, so you shouldn't be seeing this. I suggest checking which version you're using. cargo tree might help. |
See rust-lang/rust#110475. I can't update my upstream rust-miniscript fork until rust-bitcoin/rust-miniscript#566 is merged.
I'm hitting this bug too with rust-miniscript. It's really strange error because it only happens if you have too many dependencies in your cargo crate. I can only reproduce this in a large repo with many dependencies / a lot of code, in a smaller isolated project with just miniscript and a few other dependencies, the issue doesn't happen, but it does in a multi-module crate which is really frustrating. |
@sergei-pq which version of rust-miniscript are you using? We have a patch but we haven't backported it to every version. |
@apoelstra I observed this behavior on 9.0.1 being pulled in from
This actually works for hotfixing BDK (or it at least fixes the issue since bdk is miniscript ^9 and seems to not break the code yet. This fix worked on my most recent issue with miniscript -- although I'm not certain it's entirely resolved. If I can't get it working I'm likely going to have to fork bdk and upgrade that directly -- or use the backported patch strategy. |
Previously used version 0.23 was carrying a [recursive declaration issue][1] [1]: rust-lang/rust#110475 Signed-off-by: Nicolas Buffon <[email protected]>
6c9e8ab ci: pin some more deps for 1.48.0 (Andrew Poelstra) f551774 patch elements-miniscript for rustc recursion bug (Andrew Poelstra) Pull request description: cc rust-lang/rust#110475 Top commit has no ACKs. Tree-SHA512: 499db6a81ca0b48e921aac458b1d6e55022ac7c161e48a0b3e4ffeb97abb1983a7b25e7bb1cce459b568c0b9ee97b3b62321ce8e1aa2ac6e4edc56ad83302d99
@apoelstra would be great if it was backported for v9.x |
I have an open PR rust-bitcoin/rust-miniscript#566 |
Previously used version 0.23 was carrying a [recursive declaration issue][1] Fixed since geo 0.25 as mentioned in [related issue][2] [1]: rust-lang/rust#110475 [2]: georust/geo#1010 Signed-off-by: Nicolas Buffon <[email protected]>
Done. |
@ActuallyHappening I'm trying to reproduce your error. Using the latest rustc 1.73.0-nightly (0768872 2023-08-17) I can compile the project |
Your right, after some investigation my git dependancy on [dependencies.surrealdb]
git = "https://github.com/surrealdb/surrealdb.git"
tag = "v1.0.0-beta.9"
optional = true which lead to this dependancy being included (from surreal/lib/Cargo.toml in commit c3773b2e): geo = { version = "0.24.1", features = ["use-serde"] } My full project failed to compile (using I haven't completely solved this issue for my specific use case, but changing my Cargo.toml section to this seems to help: # upgrading surrealdb so that it uses newer geo version
[dependencies.surrealdb]
git = "https://github.com/surrealdb/surrealdb.git"
# tag = "v1.0.0-beta.9"
branch = "main"
optional = true
# [patch.crates-io.geo]
# git = "https://github.com/georust/geo.git"
# branch = "main" |
Can this issue can be closed since the thanks for a feedback cc @benthecarman @ActuallyHappening @rustbot label -I-prioritize |
Probably everybody hitting this bug (the It theoretically represents a regression though, in that you can write Rust code which compiles before 1.71 and does not compile after. For my part (as a maintainer of |
The rust-lang/rust#110475 issue referenced is no longer a problem since the `geo` crate has been updated in SurrealDB. However, the change in default Rust version in the image builder implemented in #11681 breaks fuzzing due to SurrealDB now requiring Rust 1.77 after surrealdb/surrealdb#3591, leading to a bump in the MSRV in surrealdb/surrealdb#3778. I have replaced the obsolete `--cfg uuid_unstable` for the generic `--cfg surrealdb_unstable`, which will allow fuzzing any features still deemed unstable in SurrealDB including the new experimental parser.
The Concrete impl used a weird complier gitch `let pred = |x| pred(x)` to avoid an infinite recursion bug (which in turn triggered a compiler bug that they didn't fix even though I filed it a DAY AFTER IT WAS INTRODUCED ON NIGHTLY and instead they waited 3 months and released it on stable forcing me to backport a workaround to a gazillion versions of rust-miniscript). The bug was rust-lang/rust#110475 BTW, just to make sure this commit triggers another notification on that issue. Clippy doesn't like this. Clippy is obviously wrong but rather than having this stupid fight again just switch to a different idiom. Meanwhile, the Semantic impl of ForEachKey panics iff any keys are present, regardless of the closure passed to it. This is funny but completely useless and we should just remove it.
The Concrete impl used a weird complier gitch `let pred = |x| pred(x)` to avoid an infinite recursion bug (which in turn triggered a compiler bug that they didn't fix even though I filed it a DAY AFTER IT WAS INTRODUCED ON NIGHTLY and instead they waited 3 months and released it on stable forcing me to backport a workaround to a gazillion versions of rust-miniscript). The bug was rust-lang/rust#110475 BTW, just to make sure this commit triggers another notification on that issue. Clippy doesn't like this. Clippy is obviously wrong but rather than having this stupid fight again just switch to a different idiom. Meanwhile, the Semantic impl of ForEachKey panics iff any keys are present, regardless of the closure passed to it. This is funny but completely useless and we should just remove it.
I now get this error from one of my dependent crates (rust-miniscript) when compiling with the
--release
flagThe text was updated successfully, but these errors were encountered: