fix(logging): no-op Logger::Log when not initialized - #747
Merged
JeanPhilippeKernel merged 1 commit intoSep 4, 2026
Merged
Conversation
Calling Log before Initialize (or after Dispose) divided by a zero-sized ring buffer and could recurse through assert macros. Guard with IsInitialized() and cover before-init / after-dispose paths. Fixes JeanPhilippeKernel#746
JeanPhilippeKernel
self-requested a review
September 4, 2026 05:30
JeanPhilippeKernel
approved these changes
Sep 4, 2026
JeanPhilippeKernel
left a comment
Owner
There was a problem hiding this comment.
Thanks for the fix @BetterAndBetterII !!
JeanPhilippeKernel
merged commit Sep 4, 2026
7b0d94b
into
JeanPhilippeKernel:develop
17 checks passed
Merged
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Logger::Logindexed the ring buffer withfetch_add(...) % s_log_message_rb.size()without checking initialization. BeforeInitialize()the capacity is zero (modulo-by-zero /SIGFPE). AfterDispose()the same path can recurse through assert macros back intoLoguntil the stack overflows.Return immediately when
!IsInitialized().IsInitialized()already exists; this just uses it at the top ofLog.Test plan
LoggerUninitialized.LogBeforeInitializeDoesNotCrash— was RED (SIGFPE), now GREENLoggerTest.LogAfterDisposeDoesNotCrash— GREENLoggerTest.*still pass (15/15 in the isolated Logger binary)ZEngineTests --gtest_filter='LoggerUninitialized.*:LoggerTest.*'Fixes #746