"make check" produces: Assertion `!strcmp (event.data.disconnected.addr, addr)' failed.

Description

"make check" produces:
...
PASS: test_term_endpoint
lt-test_monitor: test_monitor.cpp:81: void* req_socket_monitor(void*): Assertion `!strcmp (event.data.disconnected.addr, addr)' failed.
/bin/sh: line 5: 13875 Aborted (core dumped) ${dir}$tst
FAIL: test_monitor
...

Environment

Linux fedora17 3.6.1-1.fc17.i686.PAE #1 SMP Wed Oct 10 12:32:58 UTC 2012 i686 i686 i386 GNU/Linux

Activity

Show:
Adrien Kunysz
November 16, 2012, 11:45 AM
Edited

Either this bug is not fixed or I don't understand how this bug tracker and the git repository are used. This bug is now marked as fixed in 3.2.2 and 3.3.0. On the download page at http://www.zeromq.org/intro:get-the-software I cannot find 3.3.0 or 3.2.2. There is a 3.2.1-rc2 but that is the version against which I had the problem.

Looking at the git repo, my understanding is that the bug is expected to be fixed with these changesets:

commit 7f8157524525ee8544f6637fb9bcf4acb9b14915
Merge: f976e8c c05a1b1
Author: Pieter Hintjens <ph@imatix.com>
Date: Wed Nov 14 02:38:02 2012 -0800

Merge pull request #59 from hintjens/master

Backported fix for

commit c05a1b1f26497adf0f4adce2d62cc37c4349bba3
Author: Lourens Naudé <lourens@methodmissing.com>
Date: Wed Nov 14 09:51:24 2012 +0000

Backported fix for addresses on triggered events

I have verified that applying that patch to zeromq-3.2.1-rc2 does not
resolve the problem.

