[zeromq-dev] segfault in python during poll() (but it's my fault)

Martin Hurton hurtonm at gmail.com
Wed Nov 21 23:55:16 CET 2012


The master contains patch that should fix the crash. Can you please
test and report back? Thanks! - Martin

On Wed, Nov 21, 2012 at 9:33 PM, Martin Hurton <hurtonm at gmail.com> wrote:
> Hi Peter, could you please create an issue for this and attach a
> simple example, best in C,  to reproduce this segfault? Thanks!
>
> - Martin
>
> On Wed, Nov 21, 2012 at 4:49 PM, Martin Hurton <hurtonm at gmail.com> wrote:
>> Thanks for report, I will check it.
>>
>> On Nov 20, 2012 3:18 AM, "Peter Friend" <pfriend at gehrytech.com> wrote:
>>>
>>> I have a client REQ talking to a ROUTER. I am translating some prototype
>>> code from python to Java so the ROUTER is in Java and the REQ client is
>>> python. I was rather perplexed when I got a segfault during poll():
>>>
>>>
>>>
>>> socks = dict(polldev.poll(10 * 1000))
>>>
>>>
>>>
>>> from strace:
>>>
>>> write(6, "\1\0\0\0\0\0\0\0", 8)         = 8
>>>
>>> write(8, "\1\0\0\0\0\0\0\0", 8)         = 8
>>>
>>> poll([{fd=8, events=POLLIN}], 1, 0)     = 1 ([{fd=8, revents=POLLIN}])
>>>
>>> read(8, "\1\0\0\0\0\0\0\0", 8)          = 8
>>>
>>> poll([{fd=8, events=POLLIN}], 1, 0)     = 0 (Timeout)
>>>
>>> write(6, "\1\0\0\0\0\0\0\0", 8)         = 8
>>>
>>> fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
>>>
>>> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
>>> 0x7fc8abbed000
>>>
>>> write(1, "sending 1\n", 10sending 1
>>>
>>> )             = 10
>>>
>>> poll([{fd=8, events=POLLIN}], 1, 0)     = 1 ([{fd=8, revents=POLLIN}])
>>>
>>> poll([{fd=8, events=POLLIN}], 1, 0)     = 1 ([{fd=8, revents=POLLIN}])
>>>
>>> read(8, "\1\0\0\0\0\0\0\0", 8)          = 8
>>>
>>> poll([{fd=8, events=POLLIN}], 1, 0)     = 0 (Timeout)
>>>
>>> poll([{fd=8, events=POLLIN}], 1, 10000 <unfinished ...>
>>>
>>> +++ killed by SIGSEGV (core dumped) +++
>>>
>>>
>>>
>>> This ended up being caused by the fact that I forgot to put in the empty
>>> frame for the reply to the REQ. Once I did that everything worked, but I
>>> wouldn't expect this to cause a segfault. I am working on a Java REQ client
>>> as well to verify whether it's a core library issue. I am using my own build
>>> of libzmq from the master branch I built today.
>>>
>>>
>>>
>>> Thanks,
>>>
>>>
>>>
>>> Peter
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> zeromq-dev mailing list
>>> zeromq-dev at lists.zeromq.org
>>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>>
>>



More information about the zeromq-dev mailing list