Hello.

I've managed to compile an early version of the Event Completion Framework Poller intended to work on the Solaris platform. The good news is that the qpidd daemon seems to start using this new and (of course) dangerous Poller implementation.

The bad news is that a single telnet localhost 5672 is able to kill it. The program aborts in qpid::sys::Dispatcher::run():

       Poller::Event event = poller->wait();
       DispatchHandle* h =
           boost::polymorphic_downcast<DispatchHandle*>(event.handle);

So, I've added some traces to my addFd, delFd, modFd, and wait implementations, also a log in Dispatcher::run(), showing:

       QPID_LOG(trace, "Got an event with handle: " << event.handle
                << " Type: " << typeid(*(event.handle)).name());

Just between the reception of the event, and the downcast attempt.


What I see is::

2008-jun-02 18:25:50 info Listening on TCP port 5672
2008-jun-02 18:25:50 trace Poller::addFd(handle=0x0000000100174b30, fd=4)
2008-jun-02 18:25:50 trace About to enter port_get. Thread 1, timeout=9223372036854775807ns 2008-jun-02 18:25:50 trace About to enter port_get. Thread 5, timeout=9223372036854775807ns

Before doing the tcp connection attempt. Those are traces written by the ECFPoller::wait() method. So, two threads are listening, and a fd=4 is registered as a handle, I assume it is the socket descriptor.

Then, I perform a telnet localhost 5672:

2008-jun-02 18:25:55 trace Sending event (thread: 5) for handle 0x0000000100174b30, direction= 1 2008-jun-02 18:25:55 trace Got an event with handle: 0x0000000100174b30 Type: qpid::sys::DispatchHandle
2008-jun-02 18:25:55 trace Poller::addFd(handle=0x0000000100174bf0, fd=5)
2008-jun-02 18:25:55 trace Poller::modFd(handle=0x0000000100174b30, fd=4)
2008-jun-02 18:25:55 trace About to enter port_get. Thread 5, timeout=9223372036854775807ns 2008-jun-02 18:25:55 trace Sending event (thread: 5) for handle 0x0000000100174bf0, direction= 2 2008-jun-02 18:25:55 trace Got an event with handle: 0x0000000100174bf0 Type: qpid::sys::AsynchIO Assertion failed: dynamic_cast<Target>(x) == x, file /opt/dslap/contrib/include/boost/cast.hpp, line 97
Abort (core dumped)

I can see an event for the handle bound to the file descriptor 4. This is due to the activity in the socket, and sounds like the poller is doing its job. The event reaches the Dispatcher::run, a new Handle is added with fd=5, probably the result of the accept call on the socket. But then, a new event is generated on the handle bound to the fd=5. Once it reaches the Dispatcher::run() method, its type is qpid::sys::AsynchIO. and surprisingly, the assertion fails.

Surprisingly, looking at qpid::sys::AsynchIO, in the class definition:

class AsynchIO : private DispatchHandle

Humm, weird.

Any idea?

Best regards.

--
Manuel.




Reply via email to