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

JDK crash multithreading #133

Open
XePeleato opened this issue Oct 11, 2021 · 1 comment
Open

JDK crash multithreading #133

XePeleato opened this issue Oct 11, 2021 · 1 comment

Comments

@XePeleato
Copy link

Hello, I've been using this library for my research, it's great! I've recently come across an issue when working on multiple threads, I can't get it to reproduce consistently, it just happens, more consistently if I use ~24 threads.

I have enabled the -Xcheck:jni flag and this is the output when it crashes:

FATAL ERROR in native method: Using JNIEnv in the wrong thread
        at org.jblas.NativeBlas.dgeev(Native Method)
        at org.jblas.NativeBlas.dgeev(NativeBlas.java:302)
        at org.jblas.SimpleBlas.geev(SimpleBlas.java:375)
        at org.jblas.Eigen.eigenvalues(Eigen.java:89)

It indeed looks like a threading issue, however, it's not as obvious as it seems to me, since dgeev uses no cached reference to JNIEnv.

This happens only with the dgeev function, my application calculates eigenvalues and also does quite some matrix to matrix operations.

Also, it happens on a CentOs 7 amd64 system.

I'll be happy to provide any other detail necessary to address this issue.

Thanks!

@mikiobraun
Copy link
Member

Hey!

Thanks for your patience. Does this problem persist? Can you tell me a bit more about this? Are the matrices shared or are they completely separate? How many cores does your machine have?

Best,

Mikio

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

2 participants