-
Notifications
You must be signed in to change notification settings - Fork 247
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
Bug: winrt::hresult_error::originate asserts when using a clr.dll based error info object #1380
Comments
Looks like the Lines 217 to 221 in 2511bf7
While the Lines 315 to 318 in 2511bf7
And worse, the I'd expect that this is a bad assumption on C++/WinRT's part - there's certainly runtimes that will |
The latter is preceded by a call to |
RoOriginateErrorInformation's documentation doesn't seem to say that it resets the error info. The implementation respects if (FlagNotSet(RoErrorFlags, RO_ERROR_REPORTING_SUPPRESSSETERRORINFO))
{
if (FlagSet(RoErrorFlags, RO_ERROR_REPORTING_USESETERRORINFO) || IsDebuggerPresent())
{
SetErrorInfo(...);
}
} There's other paths through RoOriginateLanguageException that would cause the call to SetErrorInfo to be skipped. I'm inclined to fix up this path against "could not get the extended error info" as that's not really a developer problem as much as an environmental problem. @ChrisGuzak can you grab a time-travel trace of the test you've got so we can see what's happening? |
Adding @manodasanW as I think he originally owned/wrote the origination APIs. |
This issue is stale because it has been open 10 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Version
C++/WinRT v2.0.220418.1
Summary
In
winrt::hresult_error::originate
, running in the context of aMicrosoft::VisualStudio::CppUnitTestFramework
project, where the error info object is provided by clr.dll and it does not implementIRestrictedErrorInfo
. theWINRT_VERIFY(info.try_as(m_info))
line fails the assert.base.h, ~4892
Is this a bug in the CLR or is the design intended to support this?
Reproducible example
Expected behavior
no assert, but I'm not sure if this is bug in the CLR or cppwinrt
Actual behavior
assert, in debug build
Additional comments
No response
The text was updated successfully, but these errors were encountered: