[zeromq-dev] OpenPGM & segfault - assertion failed

Steven McCoy steven.mccoy at miru.hk
Wed May 12 06:58:20 CEST 2010


lol, someone point me to details memory management with references, I'm
befuddled in C world,

Making this change, as peer_info is only on the stack,

        if (it == peers.end ()) {
//            peer_info_t peer_info = {false, NULL};
//            it = peers.insert (std::make_pair (*tsi, peer_info)).first;
peer_info_t* peer_info = new peer_info_t;
peer_info->joined = false;
peer_info->decoder = NULL;
it = peers.insert (std::make_pair (*tsi, *peer_info)).first;
        }

I see another error, this from pgm_socket and out of bounds index,

18991
18992

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x42653950 (LWP 15651)]
0x00007f4d3520efc5 in zmq::pgm_socket_t::receive (this=0x60b0b8,
raw_data_=0x42652340, tsi_=0x42652338) at pgm_socket.cpp:496
496    zmq_assert (pgm_msgv [pgm_msgv_processed].msgv_len == 1);
(gdb) bt
#0  0x00007f4d3520efc5 in zmq::pgm_socket_t::receive (this=0x60b0b8,
raw_data_=0x42652340, tsi_=0x42652338)
    at pgm_socket.cpp:496
#1  0x00007f4d3520b749 in zmq::pgm_receiver_t::in_event (this=0x60b070) at
pgm_receiver.cpp:137
#2  0x00007f4d35202cf3 in zmq::epoll_t::loop (this=0x608140) at
epoll.cpp:197
#3  0x00007f4d35202da3 in zmq::epoll_t::worker_routine (arg_=0x608140) at
epoll.cpp:210
#4  0x00007f4d35224b69 in zmq::thread_t::thread_routine (arg_=0x608180) at
thread.cpp:99
#5  0x00007f4d33bcc3f7 in start_thread () from /lib/libpthread.so.0
#6  0x00007f4d3478ab4d in clone () from /lib/libc.so.6
#7  0x0000000000000000 in ?? ()
(gdb) print pgm_msgv_processed
$5 = 434135968768

-- 
Steve-o
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100512/6be7dc28/attachment.htm>


More information about the zeromq-dev mailing list