[zeromq-dev] segfault after timeout

Papp Aron aphex999 at gmail.com
Sun Aug 11 17:57:39 CEST 2013


Thanks a lot, now it works fine!


2013/8/11 KIU Shueng Chuan <nixchuan at gmail.com>

> If you are using the s_recv() from zhelpers.h, the return value is either
> NULL or a C string that you need to free().
> On Aug 11, 2013 3:48 PM, "Papp Áron" <aphex999 at gmail.com> wrote:
>
>> Hi All,
>>
>> I just found the problem on the segmentation fault issue.
>>
>> After changing:
>>     std::string message = s_recv(socket);
>> To:
>>     char* message = s_recv(socket);
>>
>> No fault occurs. Btw, until this point, i had no problem using
>> std::string for reciving messages...
>>
>> Thank you mates for all your work!
>>
>> Best,
>> Aron
>>
>>
>>
>>
>> 2013/8/10 Papp Áron <aphex999 at gmail.com>
>>
>>> Hi All,
>>>
>>> My environment:
>>> - Linux 3.2.0, 64 bit
>>> - ZMQ version 3.2.3
>>> - socket: ZMQ_REQ
>>> - connection with zmq_connect()
>>> - protocol: TCP
>>> - lang: C/C++
>>>
>>> The program is very simple, it connects to a zmq-tcp socket, sends a
>>> request, waits for an answer, then returns. If no answer comes, it should
>>> return after timeout.
>>>
>>> The problem is, if I set ZMQ_RCVTIMEO, and exits no replier, it stops
>>> s_recv() command after the timeout specified in RCVTIMEO, but the program
>>> exits with Segmentation fault.
>>>
>>> Here's the gdb output:
>>> Program received signal SIGSEGV, Segmentation fault.
>>> 0x00007ffff6f6d86f in ?? () from /lib/x86_64-linux-gnu/libc.so.6
>>>
>>> Thanks in advance!
>>>
>>> Best,
>>> Aron
>>>
>>>
>>
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>
>>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130811/d0834fe6/attachment.htm>


More information about the zeromq-dev mailing list