In the following code:
template Referent cache_get(uint64_t node_target) {
object obj;
auto handle = get(std::to_string(node_target), obj);
if (!handle) {
obj = load(node_target, 0);
}
lock.get_read_lock(node_target);
return (Referent )obj.target;
}
get is defined as follows:
CacheReadHandle cache::get(CacheKey key, object &obj) const {
auto handle = gcache_->find(key);
if (handle) {
std::memcpy(static_cast<void *>(&obj), handle->getMemory(), sizeof(obj));
}
}
after the return statement in cacheget, the code tries to fetch the refCount variable in Refcount.h in the function atomicUpdateValue. The segmentation fault is on line 471.
In the following code: template Referent cache_get(uint64_t node_target) {
object obj;
auto handle = get(std::to_string(node_target), obj);
if (!handle) {
obj = load(node_target, 0);
}
lock.get_read_lock(node_target);
return (Referent )obj.target;
}
get is defined as follows: CacheReadHandle cache::get(CacheKey key, object &obj) const { auto handle = gcache_->find(key); if (handle) { std::memcpy(static_cast<void *>(&obj), handle->getMemory(), sizeof(obj)); } }
after the return statement in cacheget, the code tries to fetch the refCount variable in Refcount.h in the function atomicUpdateValue. The segmentation fault is on line 471.