zeromq-3.2.1$ patch -p1 < /usr/scratch/bdale/trac/6759/libzmq-450.diff
patching file src/socket_base.cpp
zeromq-3.2.1$ make check
Making check in src
make[1]: Entering directory `/tmp/zeromq-3.2.1/src'
CXX libzmq_la-socket_base.lo
CXXLD libzmq.la
make[1]: Leaving directory `/tmp/zeromq-3.2.1/src'
Making check in doc
make[1]: Entering directory `/tmp/zeromq-3.2.1/doc'
make[1]: Nothing to be done for `check'.
make[1]: Leaving directory `/tmp/zeromq-3.2.1/doc'
Making check in perf
make[1]: Entering directory `/tmp/zeromq-3.2.1/perf'
CXXLD local_lat
CXXLD remote_lat
CXXLD local_thr
CXXLD remote_thr
CXXLD inproc_lat
CXXLD inproc_thr
make[1]: Leaving directory `/tmp/zeromq-3.2.1/perf'
Making check in tests
make[1]: Entering directory `/tmp/zeromq-3.2.1/tests'
CXXLD test_pair_inproc
CXXLD test_pair_tcp
CXXLD test_reqrep_inproc
CXXLD test_reqrep_tcp
CXXLD test_hwm
CXXLD test_reqrep_device
CXXLD test_sub_forward
CXXLD test_invalid_rep
CXXLD test_msg_flags
CXXLD test_connect_resolve
CXXLD test_connect_delay
CXXLD test_last_endpoint
CXXLD test_term_endpoint
CXXLD test_monitor
CXXLD test_router_mandatory
CXXLD test_shutdown_stress
CXXLD test_pair_ipc
CXXLD test_reqrep_ipc
CXXLD test_timeo
make check-TESTS
make[2]: Entering directory `/tmp/zeromq-3.2.1/tests'
test_pair_inproc running...
PASS: test_pair_inproc
test_pair_tcp running...
PASS: test_pair_tcp
test_reqrep_inproc running...
PASS: test_reqrep_inproc
test_reqrep_tcp running...
PASS: test_reqrep_tcp
test_hwm running...
PASS: test_hwm
test_reqrep_device running...
PASS: test_reqrep_device
test_sub_forward running...
PASS: test_sub_forward
test_invalid_rep running...
PASS: test_invalid_rep
PASS: test_msg_flags
test_connect_resolve running...
PASS: test_connect_resolve
test_connect_delay running...
Rerunning with DELAY_ATTACH_ON_CONNECT
Running DELAY_ATTACH_ON_CONNECT with disconnect
lt-test_connect_delay: test_connect_delay.cpp:80: void* server(void*): Assertion `rc != -1' failed.
/bin/sh: line 5: 30959 Aborted (core dumped) ${dir}$tst
FAIL: test_connect_delay
PASS: test_last_endpoint
unbind endpoint test running...
disconnect endpoint test running...
PASS: test_term_endpoint
lt-test_monitor: test_monitor.cpp:81: void* req_socket_monitor(void*): Assertion `!strcmp (event.data.disconnected.addr, addr)' failed.
/bin/sh: line 5: 31043 Aborted (core dumped) ${dir}$tst
FAIL: test_monitor
test_router_mandatory running...
PASS: test_router_mandatory
test_shutdown_stress running...
PASS: test_shutdown_stress
test_pair_ipc running...
PASS: test_pair_ipc
test_reqrep_ipc running...
PASS: test_reqrep_ipc
test_timeo running...
lt-test_timeo: test_timeo.cpp:77: int main(): Assertion `elapsed > 440000 && elapsed < 550000' failed.
/bin/sh: line 5: 32248 Aborted (core dumped) ${dir}$tst
FAIL: test_timeo
============================================
3 of 19 tests failed
Please report to zeromq-dev@lists.zeromq.org
============================================
make[2]: *** [check-TESTS] Error 1
make[2]: Leaving directory `/tmp/zeromq-3.2.1/tests'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/tmp/zeromq-3.2.1/tests'
make: *** [check-recursive] Error 1
zeromq-3.2.1$ gdb tests/.libs/lt-test_monitor tests/core.31043
GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-23.el5_5.2)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /tmp/zeromq-3.2.1/tests/.libs/lt-test_monitor...done.
[New Thread 31066]
[New Thread 31064]
[New Thread 31063]
[New Thread 31062]
[New Thread 31043]
Reading symbols from /tmp/zeromq-3.2.1/src/.libs/libzmq.so.3...done.
Loaded symbols for /tmp/zeromq-3.2.1/src/.libs/libzmq.so.3
Reading symbols from /lib64/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/librt.so.1
Reading symbols from /lib64/libpthread.so.0...(no debugging symbols found)...done.
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /usr/lib64/libstdc++.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libstdc++.so.6
Reading symbols from /lib64/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /lib64/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libgcc_s.so.1
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2

warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fff417fd000
Core was generated by `/tmp/zeromq-3.2.1/tests/.libs/lt-test_monitor'.
Program terminated with signal 6, Aborted.
#0 0x00002afd2ae8c285 in raise () from /lib64/libc.so.6
(gdb) bt
#0 0x00002afd2ae8c285 in raise () from /lib64/libc.so.6
#1 0x00002afd2ae8dd30 in abort () from /lib64/libc.so.6
#2 0x00002afd2ae85706 in __assert_fail () from /lib64/libc.so.6
#3 0x0000000000401586 in req_socket_monitor (ctx=<value optimized out>) at test_monitor.cpp:81
#4 0x00002afd2a4b577d in start_thread () from /lib64/libpthread.so.0
#5 0x00002afd2af2fc1d in clone () from /lib64/libc.so.6
(gdb) frame 3
#3 0x0000000000401586 in req_socket_monitor (ctx=<value optimized out>) at test_monitor.cpp:81
81 assert (!strcmp (event.data.disconnected.addr, addr));
(gdb) list
76 assert (!strcmp (event.data.closed.addr, addr));
77 req_socket_events |= ZMQ_EVENT_CLOSED;
78 break;
79 case ZMQ_EVENT_DISCONNECTED:
80 assert (event.data.disconnected.fd != 0);
81 assert (!strcmp (event.data.disconnected.addr, addr));
82 req_socket_events |= ZMQ_EVENT_DISCONNECTED;
83 break;
84 }
85 }
(gdb) p event.data.disconnected.addr
$1 = 0x199933b8 "p`\233\031"
(gdb) p addr
$2 = 0x401fd7 "tcp://127.0.0.1:5560"
(gdb)

Adrien Kunysz
November 16, 2012, 11:45 AM

As per previous comment. I am still able to reproduce the issue after applying the patch.

Lourens Naudé
November 16, 2012, 5:24 PM
Adrien Kunysz
November 16, 2012, 5:50 PM

I have applied fdf162a117782720ed8b7a1cbb71194f0c5136a9 on top of 3.2.1-rc2 and the test now crashes earlier:

lt-test_monitor: test_monitor.cpp:66: void* req_socket_monitor(void*): Assertion `!strcmp (event.data.connect_delayed.addr, addr)' failed.
/bin/sh: line 5: 15795 Aborted (core dumped) ${dir}$tst
FAIL: test_monitor

(gdb) bt
#0 0x00002af48cbaf285 in raise () from /lib64/libc.so.6
#1 0x00002af48cbb0d30 in abort () from /lib64/libc.so.6
#2 0x00002af48cba8706 in __assert_fail () from /lib64/libc.so.6
#3 0x00000000004015d1 in req_socket_monitor (ctx=<value optimized out>)
at test_monitor.cpp:66
#4 0x00002af48c1d877d in start_thread () from /lib64/libpthread.so.0
#5 0x00002af48cc52c1d in clone () from /lib64/libc.so.6
(gdb) frame 3
#3 0x00000000004015d1 in req_socket_monitor (ctx=<value optimized out>)
at test_monitor.cpp:66
66 assert (!strcmp (event.data.connect_delayed.addr, addr));
(gdb) list
61 req_socket_events |= ZMQ_EVENT_CONNECTED;
62 req2_socket_events |= ZMQ_EVENT_CONNECTED;
63 break;
64 case ZMQ_EVENT_CONNECT_DELAYED:
65 assert (event.data.connect_delayed.err != 0);
66 assert (!strcmp (event.data.connect_delayed.addr, addr));
67 req_socket_events |= ZMQ_EVENT_CONNECT_DELAYED;
68 break;
69 case ZMQ_EVENT_CLOSE_FAILED:
70 assert (event.data.close_failed.err != 0);
(gdb) p event.data.connect_delayed.addr
$2 = 0x1aba43b8 ""
(gdb) p addr
$3 = 0x401fd7 "tcp://127.0.0.1:5560"
(gdb) p event
$4 = {event = 2, data = {connected = {addr = 0x1aba43b8 "", fd = 115},
connect_delayed = {addr = 0x1aba43b8 "", err = 115}, connect_retried = {
addr = 0x1aba43b8 "", interval = 115}, listening = {
addr = 0x1aba43b8 "", fd = 115}, bind_failed = {addr = 0x1aba43b8 "",
err = 115}, accepted = {addr = 0x1aba43b8 "", fd = 115},
accept_failed = {addr = 0x1aba43b8 "", err = 115}, closed = {
addr = 0x1aba43b8 "", fd = 115}, close_failed = {addr = 0x1aba43b8 "",
err = 115}, disconnected = {addr = 0x1aba43b8 "", fd = 115}}}

If I apply both fdf162a117782720ed8b7a1cbb71194f0c5136a9 and c05a1b1f26497adf0f4adce2d62cc37c4349bba3 I see the same problem:

lt-test_monitor: test_monitor.cpp:66: void* req_socket_monitor(void*): Assertion `!strcmp (event.data.connect_delayed.addr, addr)' failed.
/bin/sh: line 5: 19247 Aborted (core dumped) ${dir}$tst
FAIL: test_monitor

PieterP
November 23, 2012, 7:46 AM

Fixed in 3.3 master and backported to 3.2 stable.

Fixed

Assignee

Unassigned

Reporter

Rick Maus

Labels

Components

Fix versions

Affects versions

Priority

Minor
Configure