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

Fatal error SIGILL (ILL_ILLOPC) on ARM Cortex-A8 processor

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      arm
    • OS:
      linux_ubuntu

      Description

      ADDITIONAL SYSTEM INFORMATION :
      The Java VMs are OpenJDK versions 10.0.1 and 11 built from the latest sources on May 2, 2018. The test system is a Kobo Touch N905C e-reader with 256 MB of RAM and an 800 MHz Freescale i.MX507 Multimedia Application Processor Model MCIMX507CVM8B (ARMv7-A architecture, ARM Cortex-A8 core). This is a 32-bit ARM system running Ubuntu 14.04.5 LTS as follows:

      ------------------------------------
      $ lsb_release -d
      Description: Ubuntu 14.04.5 LTS

      $ uname -a
      Linux koboa 2.6.35.3-850-gbc67621+ #619 PREEMPT Thu Dec 22 15:29:00 CST 2016 armv7l armv7l armv7l GNU/Linux

      $ ldd --version
      ldd (Ubuntu EGLIBC 2.19-0ubuntu6.14) 2.19

      $ getconf GNU_LIBPTHREAD_VERSION
      NPTL 2.19

      $ ./opt/jre-10/bin/java -version
      openjdk version "10.0.1-internal" 2018-04-17
      OpenJDK Runtime Environment (build 10.0.1-internal+0-adhoc.ubuntu.jdk10u)
      OpenJDK Server VM (build 10.0.1-internal+0-adhoc.ubuntu.jdk10u, mixed mode)

      $ ./opt/jre-11/bin/java -version
      openjdk version "11-internal" 2018-09-25
      OpenJDK Runtime Environment (build 11-internal+0-adhoc.ubuntu.jdk)
      OpenJDK Server VM (build 11-internal+0-adhoc.ubuntu.jdk, mixed mode)
      ------------------------------------


      A DESCRIPTION OF THE PROBLEM :
      Thanks to Edward Nevill and Andrey Petushkov on the AArch32 Port Project mailing list for determining the cause of this problem.

      The HotSpot C2 compiler in both OpenJDK 10 and 11 generates a PLDW instruction when running on the Freescale i.MX507 Multimedia Application Processor Model MCIMX507CVM8B, an implementation of the ARM Cortex-A8 core and ARMv7-A architecture. Yet the PLDW instruction is available only in ARMv7 and above cores that implement the Multiprocessing Extensions, which does not include the Cortex-A8.


      REGRESSION : Last worked in version 8u172

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      To reproduce the problem, start any non-trivial program using the OpenJDK 10 or 11 HotSpot Server VM on an ARM Cortex-A8 processor. I ran a simple "Hello World" Swing application on the ARM device using X11 forwarding over SSH with:

      $ ./opt/jre-10/bin/java -jar lib/hellojdk.jar


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The program should run without problems.
      ACTUAL -
      The Java Runtime Environment detects a fatal error and prints the following message:

      ------------------------------------
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGILL (0x4) at pc=0x2baa2334, pid=3919, tid=3920
      #
      # JRE version: OpenJDK Runtime Environment (10.0.1) (build 10.0.1-internal+0-adhoc.ubuntu.jdk10u)
      # Java VM: OpenJDK Server VM (10.0.1-internal+0-adhoc.ubuntu.jdk10u, mixed mode, serial gc, linux-)
      # Problematic frame:
      # J 62 c2 java.lang.StringUTF16.replace([BCC)Ljava/lang/String; java.base@10.0.1-internal (168 bytes) @ 0x2baa2334 [0x2baa21a0+0x00000194]
      #
      # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
      #
      # An error report file with more information is saved as:
      # /home/john/hs_err_pid3919.log
      Could not load hsdis-arm.so; library not loadable; PrintAssembly is disabled
      #
      # If you would like to submit a bug report, please visit:
      # http://bugreport.java.com/bugreport/crash.jsp
      #
      Aborted
      ------------------------------------

      The log file contains:

      ------------------------------------
      siginfo: si_signo: 4 (SIGILL), si_code: 1 (ILL_ILLOPC), si_addr: 0x2baa2334
      Instructions: (pc=0x2baa2334)
      0x2baa2314: e58dc008 e1560007 2a0000b6 e3a05001
      0x2baa2324: e3008458 e34383c0 e58a6044 e5895000
      0x2baa2334: f596f080 e5898004 f596f090 e5891008
      0x2baa2344: f596f0a0 e3007000 e2445010 e589700c
      ------------------------------------


      ---------- BEGIN SOURCE ----------
      I used the following simple Swing application and ran it with X11 forwarding over SSH.

      ------------------------------------
      package org.status6.hello;

      import java.awt.Dimension;
      import java.awt.GridBagLayout;
      import java.awt.event.ActionEvent;
      import java.awt.event.ActionListener;
      import javax.swing.JButton;
      import javax.swing.JFrame;
      import javax.swing.JPanel;

      /**
       * A simple "Hello World" Swing application.
       *
       * @author John Neffenger
       */
      public class HelloSwing {

          private static final String TITLE = "Hello Swing App";
          private static final String LABEL = "Say Hello";
          private static final String MESSAGE = "Hello World!";
          private static final int WIDTH = 800;
          private static final int HEIGHT = 600;

          public static void main(String[] args) {
              JFrame frame = new JFrame(TITLE);
              JPanel panel = new JPanel();
              JButton button = new JButton(LABEL);

              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              panel.setPreferredSize(new Dimension(WIDTH, HEIGHT));
              button.addActionListener(new ActionListener() {
                  @Override
                  public void actionPerformed(ActionEvent e) {
                      System.out.println(MESSAGE);
                  }
              });

              panel.setLayout(new GridBagLayout());
              panel.add(button);
              frame.add(panel);
              frame.pack();
              frame.setVisible(true);
          }
      }
      ------------------------------------

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      The workaround (thanks to Andrey Petushkov) for both OpenJDK 10 and 11 is to run the application with the "-XX:-AssumeMP" HotSpot option:

      ------------------------------------
      $ ./opt/jre-10/bin/java -XX:-AssumeMP -jar lib/hellojdk.jar
      OpenJDK Server VM warning: Option AssumeMP was deprecated in version 10.0 and will likely be removed in a future release.
      Hello World!
      Hello World!
      Hello World!

      $ ./opt/jre-11/bin/java -XX:-AssumeMP -jar lib/hellojdk.jar
      OpenJDK Server VM warning: Option AssumeMP was deprecated in version 10.0 and will likely be removed in a future release.
      Hello World!
      Hello World!
      Hello World!
      ------------------------------------

      Another way to work around the problem in OpenJDK 10.0.1 is to disable the C2 compiler with the "-XX:+TieredCompilation -XX:TieredStopAtLevel=3" HotSpot options:

      ------------------------------------
      $ ./opt/jre-10/bin/java -XX:+TieredCompilation -XX:TieredStopAtLevel=3 -jar lib/hellojdk.jar
      Hello World!
      Hello World!
      Hello World!
      ------------------------------------

      The only other way I found to work around the problem in OpenJDK 11 is to disable the just-in-time compiler entirely and run in interpreted mode:

      ------------------------------------
      $ ./opt/jre-11/bin/java -Xint -jar lib/hellojdk.jar
      Hello World!
      Hello World!
      Hello World!
      ------------------------------------


      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fmatte Fairoz Matte
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: