提交 c118ed16 编写于 作者: O obdev 提交者: wangzelin.wzl

fix memorydump hang

上级 fc00df48
......@@ -352,10 +352,11 @@ int label_stat(AChunk *chunk, ABlock *block, AObject *object,
} else {
hold = align_up2(chunk->alloc_bytes_ + ACHUNK_HEADER_SIZE, get_page_size());
}
void *label = &object->label_[0];
void *end = memchr(label, '\0', sizeof(object->label_));
int len = end ? (char*)end - (char*)label : sizeof(object->label_);
ObString str(len, (char*)label);
char label[AOBJECT_LABEL_SIZE + 1];
STRNCPY(label, object->label_, sizeof(label));
label[sizeof(label) - 1] = '\0';
int len = strlen(label);
ObString str(len, label);
LabelItem *litem = nullptr;
LabelInfoItem *linfoitem = lmap.get(str);
if (NULL != linfoitem) {
......
......@@ -102,7 +102,7 @@ struct LabelInfoItem
void *block_;
};
typedef common::hash::ObHashMap<ObString, LabelInfoItem> LabelMap;
typedef common::hash::ObHashMap<ObString, LabelInfoItem, hash::NoPthreadDefendMode> LabelMap;
using lib::AChunk;
using lib::ABlock;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册