qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Conway (JIRA)" <j...@apache.org>
Subject [jira] [Created] (PROTON-1615) c++: container leaks if exception thrown by handler.
Date Fri, 06 Oct 2017 20:20:00 GMT
Alan Conway created PROTON-1615:
-----------------------------------

             Summary: c++: container leaks if exception thrown by handler.
                 Key: PROTON-1615
                 URL: https://issues.apache.org/jira/browse/PROTON-1615
             Project: Qpid Proton
          Issue Type: Bug
            Reporter: Alan Conway
             Fix For: proton-c-0.19.0


An exception throw by a handler is re-thrown out of container.run() as expected, however
the container does not shut down cleanly and many leaks are reported by valgrind or asan.
The container should be exception-safe.

To demonstrate the problem apply this small patch to the helloworld_direct example.

examples/cpp/helloworld_direct.cpp | 1 +

modified   examples/cpp/helloworld_direct.cpp
@@ -53,6 +53,7 @@ class hello_world_direct : public proton::messaging_handler {
 
     // Receive one message and stop listener
     void on_message(proton::delivery &, proton::message &m) OVERRIDE {
+        throw std::runtime_error("thrown from on_message");
         std::cout << m.body() << std::endl;
         listener.stop();
     }




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message