Skip to content

Fix UBSan signed integer overflow in test busy-wait loops#351

Merged
Krilliac merged 1 commit intoWorkingfrom
claude/freeze-detection-recovery-mXhyK
Apr 3, 2026
Merged

Fix UBSan signed integer overflow in test busy-wait loops#351
Krilliac merged 1 commit intoWorkingfrom
claude/freeze-detection-recovery-mXhyK

Conversation

@Krilliac
Copy link
Copy Markdown
Owner

@Krilliac Krilliac commented Apr 3, 2026

The busy-wait pattern volatile int x = 0; for (int i = 0; i < N; ++i) x += i overflows signed int when N=100000 (sum ~5 billion). Changed all test busy-loop variables to unsigned int across TestDebugUtilities, TestProfiler, and TestChromeTracing to eliminate UBSan runtime errors.

https://claude.ai/code/session_013pbpQmtyuFCcGPZ7ZBGxPw

The busy-wait pattern `volatile int x = 0; for (int i = 0; i < N; ++i) x += i`
overflows signed int when N=100000 (sum ~5 billion). Changed all test busy-loop
variables to unsigned int across TestDebugUtilities, TestProfiler, and
TestChromeTracing to eliminate UBSan runtime errors.

https://claude.ai/code/session_013pbpQmtyuFCcGPZ7ZBGxPw
@Krilliac Krilliac merged commit 967cd54 into Working Apr 3, 2026
44 checks passed
@Krilliac Krilliac deleted the claude/freeze-detection-recovery-mXhyK branch April 3, 2026 05:06
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

Code Coverage (GCC + lcov)

Utils/JsonUtils.h                         |    -      0|    -     0|    -      0
Utils/LocalFileCache.h                    |12.7%    157| 0.0%    20|    -      0
Utils/Logger.cpp                          |21.8%    133| 0.0%    17|    -      0
Utils/Logger.h                            |18.2%    121| 0.0%    20|    -      0
Utils/MathUtils.cpp                       |    -      0|    -     0|    -      0
Utils/MemoryDebugger.h                    |13.3%    150| 0.0%    20|    -      0
Utils/MemoryMonitor.cpp                   | 9.6%    229| 0.0%    19|    -      0
Utils/MemoryMonitor.h                     |85.7%     14| 0.0%    12|    -      0
Utils/OpaqueHandle.h                      | 209%     11| 0.0%    15|    -      0
Utils/Profiler.cpp                        |14.2%    113| 0.0%    15|    -      0
Utils/Profiler.h                          |36.4%     33| 0.0%    12|    -      0
Utils/RandomEngine.h                      |29.3%     41| 0.0%    12|    -      0
Utils/Result.h                            | 100%     29| 0.0%    28|    -      0
Utils/RingBuffer.h                        | 108%     59| 0.0%    64|    -      0
Utils/ScopeGuard.h                        | 142%     36| 0.0%    51|    -      0
Utils/ScopedTimer.h                       |25.0%     12| 0.0%     3|    -      0
Utils/Serializer.h                        | 100%     48| 0.0%    42|    -      0
Utils/SparkConsole.cpp                    | 125%     32| 0.0%     6|    -      0
Utils/SparkConsole.h                      | 100%      2| 0.0%     2|    -      0
Utils/SparkError.h                        |10.9%     55| 0.0%     6|    -      0
Utils/SplinePath.h                        |    -      0|    -     0|    -      0
Utils/StackTrace.h                        |11.0%     73| 0.0%     8|    -      0
Utils/StateMachine.h                      |54.0%     63| 0.0%    32|    -      0
Utils/StringUtils.h                       |18.8%    112| 0.0%    21|    -      0
Utils/ThreadDebugger.h                    |12.8%    148| 0.0%    19|    -      0
Utils/ThreadSafeQueue.h                   |27.5%     40| 0.0%    11|    -      0
Utils/UUID.h                              |43.2%     37| 0.0%    16|    -      0
Utils/Validate.h                          |    -      0|    -     0|    -      0

[/home/runner/work/SparkEngine/SparkEngine/SparkSDK/Include/Spark/]
IEngineContext.h                          |6700%      1| 0.0%     1|    -      0
Version.h                                 |    -      0|    -     0|    -      0
================================================================================
                                    Total:|35.2%  11992| 0.0%  2422|    -      0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants