-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
ASP.NET Core Module fails to load the runtime when the Null Service is stopped #46544
Comments
@mertozturk80 Thanks for reporting this. Your analysis is correct, and that is indeed where we are failing. I'll need to think about this a bit to decide what we should do here... |
@mertozturk80 I'm really curious, is there a reason you are disabling the null service in the first place? I looked into this a bit and it seems like lots of things encounter errors when the null service is stopped. I don't think there's an expectation that ASP.NET Core will still work when core parts of the OS/environment are disabled. |
Hi @mertozturk80. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate. See our Issue Management Policies for more information. |
Without a good reason to disable the service in the first place, I figure documentation should be sufficient. I'm reopening this because a request on an internal email thread to document this after someone else ran into the issue. We could probably add something to the troubleshooting guide. |
Now documented. |
Is there an existing issue for this?
Describe the bug
Can aspnetcorev2.dll be dependent on null device, especially when it makes Standard stream redirection?
We have discovered an issue for a customer that if you stop the Null Service (and restart the worker), the startup of ANCM is failing. Ie:
C:\Windows\System32>sc stop null
..
With in-process hosting, we have the following callstack in the crash dump, of IIS Worker:
0:008> !gle
LastErrorValue: 0x00000002 = ERROR_FILE_NOT_FOUND
LastStatusValue: 0xc0000034 = STATUS_OBJECT_NAME_NOT_FOUND
Failure Stack
0:008> kL
Child-SP RetAddr Call Site
00 000000e7
389fea70 00007ffb
3763c8b1 ucrtbase!_invoke_watson+0x1801 000000e7
389feaa0 00007ffb
3763c989 ucrtbase!_invalid_parameter+0x8102 000000e7
389feae0 00007ffb
37619936 ucrtbase!_invalid_parameter_noinfo+0x903 000000e7
389feb20 00007ffa
fed873c8 ucrtbase!_fileno+0x35c1604 000000e7
389feb50 00007ffa
fed7e839 aspnetcorev2!StdWrapper::StartRedirection+0x4805 000000e7
389feba0 00007ffa
fed7eb09 aspnetcorev2!StandardStreamRedirection::Start+0x1a906 000000e7
389fec20 00007ffa
fed7e303 aspnetcorev2!StandardStreamRedirection::TryStartRedirection+0x907 000000e7
389fec50 00007ffa
fed6d243 aspnetcorev2!StandardStreamRedirection::StandardStreamRedirection+0x4308 000000e7
389fec80 00007ffa
fed6ba8d aspnetcorev2!HandlerResolver::FindNativeAssemblyFromHostfxr+0x39309 000000e7
389fef80 00007ffa
fed6c89f aspnetcorev2!HandlerResolver::LoadRequestHandlerAssembly+0x39d0a 000000e7
389ff170 00007ffa
fed63552 aspnetcorev2!HandlerResolver::GetApplicationFactory+0x6bf0b 000000e7
389ff2c0 00007ffa
fed62b18 aspnetcorev2!APPLICATION_INFO::TryCreateApplication+0x3220c 000000e7
389ff410 00007ffa
fed627f7 aspnetcorev2!APPLICATION_INFO::CreateApplication+0x2680d 000000e7
389ff610 00007ffa
fed6f670 aspnetcorev2!APPLICATION_INFO::CreateHandler+0x1570e 000000e7
389ff680 00007ffb
076cd3f9 aspnetcorev2!ASPNET_CORE_PROXY_MODULE::OnExecuteRequestHandler+0x110..
I suspect the following section of the code, where we are creating a Nul file -->
"IIS\AspNetCoreModuleV2\CommonLib\StdWrapper.cpp @ 51 "
HRESULT
StdWrapper::StartRedirection()
{
..
// Open a null file such that undoing the redirection succeeds and _dup2 works.
// m_previousFileDescriptor will be used for restoring stdout/stderr
if (_fileno(m_stdStream) == -2)
{
freopen_s((FILE**)&m_stdStream, "nul", "w", m_stdStream);
m_previousFileDescriptor = _dup(_fileno(m_stdStream));
}
..
By Default the Null service is in running mode, and its a sort of hidden service. However i can see that, there are some people who are experiencing this issue, and underlying reason remains as a mystery. See the StackOverflow article:
https://stackoverflow.com/questions/72591225/asp-net-core-3-1-iis-worker-crashes-on-startup
Even if we decide not to fix this, we should be documenting it, here or somewhere.
Expected Behavior
aspnetcorev2.dll to handle the abcense of the Null service dependency. Or we should add this as a requirenment in the documentation.
Steps To Reproduce
#1 - Stop the Null Service on a Windows system
C:\Windows\System32>sc stop null
..
#2 - Restart the IIS Worker Process hosting an in-proc application.
#3- Site will start to fail with a Worker process (w3wp.exe) crash.
Exceptions (if any)
ExceptionAddress: 00007ffb3763c9e8 (ucrtbase!_invoke_watson+0x0000000000000018)
ExceptionCode: c0000409 (Security check failure or stack buffer overrun)
ExceptionFlags: 00000001
NumberParameters: 1
Parameter[0]: 0000000000000005
Subcode: 0x5 FAST_FAIL_INVALID_ARG
.NET Version
Version independent
Anything else?
No response
The text was updated successfully, but these errors were encountered: