[zeromq-dev] Signaler.cpp hangs on windows intermittently

Michał Sznajder michalsznajder at gmail.com
Thu May 9 17:06:17 CEST 2013


On Thu, May 9, 2013 at 4:08 PM, KIU Shueng Chuan <nixchuan at gmail.com> wrote:
> Browsing through the code history, ephemeral ports were originally used
> before switching over to fixed port 5905.
>
> Does anyone know the reason for the change to fixed port?

I might have been related to
http://lists.zeromq.org/pipermail/zeromq-dev/2011-September/013450.html

>
> We might want to find out why before making any changes.
>
> On 9 May, 2013 9:55 PM, "Pieter Hintjens" <ph at imatix.com> wrote:
>>
>> Martin,
>>
>> I think evreryone liked the idea of ephemeral ports, but it needs
>> someone who can reproduce the problem to make the change and pull
>> request. Any volunteers?
>>
>> -Pieter
>>
>> On Thu, May 9, 2013 at 4:52 AM, Martin Robinson
>> <martin.robinson at dai.co.uk> wrote:
>> > Pieter,
>> >
>> > If making changes to this area of signaller.cpp, you might also review
>> > the change I suggested back on 22nd March to make this use ephemeral ports
>> > instead of a fixed port number.  Seems to solve the problem completely of
>> > the connect failing on XP in signaler_t::make_fdpair.
>> >
>> > Martin
>> >
>> > -----Original Message-----
>> > From: zeromq-dev-bounces at lists.zeromq.org
>> > [mailto:zeromq-dev-bounces at lists.zeromq.org] On Behalf Of Pieter Hintjens
>> > Sent: 06 May 2013 20:55
>> > To: ZeroMQ development list
>> > Subject: Re: [zeromq-dev] Signaler.cpp hangs on windows intermittently
>> >
>> > Has this been fixed on master but not backported to 3.x?
>> >
>> > Usually it's up to individual contributors to either do the backport (a
>> > git cherrypick) or ask someone to help do it.
>> >
>> > I'm happy to backport the fix for the next 3.2.4 release if someone
>> > tells me what commit it was.
>> >
>> > -Pieter
>> >
>> > On Mon, May 6, 2013 at 8:32 PM, Felipe Farinon
>> > <felipe.farinon at powersyslab.com> wrote:
>> >> Why wasn't this patch released yet?
>> >>
>> >> In my application i'm trying to fix it by using Mutex considering the
>> >> case that waiting (WaitForSingleObject) on the mutex results in
>> >> WAIT_ABANDONED. It seems that it has been fixed. Should I submit a
>> >> patch?
>> >>
>> >> Em 19/03/2013 16:45, Pau escreveu:
>> >>> Hi,
>> >>>
>> >>> I had this problem some weeks ago. This was my problem:
>> >>>
>> >>> I do not know all possible reasons to generate a fatal wsa_assert(..)
>> >>> but there is at least one:
>> >>>
>> >>> I have seen that in XP it is possible that line 301  rc = connect
>> >>> (*w_, (sockaddr *) &addr, sizeof (addr)); returns an error when a
>> >>> socket tries to connect to 5905 and this has happened many times.
>> >>> Windows uses port numbers starting near 1400 and XP has a limit at
>> >>> 5000.
>> >>> In W7 this does not look as a problem because maximum is 65000 It
>> >>> sounds as if the number was big enough but apart from the fact that
>> >>> ZMQ uses a big number of connections (at least in my tests) I have
>> >>> experienced that Windows jumps port numbers by 7, so 5000 happens
>> >>> sometimes with catastrophic consequences.
>> >>>
>> >>> Perhaps there are other reasons (actually this problem does not
>> >>> happen like that in W7) anyway whatever crashes between
>> >>>
>> >>> HANDLE sync = CreateEvent (NULL, FALSE, TRUE, TEXT
>> >>> ("zmq-signaler-port-sync")); and SetEvent (sync);
>> >>>
>> >>> will leave the event signaled and any other application in the system
>> >>> will hang. Closing all apps in a system fixes it.
>> >>>
>> >>> KIU Shueng Chuan submitted a patch that sets the event when crash
>> >>> avoiding other applications to ge hanged:
>> >>>
>> >>> https://github.com/zeromq/libzmq/pull/514
>> >>>
>> >>> That worked for me...
>> >>>
>> >>> If you search for "zmq-signaler-port-sync" in previous mails in this
>> >>> list you will see the complete thread.
>> >>>
>> >>> best,
>> >>>
>> >>> Pau
>> >>>
>> >>> El 19/03/2013 17:18, Felipe Farinon escribió:
>> >>>> Hi,
>> >>>>
>> >>>> The code
>> >>>> HANDLE sync = CreateEvent (&sa, FALSE, TRUE, TEXT
>> >>>> ("Global\\zmq-signaler-port-sync"));
>> >>>>
>> >>>> in signaler.cpp:262 hangs intermittently when starting zeromq
>> >>>> context through zmq_init in my application. I'm not able to
>> >>>> reproduce this bug with a minimal test case. I'm running my
>> >>>> application in a Windows 7 with zeromq compiled with VS2010.

Michał



More information about the zeromq-dev mailing list