mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-01 10:50:28 +08:00
Merge pull request #2656 from bluca/unwind
Problems: use-before-initialise error in print_backtrace, test_security_curve sometimes fails due to unexpected ECONNRESET
This commit is contained in:
commit
98a3bb6f24
@ -415,6 +415,10 @@ void zmq::print_backtrace (void)
|
||||
if (unw_get_proc_info (&cursor, &p_info))
|
||||
break;
|
||||
|
||||
rc = unw_get_proc_name (&cursor, func_name, 256, &offset);
|
||||
if (rc == -UNW_ENOINFO)
|
||||
strcpy(func_name, "?");
|
||||
|
||||
addr = (void *)(p_info.start_ip + offset);
|
||||
|
||||
if (dladdr (addr, &dl_info) && dl_info.dli_fname)
|
||||
@ -422,10 +426,6 @@ void zmq::print_backtrace (void)
|
||||
else
|
||||
file_name = "?";
|
||||
|
||||
rc = unw_get_proc_name (&cursor, func_name, 256, &offset);
|
||||
if (rc == -UNW_ENOINFO)
|
||||
strcpy(func_name, "?");
|
||||
|
||||
demangled_name = abi::__cxa_demangle (func_name, NULL, NULL, &rc);
|
||||
|
||||
printf ("#%u %p in %s (%s+0x%lx)\n", frame_n++, addr, file_name,
|
||||
|
@ -276,8 +276,8 @@ void expect_new_client_curve_bounce_fail (void *ctx,
|
||||
// expects that one or more occurrences of the expected event are received
|
||||
// via the specified socket monitor
|
||||
// returns the number of occurrences of the expected event
|
||||
// interrupts, if a ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL/EPIPE occurs;
|
||||
// in this case, 0 is returned
|
||||
// interrupts, if a ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL/EPIPE/ECONNRESET
|
||||
// occurs; in this case, 0 is returned
|
||||
// this should be investigated further, see
|
||||
// https://github.com/zeromq/libzmq/issues/2644
|
||||
int expect_monitor_event_multiple (void *server_mon,
|
||||
@ -295,8 +295,11 @@ int expect_monitor_event_multiple (void *server_mon,
|
||||
!= -1) {
|
||||
timeout = 250;
|
||||
|
||||
// ignore errors with EPIPE, which happen sporadically, see above
|
||||
if (event == ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL && err == EPIPE) {
|
||||
// ignore errors with EPIPE/ECONNRESET, which happen sporadically
|
||||
// ECONNRESET can happen on very slow machines, when the engine writes
|
||||
// to the peer and then tries to read the socket before the peer reads
|
||||
if (event == ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL &&
|
||||
(err == EPIPE || err == ECONNRESET)) {
|
||||
fprintf (stderr, "Ignored event: %x (err = %i)\n", event, err);
|
||||
client_closed_connection = 1;
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user