fix(agent): drop unused Stepping field from win32Processor struct#80
Closed
fix(agent): drop unused Stepping field from win32Processor struct#80
Conversation
WMI provider returns Win32_Processor.Stepping as int32 on some Windows builds despite the MOF schema declaring it as string. The StackExchange /wmi library iterates struct fields via reflection and tries to load each from the result row, calling reflect.Value.Uint() on the int32 value which panics because Uint() only accepts uint kinds. Crashes the agent on startup with: panic: reflect: call of reflect.Value.Uint on int32 Value agent/hardware_windows.go:480 (collectHardware) Same root cause as ai-07's flap loop — every Windows agent panics during the first hardware snapshot send, gets restarted by SCM, panics again, exit code 1067. The field was never used: SELECT statement doesn't include Stepping, and hw.CPUStepping is populated from gopsutil's cpu.Info() instead. Removing the field tells the wmi library to skip it entirely. No functionality lost. Verified: agent runs to steady-state on Win10 22H2 after this change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Crashes every Windows agent on startup with
panic: reflect: call of reflect.Value.Uint on int32 Value. WMI returnsWin32_Processor.Steppingas int32; struct declared it as string; StackExchange/wmi library reflection panics. Field was never used — SELECT doesn't include it and CPU stepping comes from gopsutil. Removing the field stops the panic.Same root cause as ai-07's parked flap loop. Verified on Win10 22H2 (admin's test box) — agent now reaches steady-state.