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

List:       zeromq-dev
Subject:    Re: [zeromq-dev] proper way to destroy/free zyre resources?
From:       Pieter Hintjens <ph () imatix ! com>
Date:       2015-09-16 16:47:16
Message-ID: CADL5_shiVdKJKwA8SoJYJEzMMiknfGHn91hDm+MTrsmBjoia5w () mail ! gmail ! com
[Download RAW message or body]

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@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@lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://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