From aeccc45ab775fd3a963f3e27c8d2a4122c75154d Mon Sep 17 00:00:00 2001 From: Neelay Shah Date: Tue, 23 May 2023 09:54:38 -0700 Subject: [PATCH] nnshah1 stream infer segfault fix (#5842) match logic from infer_handler.cc --- src/grpc/stream_infer_handler.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/grpc/stream_infer_handler.cc b/src/grpc/stream_infer_handler.cc index 6ab35f7be8..168da81121 100644 --- a/src/grpc/stream_infer_handler.cc +++ b/src/grpc/stream_infer_handler.cc @@ -269,9 +269,11 @@ ModelStreamInferHandler::Process(InferHandler::State* state, bool rpc_ok) } // Get request ID for logging in case of error. const char* request_id = ""; - LOG_TRITONSERVER_ERROR( - TRITONSERVER_InferenceRequestId(irequest, &request_id), - "unable to retrieve request ID string"); + if (irequest != nullptr) { + LOG_TRITONSERVER_ERROR( + TRITONSERVER_InferenceRequestId(irequest, &request_id), + "unable to retrieve request ID string"); + } if (!strncmp(request_id, "", 1)) { request_id = ""; }