Verifier crashes on `!` (or another unary operator) applied to a call whose type cannot be resolved
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 65/100
Rechercherichtung
Start with the stack trace: OperationsChecker.getUnaryOpRefinements (OperationsChecker.java:179) calls Context.addInstanceToContext (Context.java:164), which reaches Context.addInstanceVariable (Context.java:267) with a null type. Run the minimal Repro snippet from the issue, with org.example.missing absent from the classpath, to reproduce the NullPointerException. Done means the snippet verifies with the compilation warning instead of crashing, and the related reproducers for #388 and #390 are still considered.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Impact: verification stops with an internal error: 3 of the 53 real-world files below.
Description
!x.m() where x's class is not on the classpath: OperationsChecker.getUnaryOpRefinements adds the operand to the context, and Context.addInstanceVariable calls getSuperclass() on its type, which is null.
Minimal reproducer (org.example.missing is not on the classpath)
import org.example.missing.Settings;
public class Repro {
static void start(Settings settings) {
if (!settings.enabled()) {
return;
}
}
}
Expected
Correct! Passed Verification. (with the "Java compilation encountered issues" warning).
Actual
Exception in thread "main" java.lang.RuntimeException:
Error while checking CtMethodImpl
on start(Settings settings) {
at Repro.java:4
with
Error while checking CtBlockImpl
on {
at Repro.java:4
with
Error while checking CtIfImpl
on if (!settings.enabled()) {
at Repro.java:5
with Cannot invoke "spoon.reflect.reference.CtTypeReference.getSuperclass()" because "type" is null
at liquidjava.processor.refinement_checker.TypeChecker.scan(TypeChecker.java:80)
at spoon.reflect.visitor.CtScanner.scan(CtScanner.java:189)
at spoon.reflect.visitor.CtScanner.scan(CtScanner.java:154)
at spoon.reflect.visitor.CtScanner.visitCtClass(CtScanner.java:363)
at liquidjava.processor.refinement_checker.RefinementTypeChecker.visitCtClass(RefinementTypeChecker.java:97)
at spoon.support.reflect.declaration.CtClassImpl.accept(CtClassImpl.java:63)
at liquidjava.processor.RefinementProcessor.lambda$processPackage$3(RefinementProcessor.java:51)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at liquidjava.processor.RefinementProcessor.processPackage(RefinementProcessor.java:50)
at liquidjava.processor.RefinementProcessor.process(RefinementProcessor.java:35)
at liquidjava.processor.RefinementProcessor.process(RefinementProcessor.java:15)
at spoon.support.visitor.ProcessingVisitor.scan(ProcessingVisitor.java:72)
at spoon.support.QueueProcessingManager.process(QueueProcessingManager.java:118)
at spoon.support.QueueProcessingManager.process(QueueProcessingManager.java:132)
at liquidjava.api.CommandLineLauncher.launch(CommandLineLauncher.java:92)
at liquidjava.api.CommandLineLauncher.main(CommandLineLauncher.java:41)
...
Caused by: java.lang.NullPointerException: Cannot invoke "spoon.reflect.reference.CtTypeReference.getSuperclass()" because "type" is null
at liquidjava.processor.context.Context.addInstanceVariable(Context.java:267)
at liquidjava.processor.context.Context.addInstanceToContext(Context.java:164)
at liquidjava.processor.refinement_checker.general_checkers.OperationsChecker.getUnaryOpRefinements(OperationsChecker.java:179)
Reproduced on main at dcfc4eb2 (liquidjava-verifier 0.0.35).
Real-world files that hit it
if (!appProperties.simulator().enabled()) {— skyleedevzero86/carebridge-platform (file)if (!Game.isInNoGUIMode()) {— gurkenlabs/litiengine (file)(!context.isExportedEquipment(identifiable) || extensions.isEmpty()) {— stvzhou/powsybl-core (file)
Context
Found while running LiquidJava on the original repository files of 53 real-world typestate and refinement bugs (the same files as our study exercises, before simplification). Each file is verified on its own, as a user would on one file of a project, so the project's other classes and its dependencies are not on the classpath. On main this crash and the two related ones (#388 binary operator, #389 unary operator, #390 field read) stop verification in 33 of the 53 files.
- Vorherrschende Sprache
- Java
- Sterne
- 67
- Forks
- 36
- Ø Merge
- 2 T. 3 Std.
- Gemergte PRs (30 T.)
- 29
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus liquid-java/liquidjava
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
liquid-java/liquidjava#388 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
liquid-java/liquidjava#373 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
liquid-java/liquidjava#321 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 62/100
liquid-java/liquidjava#390 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
liquid-java/liquidjava#381 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in liquid-java/liquidjava
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
utopia-rise/godot-jvm#1004 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
resilience4j/resilience4j#2547 ·
Maintainer antworten meist innerhalb von 9 Tagen
-
Clock.MakeDate continues execution and returns a rolled-over instant after dispatching error on invalid dateEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
mit-cml/appinventor-sources#4155 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Hira-shi/PW1-DAI-Carrel-Egal-Eyer#28 ·
Maintainer antworten meist innerhalb von 1 Tag
-
`GET /v1/event/token/{uuid}` can report a BOM upload as done before policy evaluation and metrics have finishedEvtl. vergeben @Zargath hat das heute übernommen. Offendefect in triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
DependencyTrack/dependency-track#7646 ·
Maintainer antworten meist innerhalb von 1 Tag