-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
4.0.0: StackOverflowError in error-prone #12926
Comments
Do you have a repro? It looks like it's just running out of stack. Does setting a higher stack size make a difference, e.g.:
|
bazel build :b
|
Thanks, taking a close look I see that immutables is generating a class that completes a cyclic type hierarchy:
This is an interaction between immutables and https://github.com/google/turbine's implementation of annotation processing. This logic is relying on the |
As a workaround import org.immutables.value.Value;
@Value.Style(
typeBuilder = "ABuilderImpl",
builderVisibility = Value.Style.BuilderVisibility.PUBLIC,
implementationNestedInBuilder = true
)
@Value.Immutable
interface A {
static Builder builder() {
return new Builder();
}
class Builder extends ABuilderImpl {
}
} seems to work on the repro case, class hierarchy is different, but may work well. For the original setup, what looks like a correct place to implement a fix
|
This is the thing that actually changed in Bazel--as of 10ffddb Bazel uses a different annotation processing implementation by default (https://github.com/google/turbine). The way errors are modeled in the annotation processing API isn't very well specified, but I think improving turbine here is a good resolution, I don't see anything in particular immutables should be doing differently. Ideally javac would detect the cycle and not crash, but there are a lot of ways that invalid class files can cause problems for javac, so I'm not sure it's worth trying to handle that better. The mention of Error Prone in the stack trace is a red herring, it just catches top-level exceptions and tries to log additional information. |
When creating error types to model invalid elements during annotation processing, include all simple names present in source for qualified names, instead of just the last one. This fixes bazelbuild/bazel#12926 PiperOrigin-RevId: 355065427
When creating error types to model invalid elements during annotation processing, include all simple names present in source for qualified names, instead of just the last one. This fixes bazelbuild/bazel#12926 PiperOrigin-RevId: 355249091
Built at google/turbine@1bbb136 Fixes bazelbuild#12926
Built at google/turbine@1bbb136 Fixes #12926 Partial commit for third_party/*, see #12950. Signed-off-by: Philipp Wollermann <[email protected]>
Built at google/turbine@1bbb136 Fixes #12926 Partial commit for third_party/*, see #12950. Signed-off-by: Philipp Wollermann <[email protected]>
Description of the problem / feature request:
Trying out bazel 4.0.0, with
--javabase=@bazel_tools//tools/jdk:remote_jdk11 --java_toolchain=@bazel_tools//tools/jdk:toolchain_java11
and hit a bug in error-prone 2.4.0 (bazel 3.3.1 has 2.3.2 I think, and it works)Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Haven't yet reproduced in a small setup but likely is triggered by code generated by https://github.com/immutables/immutables 2.8.8
Any other information, logs, or outputs that you want to share?
Most recent error_prone is 2.5.1, but haven't tested if it'd fix the issue https://github.com/google/error-prone/releases
Not sure if there's an easy way to upgrade error_prone version without the need to rebuild bazel itself
Bump of error_prone commit 239b2aa
Some issues with earlies attempts of upgrade 2.3.2->2.3.3 #9286
The text was updated successfully, but these errors were encountered: