Skip to content

Commit 7cd0229

Browse files
committed
agents: fix crash accessing cont prof queue
On runtime shutdown, when continuous profiling is enabled, it can happen that we try access `GrpcAgent::cont_prof_queue_` when it has already being reset, thus crashing the process. PR-URL: #348 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
1 parent 766a071 commit 7cd0229

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

agents/grpc/src/grpc_agent.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ int GrpcAgent::start_heap_snapshot_from_js(
814814
const ProfileCollector::ProfileQStor& profile_data,
815815
WeakGrpcAgent agent_wp) {
816816
SharedGrpcAgent agent = agent_wp.lock();
817-
if (agent == nullptr) {
817+
if (agent == nullptr || agent->cont_profile_queue_ == nullptr) {
818818
return;
819819
}
820820

0 commit comments

Comments
 (0)