Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8207160

ClassReader::adjustMethodParams can potentially return null if the args list is empty

XMLWordPrintable

    • b12
    • x86_64
    • linux_ubuntu

        ADDITIONAL SYSTEM INFORMATION :
        $ javac -version
        javac 11-ea

        $ java -version
        openjdk version "11-ea" 2018-09-25
        OpenJDK Runtime Environment 18.9 (build 11-ea+21)
        OpenJDK 64-Bit Server VM 18.9 (build 11-ea+21, mixed mode)

        $ mvn -version
        Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T15:39:06-04:00)
        Maven home: /bnaLocal/cm/apps/apache-maven3
        Java version: 11-ea, vendor: Oracle Corporation
        Java home: /tmp/jdk-11
        Default locale: en_US, platform encoding: UTF-8
        OS name: "linux", version: "4.4.0-130-generic", arch: "amd64", family: "unix"


        A DESCRIPTION OF THE PROBLEM :
        I am compiling via maven and I get this NullPointerException:

             [exec] [INFO] Compiling 46 source files to /home/mjazbuti/p4workspaces/bcan-mjazbuti-main/bcan/bcan-engine/target/test-classes
             [exec] compiler message file broken: key=compiler.misc.msg.bug arguments=11-ea, {1}, {2}, {3}, {4}, {5}, {6}, {7}
             [exec] java.lang.NullPointerException
             [exec] at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.setParameters(ClassReader.java:2562)
             [exec] at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readMethod(ClassReader.java:2460)
             [exec] at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClass(ClassReader.java:2736)
             [exec] at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClassBuffer(ClassReader.java:2808)
             [exec] at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClassFile(ClassReader.java:2821)
             [exec] at jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:359)
             [exec] at jdk.compiler/com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:291)
             [exec] at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:642)
             [exec] at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1326)
             [exec] at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.complete(Type.java:1140)
             [exec] at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.getTypeArguments(Type.java:1066)
             [exec] at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.allparams(Type.java:1088)
             [exec] at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.isRaw(Type.java:1126)
             [exec] at jdk.compiler/com.sun.tools.javac.code.Types.capture(Types.java:4357)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.InferenceContext.cachedCapture(InferenceContext.java:586)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.visitApply(Attr.java:2023)
             [exec] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1634)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:655)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:702)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.visitBinary(Attr.java:3383)
             [exec] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBinary.accept(JCTree.java:1989)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:655)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribArgs(Attr.java:751)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1997)
             [exec] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1634)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:655)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:702)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.visitExec(Attr.java:1773)
             [exec] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1452)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:655)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:724)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStats(Attr.java:743)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1294)
             [exec] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1020)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:655)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:724)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1098)
             [exec] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:866)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:655)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:724)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:4683)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4574)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4503)
             [exec] at jdk.compiler/com.sun.tools.javac.comp.Attr.attrib(Attr.java:4448)
             [exec] at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1341)
             [exec] at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:973)
             [exec] at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
             [exec] at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:147)
             [exec] at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100)
             [exec] at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94)
             [exec] at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:126)
             [exec] at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:174)
             [exec] at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1075)
             [exec] at org.apache.maven.plugin.compiler.TestCompilerMojo.execute(TestCompilerMojo.java:176)
             [exec] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
             [exec] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
             [exec] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
             [exec] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
             [exec] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
             [exec] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
             [exec] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
             [exec] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
             [exec] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
             [exec] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
             [exec] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
             [exec] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
             [exec] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
             [exec] at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
             [exec] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             [exec] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
             [exec] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
             [exec] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
             [exec] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
             [exec] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
             [exec] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
             [exec] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)


        REGRESSION : Last worked in version 8u162

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        I don't know; it does happen every time, probably due to something in a source file, but I can't tell which of the 46 files is problematic. This is all buried inside maven. From running maven with debug enabled, I see the javac arguments are:

        -d /home/mjazbuti/p4workspaces/bcan-mjazbuti-main/bcan/bcan-engine/target/test-classes -classpath /home/mjazbuti/[...many many jar files...] -sourcepath /home/mjazbuti/p4workspaces/bcan-mjazbuti-main/bcan/bcan-engine/src/test/java:/home/mjazbuti/p4workspaces/bcan-mjazbuti-main/bcan/bcan-engine/target/generated-test-sources/test-annotations: -s /home/mjazbuti/p4workspaces/bcan-mjazbuti-main/bcan/bcan-engine/target/generated-test-sources/test-annotations -g -deprecation -target 1.6 -source 1.6 -encoding UTF-8 -Xlint:all,-path,-options,-serial,-unchecked,-rawtypes,-classfile,-static,-fallthrough -Werror

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        compilation succeeds
        ACTUAL -
        compilation aborted and incomplete

        FREQUENCY : always


              vromero Vicente Arturo Romero Zaldivar
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: