perfview
perfview copied to clipboard
System.Runtime.InteropServices.COMException (0x800700EA): More data is available. (Exception from HRESULT: 0x800700EA)
System.Runtime.InteropServices.COMException (0x800700EA): More data is available. (Exception from HRESULT: 0x800700EA) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at Microsoft.Diagnostics.Tracing.Session.TraceEventSession.GetActiveSessionNames() at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.Utility.TraceEventUtil.CreateSession(String sessionName) at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventServiceWorker.Initialize() at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventService.<>c__DisplayClass21_1.<AddWorkers>b__0() at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventService.HandleException(String callerName, Action body)
Can you please put together a set of steps/repro code that causes this?
Hey @brianrob, hope you are well. I just hit this during some local testing. Repro information:
- Windows 11 build 22621.1555
- I have 65 ETW sessions active on the machine
What seems to happen is:
-
TraceEventSession.GetActiveSessionNames()
getsMAX_SESSIONS
fromGetETWMaxLoggers()
introduced in #1408 -
GetETWMaxLoggers
is checkingSYSTEM\\CurrentControlSet\\Control\\WMI
EtwMaxLoggers key, but that doesn't seem to exist in my registry, so it defaults to 64 -
GetActiveSessionNames
callsQueryAllTraces
and getsERROR_MORE_DATA
- It then throws on the next line with the call to
ThrowExceptionForHR
So, a few ideas on how to fix:
- The code seems to assume that EtwMaxLoggers is set in the registry if the system supports more than 64 loggers, but that doesn't seem to be the case on my windows 11 machine. Perhaps there is another way to check for current supported max loggers?
- An alternative would be to check for the
ERROR_MORE_DATA
return code and callQueryAllTraces
again with the new max session count value it has set in theref sessionCount
parameter.
Any other ideas?
Happy to submit a PR if you think one of these is viable. I lean towards option 2 as I couldn't find a lot of good documentation on the EtwMaxLoggers registry setting.
@ryandle, thanks for the analysis. I agree that the second fix sounds right to me. Would be happy to accept a PR on this.
64 is the default value, though Windows 10+ does allow for larger values - https://learn.microsoft.com/en-us/windows/win32/api/evntrace/nf-evntrace-queryalltracesa#parameters.