Details
-
Bug
-
Resolution: Done
-
Critical
-
None
-
None
-
None
-
-
Undefined
-
---
Description
Hot Rod C++ Client crashes due to segmentation fault when the JDG server is down.
The issue can be reproducible with JDG 7.0.1 Hot Rod C++ Client (infinispan-hotrod-cpp-8.3.1.Final) and the latest JDG 7.3 C++ Client (jdg-cpp-client-8.6.5-70.el7jdg.x86_64.rpm). Note that this issue does not happen with JDG 6.6.2 Hot Rod C++ Client.
You can reproduce with the attached reproducer. It appears that segmentation fault happens on the cache operations (get, put, remove and also getName) after retrying obtaining RemoteCache from RemoteCacheManager.getCache(const std::string &name, bool forceReturnValue) where forceReturnValue is specified to true.
You will see the following backtrace from the core file with the latest JDG 7.3 C++ Client (jdg-cpp-client-8.6.5-70.el7jdg.x86_64.rpm).
#0 0x00007f67b33e0c6e in infinispan::hotrod::RemoteCacheBase::base_put (this=this@entry=0x7ffda07c5300, key=key@entry=0x7ffda07c52d0, val=val@entry=0x7ffda07c52e0, life=life@entry=0, idle=idle@entry=0, currentTxPtr=...) at /usr/src/debug/jdg-cpp-client-RHDG_8.6.5.CR1-00208-BOTH/rhel7/src/hotrod/api/RemoteCacheBase.cpp:125 125 return IMPL->put(*this, key, val, life, idle); (gdb) bt #0 0x00007f67b33e0c6e in infinispan::hotrod::RemoteCacheBase::base_put (this=this@entry=0x7ffda07c5300, key=key@entry=0x7ffda07c52d0, val=val@entry=0x7ffda07c52e0, life=life@entry=0, idle=idle@entry=0, currentTxPtr=std::shared_ptr (empty) 0x0) at /usr/src/debug/jdg-cpp-client-RHDG_8.6.5.CR1-00208-BOTH/rhel7/src/hotrod/api/RemoteCacheBase.cpp:125 #1 0x0000000000403386 in put (maxIdleUnit=infinispan::hotrod::SECONDS, maxIdle=0, lifespanUnit=infinispan::hotrod::SECONDS, lifespan=0, val="bar", key="foo", this=0x7ffda07c5300) at /usr/include/infinispan/hotrod/RemoteCache.h:273 #2 put (maxIdle=0, lifespan=0, val="bar", key="foo", this=0x7ffda07c5300) at /usr/include/infinispan/hotrod/RemoteCache.h:224 #3 main (argc=<optimized out>, argv=<optimized out>) at hotrodclient.cpp:64 (gdb) list 120 Transaction& currentTransaction = currentTxPtr ? *currentTxPtr : *transactionManager.getCurrentTransaction(); 121 if (currentTransaction.getStatus() != NO_TRANSACTION) { 122 return transactional_base_put(currentTransaction, key, val, life, idle, forceReturnValue); 123 } 124 } 125 return IMPL->put(*this, key, val, life, idle); 126 } 127 128 void RemoteCacheBase::base_putAll(const std::map<const void*, const void*>& map, int64_t life, int64_t idle, 129 std::shared_ptr<Transaction> currentTxPtr) {
And you will see the following backtrace from the core file with JDG 7.0.1 C++ Client.
#0 0x00007f0ff9a3d5eb in infinispan::hotrod::RemoteCacheImpl::assertRemoteCacheManagerIsStarted() () from /tmp/jboss-datagrid-7.0.1-remote-cpp-client-RHEL7-x86_64/lib64/libhotrod.so.1.0 (gdb) bt #0 0x00007f0ff9a3d5eb in infinispan::hotrod::RemoteCacheImpl::assertRemoteCacheManagerIsStarted() () from /tmp/jboss-datagrid-7.0.1-remote-cpp-client-RHEL7-x86_64/lib64/libhotrod.so.1.0 #1 0x00007f0ff9a3d9cb in infinispan::hotrod::RemoteCacheImpl::put(infinispan::hotrod::RemoteCacheBase&, void const*, void const*, unsigned long, unsigned long) () from /tmp/jboss-datagrid-7.0.1-remote-cpp-client-RHEL7-x86_64/lib64/libhotrod.so.1.0 #2 0x0000000000402d22 in put (maxIdleUnit=infinispan::hotrod::SECONDS, maxIdle=0, lifespanUnit=infinispan::hotrod::SECONDS, lifespan=0, val="bar", key="foo", this=0x7ffeb7dd9b70) at /tmp/jboss-datagrid-7.0.1-remote-cpp-client-RHEL7-x86_64/include/infinispan/hotrod/RemoteCache.h:198 #3 put (maxIdle=0, lifespan=0, val="bar", key="foo", this=0x7ffeb7dd9b70) at /tmp/jboss-datagrid-7.0.1-remote-cpp-client-RHEL7-x86_64/include/infinispan/hotrod/RemoteCache.h:150 #4 main (argc=<optimized out>, argv=<optimized out>) at hotrodclient.cpp:64
234 void RemoteCacheImpl::assertRemoteCacheManagerIsStarted() { 235 if (!remoteCacheManager.isStarted()) { 236 // TODO: log 237 throw RemoteCacheManagerNotStartedException( 238 Msg() << "Cannot perform operations on a cache associated with an unstarted RemoteCacheManager. " 239 << "Use RemoteCacheManager.start before using the remote cache."); 240 } 241 }