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

SIGSEGV after upgrading to 1.8.0_282 from 1.8.0_275-b01 #248

Closed
ahmetmircik opened this issue Jan 28, 2021 · 4 comments
Closed

SIGSEGV after upgrading to 1.8.0_282 from 1.8.0_275-b01 #248

ahmetmircik opened this issue Jan 28, 2021 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@ahmetmircik
Copy link

Hi,
I have encountered this issue after upgrade. Could you please check it?

OS
macOS x64

Release

openjdk version "1.8.0_282"
OpenJDK Runtime Environment (build 1.8.0_282-bre_2021_01_20_16_06-b00)
OpenJDK 64-Bit Server VM (build 25.282-b00, mixed mode)

Reproducer

import sun.misc.Unsafe;

import java.lang.reflect.Field;

public class JvmCrash {

    public static void main(String[] args) {
        long address = UNSAFE.allocateMemory(16);
        UNSAFE.putLong(null, address, 12);
    }

    static Unsafe UNSAFE;

    static {
        try {
            UNSAFE = findUnsafe();
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }

    private static Unsafe findUnsafe() throws IllegalAccessException {
        try {
            return Unsafe.getUnsafe();
        } catch (SecurityException se) {
            Class<Unsafe> type = Unsafe.class;
            try {
                Field field = type.getDeclaredField("theUnsafe");
                field.setAccessible(true);
                return type.cast(field.get(type));
            } catch (Exception e) {
                for (Field field : type.getDeclaredFields()) {
                    if (type.isAssignableFrom(field.getType())) {
                        field.setAccessible(true);
                        return type.cast(field.get(type));
                    }
                }
            }
        }
        return null;
    }
}
@aahlenst aahlenst transferred this issue from adoptium/temurin-build Jan 28, 2021
@karianna karianna added the bug Something isn't working label Jan 28, 2021
@karianna
Copy link
Contributor

I can't reproduce this on Mac Os X 10.15.7 (Catalina) using adoptopenjdk 1.8.0_282. -no crash for me (even after 100 runs)

@ahmetmircik
Copy link
Author

ahmetmircik commented Jan 28, 2021

I can reliably reproduce it on macOS Big Sur Version 11.1 after installing JDK here: https://github.com/AdoptOpenJDK/homebrew-openjdk/blob/master/Casks/adoptopenjdk8.rb

This is my hardware overview:

Model Name:	MacBook Pro
Model Identifier:	MacBookPro15,1
Processor Name:	6-Core Intel Core i9
Processor Speed:	2,9 GHz
Number of Processors:	1
Total Number of Cores:	6
L2 Cache (per Core):	256 KB
L3 Cache:	12 MB
Hyper-Threading Technology:	Enabled
Memory:	32 GB

This is how i run it:

/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/bin/java -javaagent:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=56878:/Applications/IntelliJ IDEA CE.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/jre/lib/charsets.jar:/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/jre/lib/ext/localedata.jar:/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/jre/lib/ext/sunec.jar:/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/jre/lib/jce.jar:/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/jre/lib/jfr.jar:/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/jre/lib/jsse.jar:/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/jre/lib/management-agent.jar:/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/jre/lib/resources.jar:/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/jre/lib/rt.jar:/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/lib/dt.jar:/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/lib/jconsole.jar:/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/lib/sa-jdi.jar:/usr/local/Cellar/openjdk@8/1.8.0+282/libexec/openjdk.jdk/Contents/Home/lib/tools.jar:/Users/ahmet.mircik/Desktop/jvmCrash/target/classes JvmCrash

And the error i see:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000010f566c1e, pid=83033, tid=0x0000000000002903
#
# JRE version: OpenJDK Runtime Environment (8.0_282) (build 1.8.0_282-bre_2021_01_20_16_06-b00)
# Java VM: OpenJDK 64-Bit Server VM (25.282-b00 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.dylib+0x566c1e]  Unsafe_SetLong+0xd2
#
# Failed to write core dump. 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:
# /Users/ahmet.mircik/Desktop/jvmCrash/hs_err_pid83033.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

@aahlenst
Copy link
Contributor

That's a local build created by Homebrew. We cannot help with that. Although you might have configured our tap, you have to install adoptopenjdk8 which is placed into /Library/Java/JavaVirtualMachines/. You can invoke it via java. You might need some additional configuration if you have multiple versions installed (https://mkyong.com/java/how-to-set-java_home-environment-variable-on-mac-os-x/).

@ahmetmircik
Copy link
Author

I didn't know build was created by Homebrew.
Then i think i can close this issue by noting that when i use 1.8.0_282 from here https://adoptopenjdk.net/archive.html?variant=openjdk8, i couldn't see any error.
Thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants