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

AccessControlException, javacpp trying to create a SecurityManager #176

Closed
hakanai opened this issue May 3, 2017 · 1 comment
Closed
Labels

Comments

@hakanai
Copy link
Contributor

hakanai commented May 3, 2017

Running with restricted privileges, I get s failure initialising due to an attempt to create a security manager:

java.lang.ExceptionInInitializerError
	at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.<init>(NativeOpExecutioner.java:43)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at java.lang.Class.newInstance(Class.java:442)
	at org.nd4j.linalg.factory.Nd4j.initWithBackend(Nd4j.java:5629)
	at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:5553)
	at org.nd4j.linalg.factory.Nd4j.<clinit>(Nd4j.java:188)
	at Test.test(...)
Caused by: java.lang.RuntimeException: ND4J is probably missing dependencies. For more information, please refer to: http://nd4j.org/getstarted.html
	at org.nd4j.nativeblas.NativeOpsHolder.<init>(NativeOpsHolder.java:41)
	at org.nd4j.nativeblas.NativeOpsHolder.<clinit>(NativeOpsHolder.java:17)
	... 41 more
Caused by: java.lang.ExceptionInInitializerError
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at org.nd4j.nativeblas.NativeOpsHolder.<init>(NativeOpsHolder.java:25)
	... 42 more
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "createSecurityManager")
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
	at java.security.AccessController.checkPermission(AccessController.java:884)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
	at java.lang.SecurityManager.<init>(SecurityManager.java:299)
	at org.bytedeco.javacpp.Loader$1.<init>(Loader.java:262)
	at org.bytedeco.javacpp.Loader.getCallerClass(Loader.java:262)
	at org.bytedeco.javacpp.Loader.load(Loader.java:657)
	at org.nd4j.nativeblas.Nd4jCpu$NativeOps.<clinit>(Nd4jCpu.java:62)
	... 45 more

The code in the area already has some fallback logic which uses the modern API, Thread.currentThread().getStackTrace() - it seems like this fallback could just become the entire body of the method, rather than just being a workaround for Android.

@saudet
Copy link
Member

saudet commented Jul 27, 2017

Fix released in version 1.3.3. Thanks for reporting!

@saudet saudet closed this as completed Jul 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants