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

[23] Random failing ASTRewritingModifying*Tests getStartPosition() because "range" is null #3385

Open
iloveeclipse opened this issue Dec 3, 2024 · 15 comments
Labels
bug Something isn't working build test failure Unit Test failures in builds - maynot be a regression caused by the previous change regression Something was broken by a previous change test Work on unit tests, no change of productive code

Comments

@iloveeclipse
Copy link
Member

https://download.eclipse.org/eclipse/downloads/drops4/I20241203-0240/testresults/html/org.eclipse.jdt.core.tests.model_ep435I-unit-linux-x86_64-java23_linux.gtk.x86_64_23.html

Cannot invoke "org.eclipse.jdt.core.dom.rewrite.TargetSourceRangeComputer$SourceRange.getStartPosition()" because "range" is null

java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.core.dom.rewrite.TargetSourceRangeComputer$SourceRange.getStartPosition()" because "range" is null
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.getExtendedEnd(ASTRewriteAnalyzer.java:264)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisit(ASTRewriteAnalyzer.java:420)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisitList(ASTRewriteAnalyzer.java:457)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:451)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisitUnchangedChildren(ASTRewriteAnalyzer.java:464)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:1830)
at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:249)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3312)
at org.eclipse.jdt.core.dom.InternalASTRewrite.rewriteAST(InternalASTRewrite.java:100)
at org.eclipse.jdt.core.dom.AST.rewrite(AST.java:3897)
at org.eclipse.jdt.core.dom.CompilationUnit.rewrite(CompilationUnit.java:985)
at org.eclipse.jdt.core.tests.rewrite.modifying.ASTRewritingModifyingTest.evaluateRewrite(ASTRewritingModifyingTest.java:151)
at org.eclipse.jdt.core.tests.rewrite.modifying.ASTRewritingModifyingTest.evaluateRewrite(ASTRewritingModifyingTest.java:142)
at org.eclipse.jdt.core.tests.rewrite.modifying.ASTRewritingModifyingRemoveTest.test0004(ASTRewritingModifyingRemoveTest.java:156)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at junit.framework.TestCase.runTest(TestCase.java:177)
at org.eclipse.jdt.core.tests.junit.extension.TestCase.runTest(TestCase.java:970)
at junit.framework.TestCase.runBare(TestCase.java:142)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:130)
at junit.framework.TestSuite.runTest(TestSuite.java:241)
at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$Suite.runTest(SuiteOfTestCases.java:114)
at junit.framework.TestSuite.run(TestSuite.java:236)
at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$Suite.superRun(SuiteOfTestCases.java:97)
at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$Suite$1.protect(SuiteOfTestCases.java:85)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at org.eclipse.jdt.core.tests.model.SuiteOfTestCases$Suite.run(SuiteOfTestCases.java:94)
at junit.framework.TestSuite.runTest(TestSuite.java:241)
at junit.framework.TestSuite.run(TestSuite.java:236)
at junit.framework.TestSuite.runTest(TestSuite.java:241)
at junit.framework.TestSuite.run(TestSuite.java:236)
@iloveeclipse iloveeclipse added bug Something isn't working regression Something was broken by a previous change labels Dec 3, 2024
@iloveeclipse
Copy link
Member Author

Can't reproduce locally on Linux/Java 23.

@iloveeclipse
Copy link
Member Author

The problem seem to be sporadic...

@jukzi
Copy link
Contributor

jukzi commented Jan 8, 2025

Have not seen this test fail recently and can not reproduce locally (win) If it happens again reopen as random fail.

@jukzi jukzi closed this as not planned Won't fix, can't repro, duplicate, stale Jan 8, 2025
@jukzi
Copy link
Contributor

jukzi commented Jan 30, 2025

failed again in https://download.eclipse.org/eclipse/downloads/drops4/I20250129-1800/testresults/html/org.eclipse.jdt.core.tests.model_ep435I-unit-linux-x86_64-java23_linux.gtk.x86_64_23.html

