-
Notifications
You must be signed in to change notification settings - Fork 578
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
NullPointerException in FieldItemSummary #2759
Comments
the same NPE even on old container that we used for several years "checkstyle/jdk-11-groovy-git-mvn:11.0.13__3.0.9__2.25.1__3.6.3" Command that we use in CI for our repo: |
As far as I can see the code ( |
As I stated above, we don't know a way to reproduce. Might be very special nuance of jdk version jdk11.0.20.1. |
Would it be possible to share a zip with the compiled .class files of the project? |
Here are all binaries https://app.circleci.com/pipelines/github/checkstyle/checkstyle/22599/workflows/002e52f5-5903-49da-be98-1100895997dc/jobs/462597/artifacts, zip is a bit more complicated to make, let's try this way first. Binaries are generated by pull request checkstyle/checkstyle#14205 In case such PR be closed, we can always reopen it to rerun CI. |
Thank you for the samples! I tried to reproduce the problem but strangely got an other error which ultimately boils down to BCEL-370 so I submitted an fix attempt here: apache/commons-bcel#254 Unless I'm mistaken your build runs SpotBugs after Jacoco has modified the class files. The updated bytecode contains instructions that are valid but not normally emitted by compilers. This happens on JDK 11 because the So until the issue is fixed in BCEL (and maybe SpotBugs) I think that you should try a find a way to run SpotBugs before Jacoco I'm still looking into the error you got, but here's the one I see:
|
Class files modified by jacoco cause the spotbugs analysis to crash due to spotbugs#2759
* test: added .class samples modified by jacoco Class files modified by jacoco cause the spotbugs analysis to crash due to #2759 * fix: upgrade BCEL to 6.8.1RC1 * fix: added partial support for CONSTANT_Dynamic Class files using condy (Dynamic class-file constant), like JaCoCo >= 0.8.4 creates them (see [1] and [2] for more details), causes errors we using Spotbugs to parse these class files. The `FooWithMember.clazz` embedded in this commit has been generated from this class source file: ```java package com.foo; class Foo { int a; public Foo(int a) { this.a = a; } public int getA() { return this.a; } } ``` These modifications don't completely fix the support of `CONSTANT_Dynamic`. We continue to have error from BCEL (maybe [3] is insufficient): ``` Exception analyzing com.foo.Foo using detector edu.umd.cs.findbugs.detect.FindNullDeref java.lang.IllegalArgumentException: Unknown or invalid constant type at 32 At org.apache.bcel.generic.LDC.getValue(LDC.java:113) At edu.umd.cs.findbugs.ba.vna.ValueNumberFrameModelingVisitor.visitLDC(ValueNumberFrameModelingVisitor.java:529) At org.apache.bcel.generic.LDC.accept(LDC.java:58) At edu.umd.cs.findbugs.ba.AbstractFrameModelingVisitor.analyzeInstruction(AbstractFrameModelingVisitor.java:84) At edu.umd.cs.findbugs.ba.vna.ValueNumberAnalysis.transferInstruction(ValueNumberAnalysis.java:228) At edu.umd.cs.findbugs.ba.vna.ValueNumberAnalysis.transferInstruction(ValueNumberAnalysis.java:57) At edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis.transfer(AbstractDataflowAnalysis.java:136) At edu.umd.cs.findbugs.ba.vna.ValueNumberAnalysis.transfer(ValueNumberAnalysis.java:214) At edu.umd.cs.findbugs.ba.vna.ValueNumberAnalysis.transfer(ValueNumberAnalysis.java:57) At edu.umd.cs.findbugs.ba.Dataflow.execute(Dataflow.java:378) At edu.umd.cs.findbugs.classfile.engine.bcel.ValueNumberDataflowFactory.analyze(ValueNumberDataflowFactory.java:76) At edu.umd.cs.findbugs.classfile.engine.bcel.ValueNumberDataflowFactory.analyze(ValueNumberDataflowFactory.java:46) At edu.umd.cs.findbugs.classfile.impl.AnalysisCache.analyzeMethod(AnalysisCache.java:368) At edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getMethodAnalysis(AnalysisCache.java:321) At edu.umd.cs.findbugs.classfile.engine.bcel.AnalysisFactory.getValueNumberDataflow(AnalysisFactory.java:118) At edu.umd.cs.findbugs.classfile.engine.bcel.TypeDataflowFactory.analyze(TypeDataflowFactory.java:73) At edu.umd.cs.findbugs.classfile.engine.bcel.TypeDataflowFactory.analyze(TypeDataflowFactory.java:43) At edu.umd.cs.findbugs.classfile.impl.AnalysisCache.analyzeMethod(AnalysisCache.java:368) At edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getMethodAnalysis(AnalysisCache.java:321) At edu.umd.cs.findbugs.classfile.engine.bcel.CFGFactory.analyze(CFGFactory.java:160) At edu.umd.cs.findbugs.classfile.engine.bcel.CFGFactory.analyze(CFGFactory.java:65) At edu.umd.cs.findbugs.classfile.impl.AnalysisCache.analyzeMethod(AnalysisCache.java:368) At edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getMethodAnalysis(AnalysisCache.java:321) At edu.umd.cs.findbugs.classfile.engine.bcel.AnalysisFactory.getCFG(AnalysisFactory.java:93) At edu.umd.cs.findbugs.classfile.engine.bcel.DepthFirstSearchFactory.analyze(DepthFirstSearchFactory.java:49) At edu.umd.cs.findbugs.classfile.engine.bcel.DepthFirstSearchFactory.analyze(DepthFirstSearchFactory.java:32) At edu.umd.cs.findbugs.classfile.impl.AnalysisCache.analyzeMethod(AnalysisCache.java:368) At edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getMethodAnalysis(AnalysisCache.java:321) At edu.umd.cs.findbugs.classfile.engine.bcel.AnalysisFactory.getDepthFirstSearch(AnalysisFactory.java:98) At edu.umd.cs.findbugs.classfile.engine.bcel.ValueNumberDataflowFactory.analyze(ValueNumberDataflowFactory.java:68) At edu.umd.cs.findbugs.classfile.engine.bcel.ValueNumberDataflowFactory.analyze(ValueNumberDataflowFactory.java:46) At edu.umd.cs.findbugs.classfile.impl.AnalysisCache.analyzeMethod(AnalysisCache.java:368) At edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getMethodAnalysis(AnalysisCache.java:321) At edu.umd.cs.findbugs.ba.ClassContext.getMethodAnalysis(ClassContext.java:1010) At edu.umd.cs.findbugs.ba.ClassContext.getValueNumberDataflow(ClassContext.java:333) At edu.umd.cs.findbugs.detect.FindNullDeref.findPreviouslyDeadBlocks(FindNullDeref.java:301) At edu.umd.cs.findbugs.detect.FindNullDeref.analyzeMethod(FindNullDeref.java:271) At edu.umd.cs.findbugs.detect.FindNullDeref.visitClassContext(FindNullDeref.java:216) At edu.umd.cs.findbugs.DetectorToDetector2Adapter.visitClass(DetectorToDetector2Adapter.java:76) At edu.umd.cs.findbugs.FindBugs2.lambda$analyzeApplication$1(FindBugs2.java:1108) At java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) At edu.umd.cs.findbugs.CurrentThreadExecutorService.execute(CurrentThreadExecutorService.java:86) At java.base/java.util.concurrent.AbstractExecutorService.invokeAll(AbstractExecutorService.java:247) At edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:1118) At edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:309) At edu.umd.cs.findbugs.FindBugs.runMain(FindBugs.java:395) ``` [1]: jacoco/jacoco@36b4e9c#diff-1d450b7247672d9362bac0ad7dfd7bd810e4293ab57f0100821a70a5e64e6911R56-R57 [2]: jacoco/jacoco#845 [3]: https://issues.apache.org/jira/browse/BCEL-362 * fix: Ignore ConstantDynamic in ResolveAllReferences * deps: reverted to using the default repos now that BCEL 6.8.1 is out * doc: added a changelog entry * test: converted acceptConstantDynamic to a parameterized test --------- Co-authored-by: Jean-Baptiste Bronisz <jean-baptiste.bronisz@adevinta.com>
So this should be fixed in the upcoming release now that the problem in BCEL is solved and #2807 is merged |
@gtoison, is this issue fixed in 4.8.3.1 ? |
No. Spotbugs itself hasn't been released since 4.8.3.
Sent from my Verizon, Samsung Galaxy smartphone
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Roman Ivanov ***@***.***>
Sent: Monday, February 12, 2024 10:09:08 PM
To: spotbugs/spotbugs ***@***.***>
Cc: Jeremy Landis ***@***.***>; Comment ***@***.***>
Subject: Re: [spotbugs/spotbugs] NullPointerException in FieldItemSummary (Issue #2759)
@gtoison<https://github.com/gtoison>, is this issue fixed in 4.8.3.1 ?
—
Reply to this email directly, view it on GitHub<#2759 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAHODI3SQQFMJBURKWO42RLYTLKNJAVCNFSM6AAAAABAN3A4DCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBQGM2TAOBWHE>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Maven plugin receives updates as necessary for itself in between spotbugs releases.
Sent from my Verizon, Samsung Galaxy smartphone
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Jeremy Landis ***@***.***>
Sent: Monday, February 12, 2024 10:35:36 PM
To: spotbugs/spotbugs ***@***.***>; spotbugs/spotbugs ***@***.***>
Cc: Comment ***@***.***>
Subject: Re: [spotbugs/spotbugs] NullPointerException in FieldItemSummary (Issue #2759)
No. Spotbugs itself hasn't been released since 4.8.3.
Sent from my Verizon, Samsung Galaxy smartphone
Get Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: Roman Ivanov ***@***.***>
Sent: Monday, February 12, 2024 10:09:08 PM
To: spotbugs/spotbugs ***@***.***>
Cc: Jeremy Landis ***@***.***>; Comment ***@***.***>
Subject: Re: [spotbugs/spotbugs] NullPointerException in FieldItemSummary (Issue #2759)
@gtoison<https://github.com/gtoison>, is this issue fixed in 4.8.3.1 ?
—
Reply to this email directly, view it on GitHub<#2759 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAHODI3SQQFMJBURKWO42RLYTLKNJAVCNFSM6AAAAABAN3A4DCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBQGM2TAOBWHE>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Yes |
detected during version bump spotbugs-maven-plugin from 4.7.3.5 to 4.8.2.0
checkstyle/checkstyle#14117
https://app.circleci.com/pipelines/github/checkstyle/checkstyle/22221/workflows/e397e60b-04ca-4618-b94e-5ca0be2a20d8/jobs/446175
OS:
Special docker container:
Execution log:
Note:
on versions below it works wihtou exception (my local):
The text was updated successfully, but these errors were encountered: