Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory curruption due to double free #92

Open
zeromqprashant opened this issue Sep 7, 2014 · 2 comments
Open

Memory curruption due to double free #92

zeromqprashant opened this issue Sep 7, 2014 · 2 comments

Comments

@zeromqprashant
Copy link

==8804== Thread 4:
==8804== Invalid read of size 1
==8804== at 0x4A08DAC: memcpy (mc_replace_strmem.c:882)
==8804== by 0x4C78163: zmq::encoder_base_tzmq::v2_encoder_t::encode(unsigned char**, unsigned long) (encoder.hpp:113)
==8804== by 0x4C6ABDA: zmq::stream_engine_t::out_event() (stream_engine.cpp:284)
==8804== by 0x4C526AB: zmq::io_thread_t::in_event() (io_thread.cpp:73)
==8804== by 0x4C51551: zmq::epoll_t::loop() (epoll.cpp:165)
==8804== by 0x4C7128A: thread_routine (thread.cpp:81)
==8804== by 0x3F1AA079D0: start_thread (in /lib64/libpthread-2.12.so)
==8804== by 0x3F1A2E8B7C: clone (in /lib64/libc-2.12.so)
==8804== Address 0x54171df is 735 bytes inside a block of size 736 free'd
==8804== at 0x4A063F0: free (vg_replace_malloc.c:446)
==8804== by 0x4C5713B: zmq::msg_t::close() (msg.cpp:141)
==8804== by 0x4C781F0: zmq::encoder_base_tzmq::v2_encoder_t::encode(unsigned char**, unsigned long) (encoder.hpp:83)
==8804== by 0x4C6ABDA: zmq::stream_engine_t::out_event() (stream_engine.cpp:284)
==8804== by 0x4C526AB: zmq::io_thread_t::in_event() (io_thread.cpp:73)
==8804== by 0x4C51551: zmq::epoll_t::loop() (epoll.cpp:165)
==8804== by 0x4C7128A: thread_routine (thread.cpp:81)
==8804== by 0x3F1AA079D0: start_thread (in /lib64/libpthread-2.12.so)
==8804== by 0x3F1A2E8B7C: clone (in /lib64/libc-2.12.so)
==8804==
==8804== Invalid free() / delete / delete[] / realloc()
==8804== at 0x4A063F0: free (vg_replace_malloc.c:446)
==8804== by 0x4C5713B: zmq::msg_t::close() (msg.cpp:141)
==8804== by 0x4C781F0: zmq::encoder_base_tzmq::v2_encoder_t::encode(unsigned char**, unsigned long) (encoder.hpp:83)
==8804== by 0x4C6ABDA: zmq::stream_engine_t::out_event() (stream_engine.cpp:284)
==8804== by 0x4C526AB: zmq::io_thread_t::in_event() (io_thread.cpp:73)
==8804== by 0x4C51551: zmq::epoll_t::loop() (epoll.cpp:165)
==8804== by 0x4C7128A: thread_routine (thread.cpp:81)
==8804== by 0x3F1AA079D0: start_thread (in /lib64/libpthread-2.12.so)
==8804== by 0x3F1A2E8B7C: clone (in /lib64/libc-2.12.so)
==8804== Address 0x5416f00 is 0 bytes inside a block of size 736 free'd
==8804== at 0x4A063F0: free (vg_replace_malloc.c:446)
==8804== by 0x4C5713B: zmq::msg_t::close() (msg.cpp:141)
==8804== by 0x4C781F0: zmq::encoder_base_tzmq::v2_encoder_t::encode(unsigned char**, unsigned long) (encoder.hpp:83)
==8804== by 0x4C6ABDA: zmq::stream_engine_t::out_event() (stream_engine.cpp:284)
==8804== by 0x4C526AB: zmq::io_thread_t::in_event() (io_thread.cpp:73)
==8804== by 0x4C51551: zmq::epoll_t::loop() (epoll.cpp:165)
==8804== by 0x4C7128A: thread_routine (thread.cpp:81)
==8804== by 0x3F1AA079D0: start_thread (in /lib64/libpthread-2.12.so)
==8804== by 0x3F1A2E8B7C: clone (in /lib64/libc-2.12.so)

Valgrind out put.

Socket type router dealer. This happens right after ERROR or AGAIN.

@zeromqprashant
Copy link
Author

This happens at client side..

@giskook
Copy link

giskook commented Feb 11, 2015

@zeromqprashant I have meet the same problem. I check my code. Because I use one zmq socket in more than one thread.Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants