Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.ComponentModel.Win32Exception : An error occurred trying to start process 'notepad.exe' with working directory 'C:\h\w\9F8D0903\w\B7E309C0\e'. Access is denied #90406

Open
3 tasks
Maoni0 opened this issue Jun 12, 2023 · 5 comments
Labels
area-System.Diagnostics.Process Known Build Error Use this to report build issues in the .NET Helix tab
Milestone

Comments

@Maoni0
Copy link
Member

Maoni0 commented Jun 12, 2023

Build

https://dev.azure.com/dnceng-public/public/_build/results?buildId=302756&view=results

https://helixre107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-pull-87372-merge-563116f2d3404bad82/System.Diagnostics.Process.Tests/1/console.b1eb782a.log?helixlogtype=result

C:\h\w\9F8D0903\w\B7E309C0\e>"C:\h\w\9F8D0903\p\dotnet.exe" exec --runtimeconfig System.Diagnostics.Process.Tests.runtimeconfig.json --depsfile System.Diagnostics.Process.Tests.deps.json xunit.console.dll System.Diagnostics.Process.Tests.dll -xml testResults.xml -nologo -nocolor -trait category=OuterLoop -notrait category=IgnoreForCI -notrait category=failing  
  Discovering: System.Diagnostics.Process.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Diagnostics.Process.Tests (found 12 of 290 test cases)
  Starting:    System.Diagnostics.Process.Tests (parallel test collections = on, max threads = 2)
    System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList(useShellExecute: True) [FAIL]
      System.ComponentModel.Win32Exception : An error occurred trying to start process 'notepad.exe' with working directory 'C:\h\w\9F8D0903\w\B7E309C0\e'. Access is denied.
      Stack Trace:
        /_/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Win32.cs(92,0): at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
        /_/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Win32.cs(25,0): at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
        /_/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs(1282,0): at System.Diagnostics.Process.Start()
        /_/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs(1350,0): at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
        /_/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs(1308,0): at System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList(Boolean useShellExecute)
           at InvokeStub_ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList(Object, Object, IntPtr*)
           at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
  Finished:    System.Diagnostics.Process.Tests

Build leg reported

System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList

Pull Request

#87372

Known issue core information

Fill out the known issue JSON section by following the step by step documentation on how to create a known issue

 {
    "ErrorMessage" : "",
    "BuildRetry": false,
    "ErrorPattern": "System.ComponentModel.Win32Exception : An error occurred trying to start process .* with working directory",
    "ExcludeConsoleLog": false
 }

@dotnet/dnceng

Release Note Category

  • Feature changes/additions
  • Bug fixes
  • Internal Infrastructure Improvements

Release Note Description

Additional information about the issue reported

No response

Report

Build Definition Test Pull Request
875989 dotnet/runtime Microsoft.NET.HostModel.Bundle.Tests.BundlerConsistencyTests.MacOSBundleIsCodeSigned(shouldCodesign: True) #110063
875571 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
875567 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
874493 dotnet/runtime System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList
874506 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
874492 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
873158 dotnet/runtime System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList
866282 dotnet/runtime System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList
864919 dotnet/runtime System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList #109648
863412 dotnet/runtime System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList
863396 dotnet/runtime System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList
863200 dotnet/runtime Microsoft.DotNet.CoreSetup.Test.HostActivation.FrameworkDependentAppLaunch.ComputedTPA_NoTrailingPathSeparator #109526
862427 dotnet/runtime System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList
861000 dotnet/runtime System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList
859085 dotnet/runtime System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList
856417 dotnet/runtime System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList
854476 dotnet/runtime System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList
853278 dotnet/runtime Microsoft.NET.HostModel.MachO.CodeSign.Tests.SigningTests.SignedHelloWorldRuns #108992
852162 dotnet/runtime System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
3 7 19

Known issue validation

Build: 🔎
Result validation: ⚠️ Provided build not found. Provide a valid build in the "Build: 🔎" line.
Validation performed at: 8/11/2023 4:35:48 PM UTC

@Maoni0 Maoni0 added the Known Build Error Use this to report build issues in the .NET Helix tab label Jun 12, 2023
@missymessa
Copy link
Member

@Maoni0 It looks like this error is impacting Runtime only. Is this an infra failure or a failure specific to Runtime tests?

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 11, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Aug 11, 2023
@ilyas1974 ilyas1974 transferred this issue from dotnet/arcade Aug 11, 2023
@build-analysis build-analysis bot removed the untriaged New issue has not been triaged by the area owner label Aug 11, 2023
@ghost
Copy link

ghost commented Aug 14, 2023

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

Issue Details

Build

https://dev.azure.com/dnceng-public/public/_build/results?buildId=302756&view=results

https://helixre107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-pull-87372-merge-563116f2d3404bad82/System.Diagnostics.Process.Tests/1/console.b1eb782a.log?helixlogtype=result

