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

Sentry MAUI crashes in release when built with dotnet sdk 8.0.100, works with 8.0.403 #3833

Open
Captnwalker1 opened this issue Dec 6, 2024 · 5 comments

Comments

@Captnwalker1
Copy link

Captnwalker1 commented Dec 6, 2024

Package

Sentry.Maui

.NET Flavor

.NET

.NET Version

8.0.100

OS

Windows

SDK Version

4.13.0

Self-Hosted Sentry Version

No response

Steps to Reproduce

  1. Create new MAUI app
  2. Add Sentry Nuget
  3. Add Sentry setup to MauiProgram.cs
  4. Add global json:{ "sdk": { "version": "8.0.100", "rollForward": "disabled" } }
  5. In cli run dotnet publish: dotnet publish -f:net8.0-windows10.0.19041.0 -p:TargetFrameworks=net8.0-windows10.0.19041.0 -c:Release --output C:\a\sentry\ -p:WindowsPackageType=None --self-contained
  6. Try to run exe from C:\a\sentry, won't launch/crashes on launch

Workaround, use 8.0.403 in global.json

Expected Result

Application to launch properly

Actual Result

Application crashes before window appears

Unhandled Exception:

Unhandled exception at 0x00007FF873103942 (KernelBase.dll) in MauiSentryCrash8-0-100.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x00000198C3973060, 0x0000000000000002).

Call Stack:

