Unitialized ZeroMQ message is deinitialized
In server/server.cxx
, the function handle_data_response(assimilator)
initializes a ZeroMQ message for hidden data if the condition is hidden_part.send_count > 0
in line 1145 holds. The message is deinitialized (closed) if runner_timestep == current_step
. I did not understand the relationship between the variables in the branch conditions but adding assert(hidden_part.send_count > 0)
before closing the message causes reliable assertion failures.
if (hidden_part.send_count > 0) // line 1145
{
assert_more_zmq_messages(data_response_socket);
zmq_msg_init(&data_msg_hidden); // INITIALIZATION HERE
zmq_msg_recv(&data_msg_hidden, data_response_socket, 0);
assert(zmq_msg_size(&data_msg_hidden) == hidden_part.send_count *
sizeof(VEC_T));
values_hidden = reinterpret_cast<VEC_T*>(zmq_msg_data(
&data_msg_hidden));
}
if (runner_timestep == current_step) // line 1160
{
// snip
store_background_state_part(part,
reinterpret_cast
<VEC_T*>(zmq_msg_data(
&data_msg)), hidden_part,
values_hidden);
assert(hidden_part.send_count > 0); // new assertion
zmq_msg_close(&data_msg_hidden); // DEINIT, line 1174 in unmodified code
// snip
}
Error message:
melissa_da_server: /home/ubuntu/melissa-da/server/server.cxx:1174: void handle_data_response(std::shared_ptr<Assimilator>&): Assertion `hidden_part.send_count > 0' failed.
[ubuntu-20-da:309096] *** Process received signal ***
[ubuntu-20-da:309096] Signal: Aborted (6)
[ubuntu-20-da:309096] Signal code: (-6)
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7f153e0d618b]
[ubuntu-20-da:309096] [ 1] /lib/x86_64-linux-gnu/libc.so.6(+0x25729)[0x7f153e0b5729]
[ubuntu-20-da:309096] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7fbe59ef1859]
[ubuntu-20-da:309096] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x36f36)[0x7f153e0c6f36]
[ubuntu-20-da:309096] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x36f36)[0x7fbe59f02f36]
[ubuntu-20-da:309096] [ 5] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f153e0b70b3]
[ubuntu-20-da:309096] [ 6] melissa_da_server(+0x60582)[0x5604778e0582]
[ubuntu-20-da:309096] [ 7] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7fbe59ef30b3]
[ubuntu-20-da:309096] [ 8] melissa_da_server(+0x17bfe)[0x560477897bfe]
[ubuntu-20-da:309096] *** End of error message ***
Failing tests:
- 11 - test-crashing-runner (Timeout)
- 12 - test-crashing-server1 (Timeout)
- 13 - test-crashing-server2 (Timeout)
- 14 - test-different-parallelism (Timeout)
- 15 - test-never-connecting-runner (Timeout)