-
Notifications
You must be signed in to change notification settings - Fork 354
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
The Checker Framework crashes when @Builder and @Singular are used together #4254
Comments
Thanks for getting in touch. I'm sorry you are having trouble. Using the version of the Checker Framework at HEAD, I ran:
and the output was:
If you can provide a way to reproduce your problem, we will take a look. Thanks! |
I upgraded to lombok-1.18.18 and this fixed the issue. Sorry I tried to reproduce the issue on commandline and I am not able to do this either for 1.18.16 or 1.18.18 I am unblocked. Please feel free to close this issue/investigate further as you see fit. Thanks. |
Thanks for investigating. I'm glad that upgrading worked around the problem. I got the same result (no crash) with You could make the problem reproducible for us by providing a complete Maven project (including the Or, you could close this issue. |
Created repo: https://github.com/RamAnvesh/checker-framework-4254 Command: |
@mernst Is this maven project (https://github.com/RamAnvesh/checker-framework-4254) sufficient to reproduce the issue? I think the issue with the command line is that though Lombok is on the classpath, it is not acting as an annotation processor and hence is not generating any bytecode. That's why the error we are getting is that which we would have got if there were no Lombok annotations in the class (no constructor), where as the issue seems to be in the generated byte code. The above maven project invokes lombok annotation processor and hence is reproducing the issue. |
I can reproduce the problem by running
Thanks for the details. |
When running the Checker Framework and Lombok together, you need to run delombok. |
I'm using the CF Gradle plugin and it's been working fine with various Lombok annotations for a long time. Just today I tried using I tried to create a minimal reproduction of the issue, but unfortunately was unsuccessful (the Gradle build succeeds). Versions: |
@an-cwi Thanks for chiming in. We are all frustrated by the inability to reproduce the issue. If I understand correctly, you have a reproduction of the issue, but it's not minimal. Can you share the non-minimal example? If not, would it be possible for you to turn on some debugging options and share the logs with us? https://github.com/an-cwi/checker-framework-4254/blob/main/build.gradle suggests that you are using lombok-1.18.16. @RamAnvesh upgraded from lombok-1.18.16 to lombok-1.18.18 and that fixed the problem for him. Could you please try that? |
Tried updating lombok (pushed to repo), but no change. I wouldn't be able to share the full reproduction unfortunately (private corporate repo), and there are a lot of config differences between it and minimal repo, so it would take a while to isolate systematically. For starters, I can certainly enable some extra debugging options and share logs, though. Suggestions? |
Thanks!
public class NullLiteralNode extends ValueLiteralNode {
/**
* Create a new NullLiteralNode.
*
* @param t the tree for the literal value
*/
public NullLiteralNode(LiteralTree t) {
super(t);
assert t.getKind() == Tree.Kind.NULL_LITERAL;
}
@Override
public Void getValue() {
return (Void) tree.getValue();
}
|
|
Thanks for the stack trace. It's good to know that the symptoms are the same. javac is a Java program that runs on a JVM, and you can pass command-line arguments to that JVM using the But, I'll send you a jar instead. Do you want it here or (to reduce clutter here) as a gist or directly by email? |
Thanks for the explanation of passing args to the JVM. I see that noted in the CF manual now (though not about assertions specifically). It turns out that in Gradle Error output is the same, no assertions failing. Let's follow up offline to continue debugging. |
This is indeed a bug in Lombok: projectlombok/lombok#2695 . Two mysteries remain:
|
Turns out updating to lombok:1.18.18 did fix the issue in my full project; really sorry for not trying that sooner. Not sure about the minimal reproduction though... |
I'm glad this is working for you now, and you have confirmed that the fix for the original poster worked for you too. I'm still curious why Lombok and the Checker Framework ran at the same time; this seems like a possible problem with the Gradle plugin. |
Yeah, if I remember correctly, I only tried updating lombok in the minimal reproduction at that point. Clearly I should have also tried it in the main project at the same time. Apologies again for the wild goose chase. |
The main thing is that the problem is resolved for you. That is great. Please let us know if you have other problems. I'm going to close this issue now. |
Running checker framework nullness checker from maven
Checker Framework versions:
checker-3.10.0.jar
checker-util-3.10.0.jar
checker-qual-3.10.0.jar
javac Version:
javac-9-dev-r4023-3.jar
No Crash
The text was updated successfully, but these errors were encountered: