{"action":"opened","issue":{"url":"https://api.github.com/repos/zeromq/czmq/issues/1281","labels_url":"https://api.github.com/repos/zeromq/czmq/issues/1281/labels{/name}","comments_url":"https://api.github.com/repos/zeromq/czmq/issues/1281/comments","events_url":"https://api.github.com/repos/zeromq/czmq/issues/1281/events","html_url":"https://github.com/zeromq/czmq/issues/1281","id":124562205,"number":1281,"title":"Asserts when more than one zbeacon is used in a row","user":{"login":"paddor","id":8876,"avatar_url":"https://avatars.githubusercontent.com/u/8876?v=3","gravatar_id":"","url":"https://api.github.com/users/paddor","html_url":"https://github.com/paddor","followers_url":"https://api.github.com/users/paddor/followers","following_url":"https://api.github.com/users/paddor/following{/other_user}","gists_url":"https://api.github.com/users/paddor/gists{/gist_id}","starred_url":"https://api.github.com/users/paddor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paddor/subscriptions","organizations_url":"https://api.github.com/users/paddor/orgs","repos_url":"https://api.github.com/users/paddor/repos","events_url":"https://api.github.com/users/paddor/events{/privacy}","received_events_url":"https://api.github.com/users/paddor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-01T21:31:14Z","updated_at":"2016-01-01T21:31:14Z","closed_at":null,"body":"ZMQ asserts [here in signaler.cpp](https://github.com/zeromq/libzmq/blob/master/src/signaler.cpp#L359) when waiting for the second zbeacon's termination signal. It dies with `Assertion failed: nbytes == sizeof (dummy) (src/signaler.cpp:359)`.\r\n\r\nThis doesn't happen when doing the exact same thing with `zauth`. If the two lines are changed (one in `#initialize` and one in `#wait`) for `zauth`, it works as expected.\r\n\r\nHere's a small script that shows the error, based on the generated Ruby binding:\r\n\r\n```ruby\r\n#!/usr/bin/env rspec\r\n\r\n# Prerequisites:\r\n#\r\n# * RSpec\r\n# * czmq-ffi-gen\r\n\r\nrequire 'czmq-ffi-gen'\r\n\r\nCZMQ::FFI::Signals.disable_default_handling\r\n\r\nclass Beacon\r\n  # function pointer to the `zbeacon()` function\r\n  ZBEACON_FPTR = ::CZMQ::FFI.ffi_libraries.each do |dl|\r\n    fptr = dl.find_function(\"zbeacon\")\r\n    break fptr if fptr\r\n  end\r\n  raise LoadError, \"couldn't find zbeacon()\" if ZBEACON_FPTR.nil?\r\n\r\n  # function pointer to the `zauth()` function\r\n  ZAUTH_FPTR = ::CZMQ::FFI.ffi_libraries.each do |dl|\r\n    fptr = dl.find_function(\"zauth\")\r\n    break fptr if fptr\r\n  end\r\n  raise LoadError, \"couldn't find zauth()\" if ZAUTH_FPTR.nil?\r\n\r\n  def initialize\r\n    @zactor = CZMQ::FFI::Zactor.new(ZBEACON_FPTR, nil)\r\n#    @zactor = CZMQ::FFI::Zactor.new(ZAUTH_FPTR, nil)\r\n    verbose\r\n  end\r\n\r\n  def verbose\r\n    CZMQ::FFI::Zstr.send(@zactor, \"VERBOSE\")\r\n#    wait # NOTE: only for zauth\r\n  end\r\n\r\n  def terminate\r\n    CZMQ::FFI::Zstr.send(@zactor, \"$TERM\")\r\n    sleep 0.1 # mitigate race condition between handler termination signal and destruction of pipe\r\n    wait\r\n  end\r\n\r\n  def wait\r\n    warn \"#{@zactor.to_ptr}: waiting for signal from zactor ...\"\r\n    CZMQ::FFI::Zsock.wait(@zactor)\r\n    warn \"#{@zactor.to_ptr}: got signal.\"\r\n  end\r\nend\r\n\r\ndescribe Beacon do\r\n  let(:beacon) { Beacon.new }\r\n\r\n  after(:each) { beacon.terminate }\r\n\r\n  it \"can instantiate and terminate\" do\r\n    beacon\r\n  end\r\n  it \"can do it again\" do\r\n    beacon\r\n  end\r\nend\r\n```\r\n\r\nThanks for any input."}}