Skip to content

Commit

Permalink
Fix segmentation fault due to uninitialized memory pointer.
Browse files Browse the repository at this point in the history
Related To: VLCLJ-2260
  • Loading branch information
aviralni committed Sep 6, 2024
1 parent 6d760a7 commit bd580cc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions conformance_tests/tools/debug/src/test_debug_utils.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (C) 2022 Intel Corporation
* Copyright (C) 2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
Expand Down Expand Up @@ -155,10 +155,10 @@ ze_result_t readWriteSLMMemory(const zet_debug_session_handle_t &debug_session,
static constexpr uint16_t bufferSize =
512; // Also defined in test_debug_helper.cpp for SLM buffer size

zet_debug_memory_space_desc_t desc;
zet_debug_memory_space_desc_t desc = {};
desc.type = ZET_DEBUG_MEMORY_SPACE_TYPE_SLM;

zet_debug_memory_space_desc_t verifyDesc;
zet_debug_memory_space_desc_t verifyDesc = {};
verifyDesc.type = ZET_DEBUG_MEMORY_SPACE_TYPE_SLM;
verifyDesc.address = slmBaseAddress;

Expand Down Expand Up @@ -318,7 +318,7 @@ void readWriteModuleMemory(const zet_debug_session_handle_t &debug_session,

static constexpr uint8_t bufferSize = 16;
bool read_success = false;
zet_debug_memory_space_desc_t desc;
zet_debug_memory_space_desc_t desc = {};
desc.type = ZET_DEBUG_MEMORY_SPACE_TYPE_DEFAULT;
uint8_t buffer1[bufferSize];
uint8_t buffer2[bufferSize];
Expand Down Expand Up @@ -767,7 +767,7 @@ void zetDebugMemAccessTest::run_read_write_module_and_memory_test(
FAIL() << "[Debugger] Did not find stopped threads";
}

zet_debug_memory_space_desc_t memorySpaceDesc;
zet_debug_memory_space_desc_t memorySpaceDesc = {};
memorySpaceDesc.type = ZET_DEBUG_MEMORY_SPACE_TYPE_DEFAULT;
int sizeToRead = 512;
uint8_t *buffer = new uint8_t[sizeToRead];
Expand Down Expand Up @@ -802,7 +802,7 @@ void zetDebugMemAccessTest::run_read_write_module_and_memory_test(
0xDE, 0xAD, 0xBE, 0xEF, 0xDE, 0xAD,
0xBE, 0xEF, 0xDE, 0xAD, 0xBE, 0xEF};

zet_debug_memory_space_desc_t slmSpaceDesc;
zet_debug_memory_space_desc_t slmSpaceDesc = {};
slmSpaceDesc.type = ZET_DEBUG_MEMORY_SPACE_TYPE_SLM;
slmSpaceDesc.address = slmBaseAddress;

Expand Down Expand Up @@ -841,4 +841,4 @@ void zetDebugMemAccessTest::run_read_write_module_and_memory_test(
lzt::debug_detach(debugSession);
ASSERT_EQ(debugHelper.exit_code(), 0);
}
}
}

0 comments on commit bd580cc

Please sign in to comment.