[zeromq-dev] proper way to destroy/free zyre resources?

Pieter Hintjens ph at imatix.com
Wed Sep 16 18:47:16 CEST 2015


Weird. Can you print the value of self->actor in zyre.c, after _new
and inside _destroy, to make sure it's not been changed?

Without the destroy you'll get the dangling socket errors.

The code looks correct, I don't see any issue with it. Since you can
reproduce the error, the thing to do is establish at what point the
actor tag gets corrupted, or the actor reference (self->actor in the
zyre object) gets corrupted.

-Pieter

On Wed, Sep 16, 2015 at 3:51 PM, Wynne Adam (CR/RTC3.1-NA)
<Adam.Wynne at us.bosch.com> wrote:
> I can’t see how to properly destroy/free resources in my hand-coded JNI
> wrapper.  I have a JNI destroy method that calls zyre_stop and zyre_destroy:
> https://github.com/zeromq/zyre/blob/master/bindings/java/zyre-jni/src/main/c/org_zyre_Zyre.c#L30
>
>
>
> The problem is that calling this method produces the error:
>
>
>
> src/zactor.c:161: zactor_destroy: Assertion `zactor_is (self)' failed.
>
>
>
> If I remove the zyre_destroy call, I get the errors:
>
>
>
> E: 15-09-16 09:49:31 dangling 'PAIR' socket created at src/zsys.c:379
>
> E: 15-09-16 09:49:31 dangling 'PAIR' socket created at src/zsys.c:380
>
> E: 15-09-16 09:49:31 dangling 'PAIR' socket created at src/zsys.c:379
>
> E: 15-09-16 09:49:31 dangling 'PAIR' socket created at src/zsys.c:380
>
> E: 15-09-16 09:49:31 dangling 'ROUTER' socket created at src/zyre_node.c:83
>
> E: 15-09-16 09:49:31 dangling 'PAIR' socket created at src/zsys.c:379
>
> E: 15-09-16 09:49:31 dangling 'PAIR' socket created at src/zsys.c:380
>
> E: 15-09-16 09:49:31 dangling 'PAIR' socket created at src/zsys.c:379
>
> E: 15-09-16 09:49:31 dangling 'PAIR' socket created at src/zsys.c:380
>
> E: 15-09-16 09:49:31 dangling 'ROUTER' socket created at src/zyre_node.c:83
>
> E: 15-09-16 09:49:31 dangling 'DEALER' socket created at src/zyre_peer.c:115
>
> E: 15-09-16 09:49:31 dangling sockets: cannot terminate ZMQ safely
>
>
>
> Any ideas on what I am missing?
>
>
>
> Thanks
>
> Adam
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



More information about the zeromq-dev mailing list