Closed potatogim closed 9 years ago
Just one nitpick: If we're ignoring weird cases, it might help to actually show the user that this happened as a warning?
Oh, that it is true.
Frankly speaking, I don't know what is best way for notify that... :-]
Would you let me know how can we notify that be more cleanly?
see perldoc perlapi
, where there's an entry for warn
:
warn This is an XS interface to Perl's "warn" function.
Take a sprintf-style format pattern and argument list. These
are used to generate a string message. If the message does not
end with a newline, then it will be extended with some
indication of the current location in the code, as described
for "mess_sv".
The error message or object will by default be written to
standard error, but this is subject to modification by a
$SIG{__WARN__} handler.
Unlike with "croak", "pat" is not permitted to be null.
void warn(const char *pat, ...)
I haven't checked, but perhaps something like warn("Invalid socket %p found in zmq_poll(), ignoring", socket)
?
Wow, Thanks!
I think our users need to what socket of the pollitems in invalid.
as this URL(https://metacpan.org/pod/ZMQ::LibZMQ3#rv-zmq_poll-pollitems-timeout), zmq_poll()
is known that it accepts two parameters \@pollitems, $timeout
.
How does this look?
1070 if (mg->mg_ptr == NULL)
1071 warn("Invalid socket found with pollitems[%i] in zmq_poll(), ignoring", i);
1072 continue;
1073 }
Results
Invalid socket found with pollitems[0] in zmq_poll(), ignoring at ~~blahblah~~
Invalid socket found with pollitems[1] in zmq_poll(), ignoring at ~~blahblah~~
Invalid socket found with pollitems[2] in zmq_poll(), ignoring at ~~blahblah~~
lgtm. waiting for travis. I will be out soon, so will merge after I come back in a few hours.
Yep. travis seems to be passed. doesn't it?
Sorry, this completely went unnoticed. :/
Hi, It's been a long time :-)
When I use
zmq_poll()
, It falls to segmentation fault.Interestingly, that situation not always.
so I have traced this code with GDB, I met this situation like that.
I have put this code into the
xs/perl_libzmq3.xs
and then I have seen this results.
Normal case
Fault case
I'm guessing that is caused by calling
zmq_poll()
in a thread whereas callingzmq_close(), zmq_term()
finished in another thread.so I'm trying to solve that like that... :-)
I want you will have a nice day!