OpenJDK javac Nullpointerexception building Hadoop

System configuration

AMD Seattle A0 - running kernel 4.0 with PAGE_SIZE=64KB.

Source tree & Pre-requisites

  • maven was used to build the source.

  • OpenJDK version 8 release 1507 from Linaro, JAVA_HOME was set the directory of the jdk.

  • Hadoop trunk:

Check out from:

git clone git://git.apache.org/hadoop.git
cd hadoop
git checkout b6265d3 -b test-branch

Build command

mvn clean package -Pdist,native -DskipTests -Dtar -Dmaven.javadoc.skip=true -X

The exception

[INFO] Compiling 109 source files to /home/steven/hadoop/hadoop-hdfs-project/hadoop-hdfs-client/target/classes
An exception has occurred in the compiler (1.8.0-internal). Please file a bug at the Java Bug Database (http://bugreport.java.com/bugreport/) after checking the database for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.NullPointerException
        at com.sun.tools.javac.comp.Lower.visitReturn(Lower.java:3588)
        at com.sun.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1384)
        at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at com.sun.tools.javac.comp.Lower.translate(Lower.java:2371)
        at com.sun.tools.javac.comp.Lower.visitIf(Lower.java:2977)
        at com.sun.tools.javac.tree.JCTree$JCIf.accept(JCTree.java:1269)
        at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at com.sun.tools.javac.comp.Lower.translate(Lower.java:2371)
        at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:70)
        at com.sun.tools.javac.tree.TreeTranslator.visitBlock(TreeTranslator.java:162)
        at com.sun.tools.javac.comp.Lower.visitBlock(Lower.java:3561)
        at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:909)
        at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at com.sun.tools.javac.comp.Lower.translate(Lower.java:2371)
        at com.sun.tools.javac.tree.TreeTranslator.visitMethodDef(TreeTranslator.java:145)
        at com.sun.tools.javac.comp.Lower.visitMethodDefInternal(Lower.java:2828)
        at com.sun.tools.javac.comp.Lower.visitMethodDef(Lower.java:2737)
        at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:778)
        at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at com.sun.tools.javac.comp.Lower.translate(Lower.java:2371)
        at com.sun.tools.javac.comp.Lower.visitClassDef(Lower.java:2508)
        at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:693)
        at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at com.sun.tools.javac.comp.Lower.translate(Lower.java:2371)
        at com.sun.tools.javac.comp.Lower.visitClassDef(Lower.java:2508)
        at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:693)
        at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58)
        at com.sun.tools.javac.comp.Lower.translate(Lower.java:2371)
        at com.sun.tools.javac.comp.Lower.translate(Lower.java:2390)
        at com.sun.tools.javac.comp.Lower.translateTopLevelClass(Lower.java:3932)
        at com.sun.tools.javac.main.JavaCompiler.desugar(JavaCompiler.java:1512)
        at com.sun.tools.javac.main.JavaCompiler.desugar(JavaCompiler.java:1356)
        at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:901)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:860)
        at com.sun.tools.javac.main.Main.compile(Main.java:523)
        at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
        at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
        at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:126)
        at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:169)
        at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:785)
        at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

Attempted debug strategies

I tried to use jdb, by setting the following Maven options:

export MAVEN_OPTS="-Xrunjdwp:transport=dt_socket,server=y,address=6000"

Then, I spawned jdb as follows:

./jdb -attach 6000
main[1] stop in com.sun.tools.javac.main.Main.bugMessage
Deferring breakpoint com.sun.tools.javac.main.Main.bugMessage.
It will be set after the class is loaded.
main[1] cont
>

The idea being that I could explore compiler state to get more useful information. Unfortunately, this appears to have made the bug go away... :-(.

LEG/Engineering/BigData/horrible-jvm-debug-case-for-ed-hadoop (last modified 2016-03-21 23:08:59)