Skip to content

System.Diagnostics.Tests.EventLog tests failing with System.UnauthorizedAccessException : Attempted to perform an unauthorized operation #119478

Closed

Description

@elinor-fung

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1142533
Build error leg or test failing: System.Diagnostics.Tests.EventLogSessionTests.ClearLog_LogExists_Success
Pull request: #119473

System.Diagnostics.Tests.EventLogMessagesTests.CanReadAndWriteMessages [FAIL]
  System.UnauthorizedAccessException : Attempted to perform an unauthorized operation.
  Stack Trace:
    /_/src/libraries/System.Security.AccessControl/src/System/Security/AccessControl/Win32.cs(308,0): at System.Security.AccessControl.Win32.SetSecurityInfo(ResourceType type, String name, SafeHandle handle, SecurityInfos securityInformation, SecurityIdentifier owner, SecurityIdentifier group, GenericAcl sacl, GenericAcl dacl)
    /_/src/libraries/System.Security.AccessControl/src/System/Security/AccessControl/NativeObjectSecurity.cs(263,0): at System.Security.AccessControl.NativeObjectSecurity.Persist(String name, SafeHandle handle, AccessControlSections includeSections, Object exceptionContext)
    /_/src/libraries/System.Security.AccessControl/src/System/Security/AccessControl/NativeObjectSecurity.cs(368,0): at System.Security.AccessControl.NativeObjectSecurity.Persist(SafeHandle handle, AccessControlSections includeSections, Object exceptionContext)
    /_/src/libraries/System.Security.AccessControl/src/System/Security/AccessControl/NativeObjectSecurity.cs(361,0): at System.Security.AccessControl.NativeObjectSecurity.Persist(SafeHandle handle, AccessControlSections includeSections)
    /_/src/libraries/System.Threading.AccessControl/src/System/Security/AccessControl/MutexSecurity.cs(178,0): at System.Security.AccessControl.MutexSecurity.Persist(SafeWaitHandle handle)
    /_/src/libraries/System.Threading.AccessControl/src/System/Threading/ThreadingAclExtensions.cs(35,0): at System.Threading.ThreadingAclExtensions.SetAccessControl(Mutex mutex, MutexSecurity mutexSecurity)
    /_/src/libraries/Common/src/System/Diagnostics/NetFrameworkUtils.cs(32,0): at System.Diagnostics.NetFrameworkUtils.EnterMutexWithoutGlobal(String mutexName, Mutex& mutex)
    /_/src/libraries/Common/src/System/Diagnostics/NetFrameworkUtils.cs(19,0): at System.Diagnostics.NetFrameworkUtils.EnterMutex(String name, Mutex& mutex)
    /_/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/EventLog.cs(446,0): at System.Diagnostics.EventLog.DeleteEventSource(String source, String machineName)
    /_/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/EventLog.cs(433,0): at System.Diagnostics.EventLog.DeleteEventSource(String source)
    /_/src/libraries/System.Diagnostics.EventLog/tests/EventLogMessagesTests.cs(82,0): at System.Diagnostics.Tests.EventLogMessagesTests.CanReadAndWriteMessages()
    /_/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.CoreCLR.cs(36,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
    /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": ["System.Diagnostics.Tests.EventLog", "System.UnauthorizedAccessException : Attempted to perform an unauthorized operation"],
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1142533
Error message validated: [System.Diagnostics.Tests.EventLog System.UnauthorizedAccessException : Attempted to perform an unauthorized operation]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 9/9/2025 2:24:07 AM UTC

Report

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 0

Activity

  1. added
    blocking-clean-ci
    Known Build Error
    on Sep 9, 2025
  2. added
    untriaged
    on Sep 9, 2025
  3. dotnet-policy-service commented on Sep 9, 2025

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones
    See info in area-owners.md if you want to be subscribed.

  4. elinor-fung commented on Sep 9, 2025

    @elinor-fung
    MemberAuthor

    Likely related to or the same as #116014

  5. dotnet-policy-service commented on Sep 9, 2025

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/area-system-diagnostics-eventlog
    See info in area-owners.md if you want to be subscribed.

  6. removed
    blocking-clean-ci
    on Oct 27, 2025
  7. jeffschwMSFT commented on Oct 27, 2025

    @jeffschwMSFT
    Member

    removing blocking-clean-ci as it has not failed in 30 days

    24-Hour Hit Count 7-Day Hit Count 1-Month Count
    0 0 0
  8. danmoseley commented on Mar 22, 2026

    @danmoseley
    Contributor

    Not hit since Sept 2025 -- over 6 months. The fix PR: #120075 — "Don't set security descriptor if the mutex is not owned/new" by @jozkee, merged Sept 25, 2025.

    Full timeline:

    1. PR Specify a security descriptor when using global Mutex #110416 (May 15, 2025) — @steveharter added SetAccessControl on the shared mutex unconditionally → introduced the bug
    2. PR Fix intermittent PerformanceCounter test failures due to file access conflicts #117619 (July 15, 2025) — test-side retry mitigation (didn't fix root cause)
    3. PR Don't set security descriptor if the mutex is not owned/new #120075 (Sept 25, 2025) — @jozkee's fix: only set the security descriptor when the mutex is newly created (createdNew) → actual fix

    Issue #119478 should be closeable referencing PR #120075 as the fix.

  9. removed
    untriaged
    on Mar 22, 2026
  10. locked and limited conversation to collaborators on Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Known Build Errorarea-System.Diagnostics.EventLog

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions