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

Peter Friend pfriend at gehrytech.com
Tue Nov 20 03:18:32 CET 2012


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.zeromq.org/pipermail/zeromq-dev/attachments/20121120/5f61929b/attachment.htm 


More information about the zeromq-dev mailing list