fix that memory_dump swallow all sigsegv
This commit is contained in:
parent
acb0d73a97
commit
3c0776dbd6
2
deps/oblib/src/lib/alloc/memory_dump.cpp
vendored
2
deps/oblib/src/lib/alloc/memory_dump.cpp
vendored
@ -460,6 +460,7 @@ int label_stat(AChunk *chunk, ABlock *block, AObject *object,
|
|||||||
litem->count_ = 1;
|
litem->count_ = 1;
|
||||||
litem->block_cnt_ = 1;
|
litem->block_cnt_ = 1;
|
||||||
litem->chunk_cnt_ = 1;
|
litem->chunk_cnt_ = 1;
|
||||||
|
ObSignalHandlerGuard guard(ob_signal_handler);
|
||||||
ret = lmap.set_refactored(key, LabelInfoItem(litem, chunk, block));
|
ret = lmap.set_refactored(key, LabelInfoItem(litem, chunk, block));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -484,6 +485,7 @@ int malloc_sample_stat(uint64_t tenant_id, uint64_t ctx_id,
|
|||||||
item->alloc_count_ += 1;
|
item->alloc_count_ += 1;
|
||||||
item->alloc_bytes_ += offset;
|
item->alloc_bytes_ += offset;
|
||||||
} else {
|
} else {
|
||||||
|
ObSignalHandlerGuard guard(ob_signal_handler);
|
||||||
ret = malloc_sample_map.set_refactored(key, ObMallocSampleValue(1, offset));
|
ret = malloc_sample_map.set_refactored(key, ObMallocSampleValue(1, offset));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
16
deps/oblib/src/lib/signal/ob_signal_struct.h
vendored
16
deps/oblib/src/lib/signal/ob_signal_struct.h
vendored
@ -32,6 +32,22 @@ extern const int MP_SIG; // MP means MULTI-PURPOSE
|
|||||||
extern const int SIG_STACK_SIZE;
|
extern const int SIG_STACK_SIZE;
|
||||||
extern uint64_t g_rlimit_core;
|
extern uint64_t g_rlimit_core;
|
||||||
|
|
||||||
|
struct ObSignalHandlerGuard
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ObSignalHandlerGuard(signal_handler_t handler)
|
||||||
|
: last_(get_signal_handler())
|
||||||
|
{
|
||||||
|
get_signal_handler() = handler;
|
||||||
|
}
|
||||||
|
~ObSignalHandlerGuard()
|
||||||
|
{
|
||||||
|
get_signal_handler() = last_;
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
const signal_handler_t last_;
|
||||||
|
};
|
||||||
|
|
||||||
class DTraceId
|
class DTraceId
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user