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

oak crash on macos M1 chip #174

Open
leonchen83 opened this issue Sep 6, 2021 · 0 comments
Open

oak crash on macos M1 chip #174

leonchen83 opened this issue Sep 6, 2021 · 0 comments

Comments

@leonchen83
Copy link

leonchen83 commented Sep 6, 2021

env

os : macosx aarch64
jdk: OpenJDK 64-Bit Server VM Zulu11.48+21-CA (11.0.11+9-LTS, mixed mode, tiered, compressed oops, g1 gc, bsd-aarch64)

oak version

        <dependency>
            <groupId>com.yahoo.oak</groupId>
            <artifactId>oak</artifactId>
            <version>0.2.3.1</version>
        </dependency>

reproduce code

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.nio.ByteBuffer;

import org.junit.Assert;
import org.junit.Test;

import com.yahoo.oak.OakMap;
import com.yahoo.oak.OakMapBuilder;
import com.yahoo.oak.common.integer.OakIntComparator;
import com.yahoo.oak.common.integer.OakIntSerializer;
import com.yahoo.oak.common.string.OakStringSerializer;

public class XOakMapTest {
	
	/**
	 * 
	 */
	@Test
	public void test1() {
		//
		final OakMap<Integer, String> m;
		m = oakmap1(256); Assert.assertTrue(m.size() == 0);
		m.put(1, "123456789"); Assert.assertTrue(m.size() == 1);
		String v1 = m.remove(1); assertEquals (v1, "123456789");
		
		//
		m.put(2, "654321"); Assert.assertTrue(m.size() == 1);
		m.put(2, "654321"); Assert.assertTrue(m.size() == 1);
		String v2 = m.get(2); Assert.assertEquals(v2, "654321");
		m.close();
	}
	
	/**
	 * 
	 */
	private static OakMap<Integer, String> oakmap1(int n) {
		final int block = 1024 * 1024;
		final OakMapBuilder<Integer, String> builder;
		final OakIntComparator c = new OakIntComparator();
		final OakIntSerializer ks = new OakIntSerializer();
		final OakStringSerializer vs = new OakStringSerializer();
		builder = new OakMapBuilder<>(c, ks, vs, Integer.MIN_VALUE);
		builder.setPreferredBlockSize(block); return builder.build();
	}
}

hs_err_pid74815.log

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0xa) at pc=0x00000001056ffb8c, pid=74815, tid=9731
#
# JRE version: OpenJDK Runtime Environment Zulu11.48+21-CA (11.0.11+9) (build 11.0.11+9-LTS)
# Java VM: OpenJDK 64-Bit Server VM Zulu11.48+21-CA (11.0.11+9-LTS, mixed mode, tiered, compressed oops, g1 gc, bsd-aarch64)
# Problematic frame:
# V  [libjvm.dylib+0x6ffb8c]  Unsafe_CompareAndSetLong(JNIEnv_*, _jobject*, _jobject*, long, long, long)+0x110
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   http://www.azulsystems.com/support/
#

more details see attachment
hs_err_pid74815.log

it works fine in windows 10, linux, macos x86_64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant