[zeromq-dev] SEHException 0x80004005 from ZeroMQ/libzmq

Aaron Friesen AFriesen at spirae.com
Mon Nov 14 20:30:15 CET 2016


All,

Getting an SEHException 0x80004005 from ZeroMQ (4.1.0.21) / libzmq (4.1.5.0)

Multiple processes went down with the same exception at the same time.

Was not able to get a dump but the application logs showed the following stack trace:

System.Exception System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
at ZeroMQ.lib.zmq.zmq_msg_send(IntPtr msg, IntPtr socket, Int32 flags)
at ZeroMQ.ZSocket.SendFrame(ZFrame frame, ZSocketFlags flags, ZError& error)
at ZeroMQ.ZSocket.SendFrames(IEnumerable`1 frames, Int32& sent, ZSocketFlags flags, ZError& error)
at ZeroMQ.ZSocket.SendFrames(IEnumerable`1 frames, ZSocketFlags flags, ZError& error)
at ZeroMQ.ZSocket.SendMessage(ZMessage msg, ZSocketFlags flags, ZError& error)
at ZeroMQ.ZSocket.SendMessage(ZMessage msg, ZSocketFlags flags)
at ZeroMQ.ZSocket.SendMessage(ZMessage msg)
at xxxxxx.SocketsThread(Object eventWaitHandle)

No line numbers available, but based on the logged message, it would have occurred in the following code.  Because the stack trace does not include any of the calls within the try block (PollIn, ProcessRequest, ProcessSubscription), I am at a loss as to what exactly was executing at the time of the exception that was calling SendMessage.

Does anyone have any ideas as to what I might be doing wrong, or what the problem might be and how to avoid it?



                ZSocket[] sockets = new ZSocket[] { _requestSocket, _subscriberSocket };
                ZPollItem[] pollItems = new ZPollItem[] { ZPollItem.CreateReceiver(), ZPollItem.CreateReceiver() };
                ZMessage[] messages = null;

                try
                {
                    TimeSpan timeout = TimeSpan.FromMilliseconds(100);

                    while (_run)
                    {
                        if (ZPollItems.PollIn(sockets, pollItems, out messages, out error, timeout))
                        {
                            if (error == ZError.EAGAIN)
                                continue;

                            if (error == ZError.ETERM)
                                break;

                            if (messages == null)
                                continue;

                            if (messages[0] != null)    // Request
                                ProcessRequest(messages[0]);

                            if (messages[1] != null)    // Subscription
                                ProcessSubscription(messages[1]);
                        }
                        else
                        {
                            if (error == ZError.EAGAIN)
                                continue;

                            if (error != ZError.None)
                                break;
                        }
                    }
                }
                catch (Exception ex)
                {
                    if (!(ex is ThreadAbortException))
                    {
                        _logger.FatalException(string.Format("Exception encountered while polling for messages on sockets. Thread '{0}' shutting down.", threadName), ex);

                        Environment.Exit(-1);
                    }
                }

Thank you in advance,

Aaron Friesen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20161114/c464a782/attachment.htm>


More information about the zeromq-dev mailing list