On 11/02/2014 10:49 PM, scan-ad...@coverity.com wrote:
Please find the latest report on new defect(s) introduced to Apache-Qpid found
with Coverity Scan.
2 new defect(s) introduced to Apache-Qpid found with Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)
** CID 1250695: Uncaught exception (UNCAUGHT_EXCEPT)
/qpidbuilds/trunk/qpid/cpp/src/qpid/broker/TxDequeue.cpp: 47 in
qpid::broker::TxDequeue::commit()()
/qpidbuilds/trunk/qpid/cpp/src/qpid/broker/TxDequeue.cpp: 47 in
qpid::broker::TxDequeue::commit()()
** CID 1250696: Uncaught exception (UNCAUGHT_EXCEPT)
/qpidbuilds/trunk/qpid/cpp/src/qpid/broker/TxDequeue.cpp: 33 in
qpid::broker::TxDequeue::prepare(qpid::broker::TransactionContext *)()
/qpidbuilds/trunk/qpid/cpp/src/qpid/broker/TxDequeue.cpp: 33 in
qpid::broker::TxDequeue::prepare(qpid::broker::TransactionContext *)()
These are similar to existing code, which highlights the same issue.
I.e. this is not a new issue, just new occurrences of an existing issue.
The methods in question are defined not to throw, becuase the higher
level transaction coordination wants that guarantee. The code therefore
catches any error and simply logs it.
However I believe the issue here is that the QPID_LOG() macro can in
theory throw an exception.
The question is how to fix it. One option would be to add a
QPID_LOG_NO_THROW(), say, that wraps the QPID_LOG() itself in a try/
catch. In the unlikely event of an exception there it would do nothing.
Thoughts?
________________________________________________________________________________________________________
*** CID 1250695: Uncaught exception (UNCAUGHT_EXCEPT)
/qpidbuilds/trunk/qpid/cpp/src/qpid/broker/TxDequeue.cpp: 47 in
qpid::broker::TxDequeue::commit()()
41 }catch(...){
42 QPID_LOG(error, "Failed to prepare");
43 return false;
44 }
45 }
46
CID 1250695: Uncaught exception (UNCAUGHT_EXCEPT)
An exception of type "qpid::Options::Exception" is thrown but the throw list
"throw ()" doesn't allow it to be thrown. This will cause a call to unexpected() which
usually calls terminate().
47 void TxDequeue::commit() throw()
48 {
49 try {
50 queue->dequeueCommitted(message);
51 } catch (const std::exception& e) {
52 QPID_LOG(error, "Failed to commit: " << e.what());
/qpidbuilds/trunk/qpid/cpp/src/qpid/broker/TxDequeue.cpp: 47 in
qpid::broker::TxDequeue::commit()()
41 }catch(...){
42 QPID_LOG(error, "Failed to prepare");
43 return false;
44 }
45 }
46
CID 1250695: Uncaught exception (UNCAUGHT_EXCEPT)
An exception of type "qpid::Options::Exception" is thrown but the throw list
"throw ()" doesn't allow it to be thrown. This will cause a call to unexpected() which
usually calls terminate().
47 void TxDequeue::commit() throw()
48 {
49 try {
50 queue->dequeueCommitted(message);
51 } catch (const std::exception& e) {
52 QPID_LOG(error, "Failed to commit: " << e.what());
________________________________________________________________________________________________________
*** CID 1250696: Uncaught exception (UNCAUGHT_EXCEPT)
/qpidbuilds/trunk/qpid/cpp/src/qpid/broker/TxDequeue.cpp: 33 in
qpid::broker::TxDequeue::prepare(qpid::broker::TransactionContext *)()
27 namespace broker {
28
29 TxDequeue::TxDequeue(QueueCursor m, boost::shared_ptr<Queue> q,
30 qpid::framing::SequenceNumber mId,
qpid::framing::SequenceNumber rId)
31 : message(m), queue(q), messageId(mId), replicationId(rId) {}
32
CID 1250696: Uncaught exception (UNCAUGHT_EXCEPT)
An exception of type "qpid::Options::Exception" is thrown but the throw list
"throw ()" doesn't allow it to be thrown. This will cause a call to unexpected() which
usually calls terminate().
33 bool TxDequeue::prepare(TransactionContext* ctxt) throw()
34 {
35 try{
36 queue->dequeue(ctxt, message);
37 return true;
38 }catch(const std::exception& e){
/qpidbuilds/trunk/qpid/cpp/src/qpid/broker/TxDequeue.cpp: 33 in
qpid::broker::TxDequeue::prepare(qpid::broker::TransactionContext *)()
27 namespace broker {
28
29 TxDequeue::TxDequeue(QueueCursor m, boost::shared_ptr<Queue> q,
30 qpid::framing::SequenceNumber mId,
qpid::framing::SequenceNumber rId)
31 : message(m), queue(q), messageId(mId), replicationId(rId) {}
32
CID 1250696: Uncaught exception (UNCAUGHT_EXCEPT)
An exception of type "qpid::Options::Exception" is thrown but the throw list
"throw ()" doesn't allow it to be thrown. This will cause a call to unexpected() which
usually calls terminate().
33 bool TxDequeue::prepare(TransactionContext* ctxt) throw()
34 {
35 try{
36 queue->dequeue(ctxt, message);
37 return true;
38 }catch(const std::exception& e){
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit,
http://scan.coverity.com/projects/6?tab=overview
To unsubscribe from the email notification for new defects,
http://scan5.coverity.com/cgi-bin/unsubscribe.py
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org