[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zeromq-dev
Subject:    Re: [zeromq-dev] Assertion failed: false (src/pipe.cpp:429) on disconnecting a SUB Socket.
From:       Luca Boccassi <luca.boccassi () gmail ! com>
Date:       2017-05-11 10:29:06
Message-ID: 1494498546.4886.1.camel () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Wed, 2017-05-10 at 07:14 +0200, Bachmair Florian - flexSolution GmbH
wrote:
> addapted my code, so any call (concerning the zmq socket) now is on
> the  
> same thread, but still the same problem!

Can you share a link to your code on github, or paste it on
pastebin/gist, or a minimal example that reproduces the issue?

It's very hard otherwise to see what's going on

> On 2017-05-09 16:16, Luca Boccassi wrote:
> > It is, as the documentation says sockets are not thread safe and
> > must
> > be created, used and closed from the same thread
> > 
> > http://api.zeromq.org/4-2:zmq-socket
> > 
> > On Tue, 2017-05-09 at 16:00 +0200, Florian Bachmair wrote:
> > > yes it is, but not at the same time. is that a problem?
> > > 
> > > 
> > > On 09.05.2017 12:29, Luca Boccassi wrote:
> > > > Is the same socket being used from multiple thread?
> > > > 
> > > > On Tue, 2017-05-09 at 08:01 +0200, Bachmair Florian -
> > > > flexSolution
> > > > GmbH
> > > > wrote:
> > > > > further output
> > > > > 
> > > > > Assertion failed: false (src/pipe.cpp:429)
> > > > > 
> > > > > #0    0x63835c6c in /home/flex/core-
> > > > > 1.0.0/emerson2/lib/native/libzmq.so
> > > > > (zmq::zmq_abort(char const*)+0x8)
> > > > > #1    0x63846718 in /home/flex/core-
> > > > > 1.0.0/emerson2/lib/native/libzmq.so
> > > > > (zmq::pipe_t::terminate(bool)+0x84)
> > > > > #2    0x63857e58 in /home/flex/core-
> > > > > 1.0.0/emerson2/lib/native/libzmq.so
> > > > > (zmq::socket_base_t::term_endpoint(char const*)+0x19c)
> > > > > #3    0x638bfc0c in /home/flex/core-
> > > > > 1.0.0/emerson2/lib/native/libczmq.so
> > > > > (zsock_disconnect+0x48)
> > > > > 
> > > > > 
> > > > > On 2017-05-09 07:23, Bachmair Florian - flexSolution GmbH
> > > > > wrote:
> > > > > > Hi!
> > > > > > I'm using a JNI Wrapper to use czmq.(with the latest libzmq
> > > > > > and
> > > > > > czmq
> > > > > > from git,compiled yesterday on an arm)
> > > > > > Don't know if this is just a coincidents but this is how I
> > > > > > reproduce
> > > > > > the error:
> > > > > > 
> > > > > >         * start all Applications(6) (on the same host) they
> > > > > > connect
> > > > > > to
> > > > > > each
> > > > > >             other via TCP automatically
> > > > > >         * If I restart 2 applications at the same time, they
> > > > > > may get
> > > > > > new
> > > > > >             Ports, the other applications do recognize that(every
> > > > > > Application
> > > > > >             announces their ports via multicast) and disconnect
> > > > > > from
> > > > > > the
> > > > > > old,
> > > > > >             now invalid socket
> > > > > >         * 1-2 of the Applications crashes with the error
> > > > > > Assertion
> > > > > > failed:
> > > > > >             false (src/pipe.cpp:429) when they try to close the
> > > > > > socket.
> > > > > > 
> > > > > > Any Idea what I am doing wrong here?
> > > > > > 
> > > > > > 
> > > > > > JNIEXPORT void JNICALL
> > > > > > Java_lib_zmq_ZeroMQNative_native_1disconnect(JNIEnv * env,
> > > > > > jobject
> > > > > > object, jstring ip, jint port) {
> > > > > > // ===============================================
> > > > > > // Convert Java Objects to C
> > > > > > // ===============================================
> > > > > >             puts("debug 1");
> > > > > >             fflush(stdout);
> > > > > >             const char* c_ip = (*env)->GetStringUTFChars(env, ip,
> > > > > > 0);
> > > > > >             printf("debug 2: %s:%d \n",c_ip,port);
> > > > > >             fflush(stdout);
> > > > > > // ===============================================
> > > > > > // Disconnect from tcp://ip:port
> > > > > > // ===============================================
> > > > > >             zsock_disconnect(subscriber, "tcp://%s:%d", c_ip,
> > > > > > port);
> > > > > >             //Assertion failed: false (src/pipe.cpp:429)
> > > > > > 
> > > > > >             puts("debug 3");
> > > > > >             fflush(stdout);
> > > > > > // ===============================================
> > > > > > // Free Resources
> > > > > > // ===============================================
> > > > > >             (*env)->ReleaseStringUTFChars(env, ip, c_ip);
> > > > > >             puts("debug 4");
> > > > > >             fflush(stdout);
> > > > > > }
> > > > > > 
> > > > > > 
> > > > > > _______________________________________________
> > > > > > zeromq-dev mailing list
> > > > > > zeromq-dev@lists.zeromq.org
> > > > > > https://lists.zeromq.org/mailman/listinfo/zeromq-dev
> > > > > 
> > > > > _______________________________________________
> > > > > zeromq-dev mailing list
> > > > > zeromq-dev@lists.zeromq.org
> > > > > https://lists.zeromq.org/mailman/listinfo/zeromq-dev
> > > > > 
> > > > > 
> > > > > _______________________________________________
> > > > > zeromq-dev mailing list
> > > > > zeromq-dev@lists.zeromq.org
> > > > > https://lists.zeromq.org/mailman/listinfo/zeromq-dev
> > > 
> > > 
> > > 
> > > _______________________________________________
> > > zeromq-dev mailing list
> > > zeromq-dev@lists.zeromq.org
> > > https://lists.zeromq.org/mailman/listinfo/zeromq-dev
> 
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev

["signature.asc" (application/pgp-signature)]
[Attachment #6 (text/plain)]

_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic