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

double free or corruption (!prev) #4770

Open
hong-jing opened this issue Feb 13, 2025 · 0 comments
Open

double free or corruption (!prev) #4770

hong-jing opened this issue Feb 13, 2025 · 0 comments

Comments

@hong-jing
Copy link

#00 pc 0000000000081868 /lib64/libc.so.6
#01 pc 0000000000039cf8 /lib64/libc.so.6(raise+24)
#02 pc 0000000000026cf0 /lib64/libc.so.6(abort+228)
#03 pc 0000000000075404 /lib64/libc.so.6
#04 pc 000000000008bfe8 /lib64/libc.so.6
#05 pc 000000000008e050 /lib64/libc.so.6
#06 pc 000000000009063c /lib64/libc.so.6(free+172)
#07 pc 0000000000f0d428 /zmq::msg_t::close()+200
#08 pc 0000000000f3e464 /zmq::encoder_base_t<zmq::v3_1_encoder_t>::encode(unsigned char**, unsigned long)+276
#09 pc 0000000000f3386c /zmq::stream_engine_base_t::out_event()+60
#10 pc 0000000000f01804 /zmq::epoll_t::loop()+260
#11 pc 0000000000f39e48 /othread_routine+72
#12 pc 000000000007fbc8 /lib64/libc.so.6
#13 pc 00000000000e6f98 /lib64/libc.so.6

Environment:
OS: Linux
zmq version: v4.3.5

Has anyone ever encountered this issue?
Whether it was solved?

send msg code as follow:

int32_t Write(const std::string& topic, const SerializeCb& serializeToBuffer, uint32_t dataSize)
{
    ZmqMsg msg(const_cast<char *>(topic.c_str()), topic.size());
    ZmqMsg data(dataSize);

    // msg and data valid check 
    int32_t ret = 0;
    {   
        lock_guard<mutex> lck(senderMtx_);
        if (sender_ != nullptr) {
            if (zmq_msg_send(msg.Msg(), sender_, ZMQ_SNDMORE | ZMQ_DONTWAIT) < 0 || 
                zmq_msg_send(data.Msg(), sender_, ZMQ_NULL | ZMQ_DONTWAIT) < 0) {
                printf("participnt %s send topic %s failed\n", participantId_.c_str(), topic.c_str());
                ret = -1;
            }
        }
    }
    return ret;
}
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

1 participant