erlzmq icon indicating copy to clipboard operation
erlzmq copied to clipboard

Hard crash scenario with req socket in gen_server

Open gar1t opened this issue 13 years ago • 1 comments

I'm trying to use a zmq socket within a gen_server. When the gen_server process crashes (including normal gen process exits), the VM crashes. Crash behavior when running from an escript is inconsistent but includes:

  • Program hangs without exiting
  • Various assertion errors (see below)
  • segfault

Some of the assertion errors:

{"init terminating in do_boot",timeout} 
Bad file descriptor
rc != -1 (epoll.cpp:68)
Aborted

and:

{"init terminating in do_boot",stop}
Bad file descriptor
nbytes != -1 (mailbox.cpp:189)
Aborted

Please refer to these two files when trying to reproduce:

  • https://github.com/gar1t/erlzmq/blob/master/src/zmq_reqclient2.erl
  • https://github.com/gar1t/erlzmq/blob/master/test/reqclient2.es

I see this behavior on the current zeromq/erlzmq master.

gar1t avatar Feb 25 '11 23:02 gar1t

Can you run this in gdb and get a backtrace? You'd have to modify erl script to call gdb.

dhammika avatar Feb 28 '11 07:02 dhammika