java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.core.dom.rewrite.TargetSourceRangeComputer$SourceRange.getStartPosition()" because "range" is null
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.getExtendedEnd(ASTRewriteAnalyzer.java:264)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisit(ASTRewriteAnalyzer.java:420)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisitList(ASTRewriteAnalyzer.java:457)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:451)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisitUnchangedChildren(ASTRewriteAnalyzer.java:464)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:1872)
at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:480)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3312)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisit(ASTRewriteAnalyzer.java:419)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisitList(ASTRewriteAnalyzer.java:457)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.voidVisit(ASTRewriteAnalyzer.java:451)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doVisitUnchangedChildren(ASTRewriteAnalyzer.java:464)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:1833)
at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:249)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3312)
at org.eclipse.jdt.core.dom.InternalASTRewrite.rewriteAST(InternalASTRewrite.java:100)
at org.eclipse.jdt.core.dom.AST.rewrite(AST.java:3924)
at org.eclipse.jdt.core.dom.CompilationUnit.rewrite(CompilationUnit.java:985)
at org.eclipse.jdt.core.tests.rewrite.modifying.ASTRewritingModifyingTest.evaluateRewrite(ASTRewritingModifyingTest.java:143)
at org.eclipse.jdt.core.tests.rewrite.modifying.ASTRewritingModifyingTest.evaluateRewrite(ASTRewritingModifyingTest.java:134)
at org.eclipse.jdt.core.tests.rewrite.modifying.ASTRewritingModifyingRemoveTest.testBug446446_003(ASTRewritingModifyingRemoveTest.java:756)

@jukzi jukzi reopened this Jan 30, 2025
@jukzi jukzi changed the title 10 ASTRewritingModifying*Tests fail on Java 23 since I20241203-0240 Random failing ASTRewritingModifying*Tests getStartPosition() because "range" is null Jan 30, 2025
@jukzi jukzi changed the title Random failing ASTRewritingModifying*Tests getStartPosition() because "range" is null [23] Random failing ASTRewritingModifying*Tests getStartPosition() because "range" is null Jan 30, 2025
@jukzi
Copy link
Contributor

jukzi commented Jan 30, 2025

Probably some bug in jdk-23+37 as the source looks like range can't be null at that position

[echoproperties] java.vendor.version=Temurin-23+37-202410121216
[echoproperties] java.version=23.0.1-beta
[echoproperties] java.version.date=2024-10-15

@jukzi
Copy link
Contributor

jukzi commented Jan 30, 2025

A current version would be 23.0.2+7 @akurtakov can we upgrade jdk, please?

@jukzi jukzi marked this as a duplicate of #3499 Jan 30, 2025
@jukzi jukzi added build test failure Unit Test failures in builds - maynot be a regression caused by the previous change test Work on unit tests, no change of productive code labels Jan 30, 2025
@akurtakov
Copy link
Contributor

One has to open helpdesk issue like https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/5179 for that . These are standard tools not managed by us.

@jukzi
Copy link
Contributor

jukzi commented Jan 30, 2025

@jukzi
Copy link
Contributor

jukzi commented Feb 3, 2025

@jukzi jukzi reopened this Feb 3, 2025
@jukzi jukzi marked this as a duplicate of #3519 Feb 3, 2025
@rgrunber
Copy link
Contributor

rgrunber commented Feb 3, 2025

Not sure if some other workaround exists, but @snjeza basically added

-XX:CompileCommand=exclude,org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer::getExtendedRange and that seems to have fixed our jobs. We had the same stacktrace in JDT-LS occasionally where a bunch of our tests under "refactoring" or "correction" packages would just fail with this stacktrace.

She pointed me to afaf517 ? eclipse-jdt/eclipse.jdt.ui#1639

@jukzi
Copy link
Contributor

jukzi commented Feb 3, 2025

-XX:CompileCommand=exclude,org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer::getExtendedRange

May be a workaround, but i am more interested in a fix :-) @stephan-herrmann did you report the JIT bug? Any JDK Bug related?

@snjeza
Copy link
Contributor

snjeza commented Feb 3, 2025

@jukzi
Copy link
Contributor

jukzi commented Feb 3, 2025

@snjeza those seem not to be related to the impossible NPE

@jukzi
Copy link
Contributor

jukzi commented Feb 5, 2025

debugged: the "range" at that point should always be the new SourceRange(...) from

return new SourceRange(extendedStartPosition, extendedLength);

@jukzi
Copy link
Contributor

jukzi commented Feb 7, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build test failure Unit Test failures in builds - maynot be a regression caused by the previous change regression Something was broken by a previous change test Work on unit tests, no change of productive code
Projects
None yet
Development

No branches or pull requests

5 participants