[zeromq-dev] Problems with 2.0.6 poll using C++ api
Matthew Giedt
mgiedt at gmail.com
Fri Mar 19 06:03:29 CET 2010
I'm simply trying to get the simplest possible 'polling' example working. I
have two local PUB sockets sending a message every second, on ports 5550,
5551. The recv printout just verifies that I'm able to receive messages,
prior to then attempting to poll.
I actually exported CXXFLAGS="-ggdb3" and re-configured, make, make install.
I still get the same error -- here's the latest gdb output:
342 for (int i = 0; i != nitems_; i++) {
(gdb)
345 if (items_ [i].socket) {
(gdb)
349 zmq::socket_base_t *s = (zmq::socket_base_t*) items_
[i].socket;
(gdb)
350 if (app_thread) {
(gdb)
351 if (app_thread != s->get_thread ()) {
(gdb)
352 free (pollfds);
(gdb)
353 errno = EFAULT;
(gdb)
354 return -1;
(gdb)
630 }
(gdb)
zmq::poll (items_=0x7fffffffe1e0, nitems_=2, timeout_=-1) at
/usr/local/include/zmq.hpp:54
54 if (rc < 0)
(gdb)
55 throw error_t ();
(gdb)
terminate called after throwing an instance of 'zmq::error_t'
what(): Bad address
Program received signal SIGABRT, Aborted.
0x00007ffff5b0f4b5 in raise () from /lib/libc.so.6
(gdb) bt
#0 0x00007ffff5b0f4b5 in raise () from /lib/libc.so.6
#1 0x00007ffff5b12f50 in abort () from /lib/libc.so.6
#2 0x00007ffff65cacc5 in __gnu_cxx::__verbose_terminate_handler() () from
/usr/lib/libstdc++.so.6
#3 0x00007ffff65c90f6 in ?? () from /usr/lib/libstdc++.so.6
#4 0x00007ffff65c9123 in std::terminate() () from /usr/lib/libstdc++.so.6
#5 0x00007ffff65c921e in __cxa_throw () from /usr/lib/libstdc++.so.6
#6 0x0000000000404536 in zmq::poll (items_=0x7fffffffe1e0, nitems_=2,
timeout_=-1) at /usr/local/include/zmq.hpp:55
#7 0x0000000000404274 in main (argc=1, argv=0x7fffffffe358) at
StrategyEngine.cpp:199
Regards,
-Matt
On Thu, Mar 18, 2010 at 4:13 PM, Martin Lucina <mato at kotelna.sk> wrote:
> Hi Matthew,
>
> mgiedt at gmail.com said:
> > Here's the application that I'm using to test:
> >
> > [snip]
>
> Looks fine though I'm not sure what you're trying to achieve...
>
> > This produces:
> >
> > sock1 recv: 0xfce9e8
> > sock2 recv: 0xfcece8
> > poll...
> > terminate called after throwing and instance of 'zmq::error_t'
> > what(): Bad address
> > Aborted
> >
> > I've included the gdb output below -- it's thinking that the two sockets
> were
> > created from different threads?
>
> That's what it looks like, but the trace you posted looks like it's bogus
> due to optimization. Can you try doing
>
> $ export CXXFLAGS="-O0 -g"
>
> Then rebuild and reinstall, and see if you a) still get the problem b) the
> backtrace looks sane?
>
> Thanks
>
> -mato
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100318/854fe091/attachment.htm>
More information about the zeromq-dev
mailing list