From 4a255d211834a5d0218cf1d166180930754b16cd Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Thu, 31 Jul 2025 13:50:55 -0700 Subject: Fix bug in ci test (#8005) This commit fixes two problems. 1. uninitialized file handle for lock-file test 2. uninitialized static variable for lock-file test The first bug is more of speculartive rather than actual bug. The second bug was causing heap corruption when it was retried, because the counter was not reset to zero on "retry" and it wrote data to an invalida range in an array. --- tools/slang-unit-test/unit-test-lock-file.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools') diff --git a/tools/slang-unit-test/unit-test-lock-file.cpp b/tools/slang-unit-test/unit-test-lock-file.cpp index 6458d4b5f..6f1e0b6b8 100644 --- a/tools/slang-unit-test/unit-test-lock-file.cpp +++ b/tools/slang-unit-test/unit-test-lock-file.cpp @@ -37,11 +37,17 @@ SLANG_UNIT_TEST(lockFileSync) SLANG_IGNORE_TEST #endif + // Clean up any leftover lock file from previous runs + File::remove(fileName); + // Test using multiple threads. { static std::atomic lockCounter; static std::atomic unlockCounter; + lockCounter = 0; + unlockCounter = 0; + struct LockTask { std::thread thread; -- cgit v1.2.3