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

Use of Unsafe in High Scale break on Android #3554

Closed
donv opened this issue Dec 20, 2015 · 4 comments
Closed

Use of Unsafe in High Scale break on Android #3554

donv opened this issue Dec 20, 2015 · 4 comments

Comments

@donv
Copy link
Member

@donv donv commented Dec 20, 2015

Using jruby-jars 1.7.23 with Ruboto results in this exception:

https://travis-ci.org/ruboto/ruboto/jobs/97978906#L4896 :

W/System.err(  870): Caused by: java.lang.RuntimeException: Could not obtain access to sun.misc.Unsafe
W/System.err(  870):    at org.cliffc.high_scale_lib.UtilUnsafe.getUnsafe(UtilUnsafe.java:25)
W/System.err(  870):    at org.cliffc.high_scale_lib.NonBlockingHashMapLong.<clinit>(NonBlockingHashMapLong.java:88)
W/System.err(  870):    ... 91 more
W/System.err(  870): Caused by: java.lang.NoSuchFieldException: theUnsafe
W/System.err(  870):    at java.lang.Class.getDeclaredField(Class.java:631)
W/System.err(  870):    at org.cliffc.high_scale_lib.UtilUnsafe.getUnsafe(UtilUnsafe.java:21)

JRuby uses Unsafe already, so I am not sure what the problem is with High Scale. Any help would be great.

@donv donv added this to the JRuby 1.7.24 milestone Dec 20, 2015
@mkristian
Copy link
Member

@mkristian mkristian commented Dec 21, 2015

another high scale issue is #3555

@kares
Copy link
Member

@kares kares commented Dec 21, 2015

seems to me that this pretty much nails that we're better off extracting the NonBlockingHashMapLong class into our own and managing the missing Unsafe. // cc @headius

@kares
Copy link
Member

@kares kares commented Dec 22, 2015

one solution is to port over the needed class with adjustments: #3560 ... and avoid packaging the .jar (which also resolves packaging patched JDK classes - #3555)

@kares kares closed this Jan 2, 2016
@donv
Copy link
Member Author

@donv donv commented Jan 2, 2016

@kares Thanks!

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

Successfully merging a pull request may close this issue.

None yet
3 participants