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" <aphex...@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 <aphex...@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@lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to