1

My Java server runs pretty well for a while with JZMQ. And suddenly it got Assertion failed: check () (msg.cpp:220)

It cannot be caught in JAVA. And the java process is down itself. It seems like Cpp issue in JNI

May I know if any one know what happens in this exception?

Thanks

MobileDev
  • 178
  • 3
  • 14

1 Answers1

2

I've seen this during my first ZMQ tests. In my case the exception was caused by a thread closing a socket opened by another thread. It also happened when two threads used one socket at the same time.

I was breaking ZMQ's rule of sharing sockets among threads.

I suggest to check if a thread is using or closing a socket while it's being in use by another thread.

jschiavon
  • 527
  • 5
  • 10
  • what a great reply that I never see in a sea of google. I will try to check if it is the case, thanks very much – MobileDev Aug 18 '14 at 15:26
  • I have modified my code to use one single thread for ZMQ Context, pub and sub sockets. All other logics are used in separate threads and dispatch to ZMQ thread to publish/Subscribe... Let's see if it works – MobileDev Aug 19 '14 at 13:47
  • I have tested for 3 days and pub sub 3mills messages back and forward. It still keeps alive and has no such error. I will do more testing this weekend to confirm, thank you. – MobileDev Aug 22 '14 at 02:06