Skip to content
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

DataflowAnalysisException in 4.7.3 and 4.8.3 #2942

Open
myaponchik opened this issue Apr 12, 2024 · 5 comments
Open

DataflowAnalysisException in 4.7.3 and 4.8.3 #2942

myaponchik opened this issue Apr 12, 2024 · 5 comments

Comments

@myaponchik
Copy link

myaponchik commented Apr 12, 2024

I have the Exception by scanning with Ant:

[spotbugs] edu.umd.cs.findbugs.ba.DataflowAnalysisException: not enough values on stack: access=1, avail=0
[spotbugs] At edu.umd.cs.findbugs.ba.Frame.getStackLocation(Frame.java:266)
[spotbugs] At edu.umd.cs.findbugs.ba.deref.UnconditionalValueDerefAnalysis.checkUnconditionalDerefDatabase(UnconditionalValueDerefAnalysis.java:416)
[spotbugs] At edu.umd.cs.findbugs.ba.deref.UnconditionalValueDerefAnalysis.checkAllNonNullParams(UnconditionalValueDerefAnalysis.java:529)
[spotbugs] At edu.umd.cs.findbugs.ba.npe.IsNullValueFrameModelingVisitor.handleInvoke(IsNullValueFrameModelingVisitor.java:188)
[spotbugs] At edu.umd.cs.findbugs.ba.npe.IsNullValueFrameModelingVisitor.visitINVOKESPECIAL(IsNullValueFrameModelingVisitor.java:513)
[spotbugs] At org.apache.bcel.generic.INVOKESPECIAL.accept(INVOKESPECIAL.java:64)
[spotbugs] At edu.umd.cs.findbugs.ba.AbstractFrameModelingVisitor.analyzeInstruction(AbstractFrameModelingVisitor.java:84)
[spotbugs] At edu.umd.cs.findbugs.ba.npe.IsNullValueFrameModelingVisitor.analyzeInstruction(IsNullValueFrameModelingVisitor.java:106)
[spotbugs] At edu.umd.cs.findbugs.ba.npe.IsNullValueAnalysis.transferInstruction(IsNullValueAnalysis.java:336)
[spotbugs] At edu.umd.cs.findbugs.ba.npe.IsNullValueAnalysis.transferInstruction(IsNullValueAnalysis.java:73)
[spotbugs] At edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis.transfer(AbstractDataflowAnalysis.java:136)
[spotbugs] At edu.umd.cs.findbugs.ba.npe.IsNullValueAnalysis.transfer(IsNullValueAnalysis.java:280)
[spotbugs] At edu.umd.cs.findbugs.ba.npe.IsNullValueAnalysis.transfer(IsNullValueAnalysis.java:73)
[spotbugs] At edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis.getFactAtLocation(AbstractDataflowAnalysis.java:84)
[spotbugs] At edu.umd.cs.findbugs.ba.Dataflow.getFactAtLocation(Dataflow.java:503)
[spotbugs] At edu.umd.cs.findbugs.detect.LoadOfKnownNullValue.analyzeMethod(LoadOfKnownNullValue.java:129)
[spotbugs] At edu.umd.cs.findbugs.detect.LoadOfKnownNullValue.visitClassContext(LoadOfKnownNullValue.java:62)
[spotbugs] At edu.umd.cs.findbugs.DetectorToDetector2Adapter.visitClass(DetectorToDetector2Adapter.java:76)
[spotbugs] At edu.umd.cs.findbugs.FindBugs2.lambda$analyzeApplication$1(FindBugs2.java:1108)
[spotbugs] At edu.umd.cs.findbugs.FindBugs2$$Lambda$119/0x0000000000000000.call(Unknown Source)
[spotbugs] At java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[spotbugs] At edu.umd.cs.findbugs.CurrentThreadExecutorService.execute(CurrentThreadExecutorService.java:86)
[spotbugs] At java.base/java.util.concurrent.AbstractExecutorService.invokeAll(AbstractExecutorService.java:242)
[spotbugs] At edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:1118)
[spotbugs] At edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:309)
[spotbugs] At edu.umd.cs.findbugs.FindBugs.runMain(FindBugs.java:395)
[spotbugs] At edu.umd.cs.findbugs.FindBugs2.main(FindBugs2.java:1231)
[spotbugs] Error analyzing public static void main(String[] args) (class: de.hl.bps.sts.maschrefiverkaufandritteendgsetzen.MaschReFiVerkaufAnDritteEndgSetzenStarter)
[spotbugs] edu.umd.cs.findbugs.ba.DataflowAnalysisException: Accessing TOP or BOTTOM frame!
[spotbugs] At edu.umd.cs.findbugs.ba.Frame.getStackValue(Frame.java:243)
[spotbugs] At edu.umd.cs.findbugs.detect.FindUselessObjects$UselessValuesContext.initObservedValues(FindUselessObjects.java:144)
[spotbugs] At edu.umd.cs.findbugs.detect.FindUselessObjects.analyzeMethod(FindUselessObjects.java:461)
[spotbugs] At edu.umd.cs.findbugs.detect.FindUselessObjects.visitClassContext(FindUselessObjects.java:451)
[spotbugs] At edu.umd.cs.findbugs.DetectorToDetector2Adapter.visitClass(DetectorToDetector2Adapter.java:76)
[spotbugs] At edu.umd.cs.findbugs.FindBugs2.lambda$analyzeApplication$1(FindBugs2.java:1108)
[spotbugs] At edu.umd.cs.findbugs.FindBugs2$$Lambda$119/0x0000000000000000.call(Unknown Source)
[spotbugs] At java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[spotbugs] At edu.umd.cs.findbugs.CurrentThreadExecutorService.execute(CurrentThreadExecutorService.java:86)
[spotbugs] At java.base/java.util.concurrent.AbstractExecutorService.invokeAll(AbstractExecutorService.java:242)
[spotbugs] At edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:1118)
[spotbugs] At edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:309)
[spotbugs] At edu.umd.cs.findbugs.FindBugs.runMain(FindBugs.java:395)
[spotbugs] At edu.umd.cs.findbugs.FindBugs2.main(FindBugs2.java:1231)

Copy link

welcome bot commented Apr 12, 2024

Thanks for opening your first issue here! 😃
Please check our contributing guideline. Especially when you report a problem, make sure you share a Minimal, Complete, and Verifiable example to reproduce it in this issue.

@hazendaz hazendaz changed the title DataflowAnalysisException in 4.7.3 and 4.83 DataflowAnalysisException in 4.7.3 and 4.8.3 Apr 12, 2024
@gtoison
Copy link
Contributor

gtoison commented Apr 15, 2024

Thanks for reporting this and thanks for the code!
Would you be able to share the compiled .class triggering the problem? SpotBugs works by analysing the compiled bytecode (not the source) and the code shared above refers to many other java classes so compiling it would be complicated

@myaponchik
Copy link
Author

.class, sure, my mistake. Is attached.

MaschReFiVerkaufAnDritteAufteilenStarter.gz

@gtoison
Copy link
Contributor

gtoison commented Apr 16, 2024

No problem and thank you! I tried analysing the .class file but it does not seem to reproduce the error.
May I ask how you know that this particular class is causing the problem? Unless I'm missing something the error message does not say what .class file it was analysing when it crashed

Edit: Ah now I see it: [spotbugs] Error analyzing public static void main(String[] args) (class: de.hl.bps.sts.maschrefiverkaufandritteendgsetzen.MaschReFiVerkaufAnDritteEndgSetzenStarter)

@myaponchik
Copy link
Author

Yes, the main method is a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants