Hi, As per the subject I'm experiencing a crash which I am _reeaasonably_ sure I've pinpointed to a problem with one of the C/C++ Qpid client libraries. Of course I could also be doing something goofy in which case I apologise profusely!
The problem manifests in a number of different ways including a double-free and stack trace, an error message (when built in debug) reading proton-c/src/object/object.c:236: pn_object_decref: Assertion `head->refcount > 0' failed. and a simple segfault with no further info. I've examined some core dumps which give some further hints about the problem but I won't include results here - instead I've tried to distil the problem down to the attached source. Two things seem to be key - using AMQP1.0 (0-10 is fine) and creating and closing sessions very fast while sending some message over the link. I realise this may not be typical usage but it does happen in my integration testing and causes my tests to crash! The versions I've tested with are: qpid-proton-0.9.1-rc1 / qpid-cpp-0-34 qpid-proton-0.14.0 / qpid-cpp-1.35 Compiler: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609 I've been testing against c++ broker 0.34 and 1.35 fairly indiscriminately on the assumption it's not really relevant to the crash. Sample code - build with eg: g++ -g -std=c++11 -o qpid-test main.cxx /usr/local/lib/libqpidmessaging.so /usr/local/lib/libqpidtypes.so Regards -- *Chris Richardson*, System Architect c...@fourc.eu *FourC AS, Vestre Rosten 81, Trekanten, NO-7075 Tiller, Norwaywww.fourc.eu <http://www.fourc.eu/>* *Follow us on LinkedIn <http://bit.ly/fourcli>, Facebook <http://bit.ly/fourcfb>, Google+ <http://bit.ly/fourcgp> and Twitter <http://bit.ly/fourctw>!*
#include <string> #include <iostream> #include <qpid/messaging/Connection.h> #include <qpid/messaging/Session.h> #include <qpid/messaging/Sender.h> #include <qpid/messaging/Message.h> #include <qpid/messaging/Receiver.h> const std::string CONNECTION_URL = "<broker-url>"; const std::string CONNECTION_OPTIONS = "{transport:ssl, protocol:amqp1.0}"; const std::string SENDER_ARGS = ";{ create: always, node: { type: queue, x-declare: { auto-delete: true }}}"; const std::string QUEUE_NAME = "TestQueue"; int main(int, char**) { qpid::messaging::Connection connection(CONNECTION_URL, CONNECTION_OPTIONS); connection.open(); int i = 0; while (true) { std::cout << "Creating session, itr: " << ++i << std::endl; auto session = connection.createSession(); qpid::messaging::Message message; auto sender = session.createSender(QUEUE_NAME + SENDER_ARGS); auto receiver = session.createReceiver(QUEUE_NAME); sender.send(message); receiver.fetch(message); session.sync(); session.close(); } }
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org For additional commands, e-mail: users-h...@qpid.apache.org