KernelBase.dll!RaiseFailFastException() Unknown
combase.dll!RoFailFastWithErrorContextInternal2(HRESULT hrError, unsigned long cStowedExceptions, _STOWED_EXCEPTION_INFORMATION_V2 * * aStowedExceptionPointers) Line 1455 C++
Microsoft.ui.xaml.dll!FailFastWithStowedExceptions(HRESULT hrError, unsigned long cStowedExceptions, _STOWED_EXCEPTION_INFORMATION_V2 * * aStowedExceptionPointers) Line 1508 C++
Microsoft.ui.xaml.dll!DirectUI::ErrorHelper::ProcessUnhandledError(DirectUI::ErrorInfo & errorInfo, bool fSkipFailFastIfNoErrorContext, bool * pfHandled) Line 582 C++
Microsoft.ui.xaml.dll!DirectUI::FinalUnhandledErrorDetectedRegistration::OnFinalUnhandledErrorDetected(IInspectable * pSender, ABI::Windows::ApplicationModel::Core::IUnhandledErrorDetectedEventArgs * pArgs) Line 913 C++
[External Code]
Microsoft.ui.xaml.dll!DirectUI::ErrorHelper::ReportUnhandledError(HRESULT hrError) Line 475 C++
Microsoft.ui.xaml.dll!DirectUI::FrameworkApplication::InvokeOnLaunchActivated(ABI::Windows::ApplicationModel::Activation::ILaunchActivatedEventArgs * uwpLaunchActivatedEventArgs) Line 887 C++
Microsoft.ui.xaml.dll!DirectUI::FrameworkApplication::StartOnCurrentThreadImpl(ABI::Microsoft::UI::Xaml::IApplicationInitializationCallback * pCallback) Line 96 C++
[External Code]
Microsoft.ui.xaml.dll!DirectUI::WindowsXamlManager::XamlCore::Initialize(ABI::Microsoft::UI::Dispatching::IDispatcherQueue * dq) Line 275 C++
Microsoft.ui.xaml.dll!DirectUI::WindowsXamlManager::Initialize() Line 340 C++
Microsoft.ui.xaml.dll!ctl::ComObjectBase::CreateInstanceBase(ctl::ComBase * pNewInstance, bool) Line 46 C++
Microsoft.ui.xaml.dll!ctl::ComObjectDirectUI::WindowsXamlManager::CreateInstanceDirectUI::WindowsXamlManager(IInspectable * ppNewInstance, DirectUI::WindowsXamlManager * *) Line 167 C++
[Inline Frame] Microsoft.ui.xaml.dll!ctl::ComObjectDirectUI::WindowsXamlManager::CreateInstance(DirectUI::WindowsXamlManager * *) Line 159 C++
Microsoft.ui.xaml.dll!ctl::makeDirectUI::WindowsXamlManager(ctl::Internal::ComPtrRef<ctl::ComPtrDirectUI::WindowsXamlManager> ppNewInstance) Line 46 C++
Microsoft.ui.xaml.dll!DirectUI::WindowsXamlManagerFactory::InitializeForCurrentThreadImpl(ABI::Microsoft::UI::Xaml::Hosting::IWindowsXamlManager * * ppReturnValue) Line 201 C++
[External Code]
Microsoft.ui.xaml.dll!DirectUI::FrameworkApplication::StartDesktop() Line 227 C++
[External Code]
coreclr.dll!CallDescrWorkerInternal() Line 100 Unknown
[Inline Frame] coreclr.dll!CallDescrWorkerWithHandler(CallDescrData *) Line 67 C++
coreclr.dll!MethodDescCallSite::CallTargetWorker(const unsigned __int64 * pArguments, unsigned __int64 * pReturnValue, int cbReturnValue) Line 570 C++
[Inline Frame] coreclr.dll!MethodDescCallSite::Call(const unsigned __int64 *) Line 458 C++
coreclr.dll!RunMainInternal(Param * pParam) Line 1304 C++
coreclr.dll!RunMain(MethodDesc * pFD, short piRetVal, int * stringArgs, PtrArray * *) Line 1375 C++
coreclr.dll!Assembly::ExecuteMainMethod(PtrArray * * stringArgs, int) Line 1504 C++
coreclr.dll!CorHost2::ExecuteAssembly(unsigned long dwAppDomainId, const wchar_t * pwzAssemblyPath, int argc, const wchar_t * * argv, unsigned long * pReturnValue) Line 340 C++
coreclr.dll!coreclr_execute_assembly(void * hostHandle, unsigned int domainId, int argc, const char * * argv, const char * managedAssemblyPath, unsigned int * exitCode) Line 504 C++
[Inline Frame] hostpolicy.dll!coreclr_t::execute_assembly(int) Line 109 C++
hostpolicy.dll!run_app_for_context(const hostpolicy_context_t & context, int argc, const wchar_t * * argv) Line 256 C++
hostpolicy.dll!run_app(const int argc, const wchar_t * * argv) Line 285 C++
hostpolicy.dll!corehost_main(const int argc, const wchar_t * * argv) Line 426 C++
hostfxr.dll!execute_app(const std::wstring & impl_dll_dir, corehost_init_t * init, const int argc, const wchar_t * * argv) Line 145 C++
hostfxr.dll!`anonymous namespace'::read_config_and_execute(const std::wstring & host_command, const host_startup_info_t & host_info, const std::wstring & app_candidate, const std::unordered_map<enum known_options,std::vector<std::wstring,std::allocatorstd::wstring>,known_options_hash,std::equal_to,std::allocator<std::pair<enum known_options const ,std::vector<std::wstring,std::allocatorstd::wstring>>>> & opts, int new_argc, const wchar_t * * new_argv, host_mode_t mode, const bool is_sdk_command, wchar_t * out_buffer, int buffer_size, int * required_buffer_size) Line 532 C++
hostfxr.dll!fx_muxer_t::handle_exec_host_command(const std::wstring & host_command, const host_startup_info_t & host_info, const std::wstring & app_candidate, const std::unordered_map<enum known_options,std::vector<std::wstring,std::allocatorstd::wstring>,known_options_hash,std::equal_to,std::allocator<std::pair<enum known_options const ,std::vector<std::wstring,std::allocatorstd::wstring>>>> & opts, int argc, const wchar_t * * argv, int argoff, host_mode_t mode, const bool is_sdk_command, wchar_t * result_buffer, int buffer_size, int * required_buffer_size) Line 1007 C++
hostfxr.dll!fx_muxer_t::execute(const std::wstring host_command, const int argc, const wchar_t * * argv, const host_startup_info_t & host_info, wchar_t * result_buffer, int buffer_size, int * required_buffer_size) Line 578 C++
hostfxr.dll!hostfxr_main_startupinfo(const int argc, const wchar_t * * argv, const wchar_t * host_path, const wchar_t * dotnet_root, const wchar_t * app_path) Line 62 C++
MauiSentryCrash8-0-100.exe!exe_start(const int argc, const wchar_t * * argv) Line 240 C++
MauiSentryCrash8-0-100.exe!wmain(const int argc, const wchar_t * * argv) Line 311 C++
[External Code]

@jamescrosswell
Copy link
Collaborator

@Captnwalker1 possibly related to this. Are you able to test with version 4.11.0 to see if you get the same behaviour?

@Captnwalker1
Copy link
Author

Same on 4.11.0: Unhandled exception at 0x00007FF873103942 (KernelBase.dll) in MauiSentryCrash8-0-100.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x0000020C8BB17C40, 0x0000000000000002).

Also tried 4.10.2 and that worked fine.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Dec 9, 2024
@jamescrosswell
Copy link
Collaborator

jamescrosswell commented Dec 10, 2024

Same on 4.11.0: Unhandled exception at 0x00007FF873103942 (KernelBase.dll) in MauiSentryCrash8-0-100.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x0000020C8BB17C40, 0x0000000000000002).

Also tried 4.10.2 and that worked fine.

Very peculiar... there's nothing in the list of changes that were made in 4.11.0 that looks relevant.

Is using the 8.0.403 workloads a potential workaround? It might be a while before I can look into this otherwise.

@Captnwalker1
Copy link
Author

Yes we have upgraded to 8.0.403 for now and have been fine.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Dec 10, 2024
@jamescrosswell
Copy link
Collaborator

jamescrosswell commented Dec 10, 2024

OK thanks for reporting @Captnwalker1. In the short to medium term, it sounds like that's the easiest/best fix.

Ideally/eventually we can either work out what's going on and fix it or at least build in some checks to warn if folks try to compile against 8.0.402 or lower.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Status: No status
Development

No branches or pull requests

2 participants