C:\h\w\9F8D0903\w\B7E309C0\e>"C:\h\w\9F8D0903\p\dotnet.exe" exec --runtimeconfig System.Diagnostics.Process.Tests.runtimeconfig.json --depsfile System.Diagnostics.Process.Tests.deps.json xunit.console.dll System.Diagnostics.Process.Tests.dll -xml testResults.xml -nologo -nocolor -trait category=OuterLoop -notrait category=IgnoreForCI -notrait category=failing  
  Discovering: System.Diagnostics.Process.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Diagnostics.Process.Tests (found 12 of 290 test cases)
  Starting:    System.Diagnostics.Process.Tests (parallel test collections = on, max threads = 2)
    System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList(useShellExecute: True) [FAIL]
      System.ComponentModel.Win32Exception : An error occurred trying to start process 'notepad.exe' with working directory 'C:\h\w\9F8D0903\w\B7E309C0\e'. Access is denied.
      Stack Trace:
        /_/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Win32.cs(92,0): at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
        /_/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Win32.cs(25,0): at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
        /_/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs(1282,0): at System.Diagnostics.Process.Start()
        /_/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs(1350,0): at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
        /_/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs(1308,0): at System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList(Boolean useShellExecute)
           at InvokeStub_ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList(Object, Object, IntPtr*)
           at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
  Finished:    System.Diagnostics.Process.Tests

Build leg reported

System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList

Pull Request

#87372

Known issue core information

Fill out the known issue JSON section by following the step by step documentation on how to create a known issue

 {
    "ErrorMessage" : "",
    "BuildRetry": false,
    "ErrorPattern": "System.ComponentModel.Win32Exception : An error occurred trying to start process .* with working directory",
    "ExcludeConsoleLog": false
 }

@dotnet/dnceng

Release Note Category

  • Feature changes/additions
  • Bug fixes
  • Internal Infrastructure Improvements

Release Note Description

Additional information about the issue reported

No response

Report

Build Definition Test Pull Request
372612 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
372622 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
372620 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
372621 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
372195 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
372199 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
372208 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
372198 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
371834 dotnet/runtime System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList
371822 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
371829 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
371836 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
371832 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
371391 dotnet/runtime System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList #90417
370943 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
370940 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
370953 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
370941 dotnet/runtime System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
4 18 18

Known issue validation

Build: 🔎
Result validation: ⚠️ Provided build not found. Provide a valid build in the "Build: 🔎" line.
Validation performed at: 8/11/2023 4:35:48 PM UTC

Author: Maoni0
Assignees: -
Labels:

area-System.Diagnostics.Process, Known Build Error, needs-area-label

Milestone: -

@vcsjones vcsjones removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 14, 2023
@adamsitnik adamsitnik added this to the 9.0.0 milestone Aug 16, 2023
@build-analysis build-analysis bot removed this from the 9.0.0 milestone Nov 15, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Nov 15, 2023
@jeffhandley jeffhandley added this to the 9.0.0 milestone Nov 17, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Nov 17, 2023
@jeffhandley
Copy link
Member

Added this to the 9.0.0 milestone because of the frequency

@adamsitnik
Copy link
Member

adamsitnik commented Jul 22, 2024

Triage:

  • the provided glob matched errors from two independent tests so we are most likely dealing with two different issues (but the owners are the same for both so I am not creating another issue right now):
    • System.IO.Pipes.Tests.NamedPipeTest_CurrentUserOnly_Unix.Connection_UnderDifferentUsers_BehavesAsExpected
    • System.Diagnostics.Tests.ProcessStartInfoTests.StartInfo_NotepadWithContent_withArgumentList
  • both reproduce frequently enough to be addressed in 9.0

StartInfo_NotepadWithContent_withArgumentList

StartInfo_NotepadWithContent_withArgumentList is not the only S.D.P test that starts notepad, but it's the only one that fails.

The difference is that it uses a different property to set the arguments:

But both properties are later mapped to a string:

and the same sys-call is being performed:

https://github.com/dotnet/runtime/blob/87a32e758551f4f72c7a25245dc932c0bcb2c6ad/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Win32.cs#L156C56-L156C71

So in theory, both should be equally stable.

When searching for ERROR_ACCESS_DENIED + ShellExecuteEx I've found https://devblogs.microsoft.com/oldnewthing/20101118-00/?p=12253, but we are already handling STA properly:

if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
{
ThreadStart threadStart = new ThreadStart(ShellExecuteFunction);
Thread executionThread = new Thread(threadStart)
{
IsBackground = true,
Name = ".NET Process STA"
};
executionThread.SetApartmentState(ApartmentState.STA);
executionThread.Start();
executionThread.Join();
}
else
{
ShellExecuteFunction();

It's going to require further triage.

@jeffhandley
Copy link
Member

We can defer this out of 9.0.0. It does have a notable hit count, but it's not new. I moved it to Future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Diagnostics.Process Known Build Error Use this to report build issues in the .NET Helix tab
Projects
None yet
Development

No branches or pull requests

7 participants
@vcsjones @jeffhandley @adamsitnik @jeffschwMSFT @Maoni0 @missymessa and others