Calling unsubscribe(...) on the same SubscriptionInfo twice results in a SIGSEGV.
ConnectionManager cm = ...;
SubscriptionInfo si = cm.subscribe(...);
cm.unsubscribe(si);
cm.unsubscribe(si); // <-- this sends SIGSEGV to process
I would expect that the second call to unsubscribe(...) is a no-op since that subscription is not active anymore. At worst it should throw an exception that can be handled by the caller.
The issues appears to be that unsubscribe(...) calls delete on si, even though there are still live references to it, and that unsubscribe(...) is missing some null checks, specifically getInfo() may return null.
Backtrace from core dump:
C [libGMSECAPI.so+0x374e66] gmsec::api::SubscriptionInfo::getConnection() const+0x10
C [libGMSECAPI.so+0x3eefdf] gmsec::api::mist::internal::InternalConnectionManager::unsubscribe(gmsec::api::mist::SubscriptionInfo*&)+0xef
C [libGMSECAPI.so+0x3775fa] gmsec::api::mist::ConnectionManager::unsubscribe(gmsec::api::mist::SubscriptionInfo*&)+0x26
C [libgmsec_jni.so+0xe9990] Java_gov_nasa_gsfc_gmsec_api_jni_gmsecJNI_ConnectionManager_1Unsubscribe+0xa
Calling
unsubscribe(...)on the sameSubscriptionInfotwice results in a SIGSEGV.I would expect that the second call to
unsubscribe(...)is a no-op since that subscription is not active anymore. At worst it should throw an exception that can be handled by the caller.The issues appears to be that
unsubscribe(...)callsdeleteonsi, even though there are still live references to it, and thatunsubscribe(...)is missing some null checks, specificallygetInfo()may returnnull.Backtrace from core dump: