You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Ravi Trivedi (JIRA)" <ji...@apache.org> on 2012/08/09 16:54:18 UTC

[jira] [Updated] (QPID-4200) "qpid::TransportFailure" exception leak in AutoCancel destructor

     [ https://issues.apache.org/jira/browse/QPID-4200?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ravi Trivedi updated QPID-4200:
-------------------------------

    Attachment: SubscriptionManager.h

SubscriptionManager header file
                
> "qpid::TransportFailure" exception leak in AutoCancel destructor
> ----------------------------------------------------------------
>
>                 Key: QPID-4200
>                 URL: https://issues.apache.org/jira/browse/QPID-4200
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Client
>    Affects Versions: 0.6, 0.8, 0.10, 0.12, 0.13, 0.14, 0.15, 0.16
>         Environment: Linux g++
>            Reporter: Ravi Trivedi
>            Priority: Critical
>              Labels: api-change
>         Attachments: SubscriptionManager.h
>
>
> === Code ====
> SubscriptionManager subscriptions(session);
> subscriptions.get(response, queue,
>  timeout * TIME_SEC);
> when the connection to qpid is lost during the wait period client application gets crashed with following exception
> terminate called after throwing an instance of 'qpid::TransportFailure'
> what(): 
> aborted
> ==== GDB Backtrace output ====
> Starting program: /home/vmware/Desktop/qpidc-0.6/examples/direct/direct_producer 
> [Thread debugging using libthread_db enabled]
> [New Thread 0x7f349456c780 (LWP 5097)]
> [New Thread 0x425b3950 (LWP 5100)]
> 2012-08-09 16:39:09 warning Connection closed
> terminate called after throwing an instance of 'qpid::TransportFailure'
>   what():  Connection closed
> Program received signal SIGABRT, Aborted.
> [Switching to Thread 0x7f349456c780 (LWP 5097)]
> 0x00007f34930c75c5 in raise () from /lib64/libc.so.6
> (gdb) bt full
> #0  0x00007f34930c75c5 in raise () from /lib64/libc.so.6
> No symbol table info available.
> #1  0x00007f34930c8bb3 in abort () from /lib64/libc.so.6
> No symbol table info available.
> #2  0x00007f34939231d4 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib64/libstdc++.so.6
> No symbol table info available.
> #3  0x00007f34939215f6 in ?? () from /usr/lib64/libstdc++.so.6
> No symbol table info available.
> #4  0x00007f34939207eb in ?? () from /usr/lib64/libstdc++.so.6
> No symbol table info available.
> #5  0x00007f34939213b8 in __gxx_personality_v0 () from /usr/lib64/libstdc++.so.6
> No symbol table info available.
> #6  0x00007f34933fece3 in ?? () from /lib64/libgcc_s.so.1
> No symbol table info available.
> #7  0x00007f34933feda8 in _Unwind_Resume () from /lib64/libgcc_s.so.1
> No symbol table info available.
> #8  0x0000000000405333 in qpid::client::AutoCancel::~AutoCancel ()
> No locals.
> #9  0x00007f3493c22369 in qpid::client::SubscriptionManagerImpl::get (this=0x823000, result=@0x7fff9c58d060, queue=@0x7fff9c58d070, 
>     timeout=<value optimized out>) at qpid/client/SubscriptionManagerImpl.cpp:128
> 	lq = {<qpid::client::Handle<qpid::client::LocalQueueImpl>> = {impl = 0x822ee0}, <No data fields>}
> 	unique = {static npos = 18446744073709551615, 
>   _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
>     _M_p = 0x6104e8 "dbd23f8c-061e-41c1-bee5-a5712fbece52"}}
> 	sm = {<qpid::sys::Runnable> = {_vptr.Runnable = 0x7f3493ee0e50}, <qpid::client::Handle<qpid::client::SubscriptionManagerImpl>> = {impl = 0x823000}, 
>   static UNLIMITED = <optimized out>}
> 	ac = {sm = @0x7fff9c58cf70, tag = {static npos = 18446744073709551615, 
>     _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
>       _M_p = 0x6104e8 "dbd23f8c-061e-41c1-bee5-a5712fbece52"}}}
> #10 0x0000000000404c38 in main ()
> No locals.
> ======= Bug description =======
> get() method of subscriptionmanager class registers for the AutoCancel. During the Destruction of AutoCancel class object 
> ( goes out of scope due to the return of get() or other exception in get() ) if the connection to the qpid is lost or not available,
> "qpid::TransportFailure" exception is being thrown somewhere from inside the SubscriptionManager::Cancel()
> As the execption is not handled in the destructor and can not propagate beyond destructor ( Execption leak ), eventually leads to termination of the application
> Just for the confirmation I tried to handle the exception in ~AutoCancel() and it worked , application was able to survive.
> ~AutoCancel() {
> 	try{
> 		sm->cancel()
> 	} catch ( qpid::TransportFailure& Ex) {
> 		std::cout<< " Inside ~AutoCancel() " <<Ex.what()<<std::endl;
> 	}
> }
> This was produced in the 0.6 version but by looking at the code of 0.16 I  believe this problem is present the latest version also.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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