sentry-native icon indicating copy to clipboard operation
sentry-native copied to clipboard

Crashpad not capturing invalid_parameter errors on Windows

Open maxp1256 opened this issue 5 years ago • 2 comments

Description I'm trying to catch an error with sentry/crashpad, but it's not detecting it. Should sentry being called through invoke_watson or could this exception type not be handled by sentry/crashpad? Are there any possibilities to debug the crashpad-handler / Windows Error Reporting?

When does the problem happen

  • [x] When capturing a hard crash

Environment

  • OS: Windows Server 2016
  • Compiler: MSVC VS 2017

Issue A messagebox (from windows) is showing that our app stopped working.

Callstack of our app: ucrtbase.dll!__invoke_watson() Unknown ucrtbase.dll!__invalid_parameter() Unknown ucrtbase.dll!__invalid_parameter_noinfo() Unknown ucrtbase.dll!__crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter,__crt_stdio_output::standard_base<char,__crt_stdio_output::string_output_adapter>>::state_case_size() Unknown ucrtbase.dll!___stdio_common_vsprintf() Unknown [Inline Frame] ourapp.exe!_vsnprintf_l(unsigned char * const) Line 1390 C [Inline Frame] ourapp.exe!_vsprintf_l(unsigned char * const) Line 1462 C

Expected behavior Sentry catches the Exception and our app quits.

maxp1256 avatar Jul 01 '20 12:07 maxp1256

Looks like Crashpad backend does not call _set_invalid_parameter_handler() https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-invalid-parameter-handler-set-thread-local-invalid-parameter-handler?view=vs-2019

Mixaill avatar Jul 02 '20 16:07 Mixaill

Linking this thread for visibility, where we were discussing the same for the Breakpad backend: https://github.com/getsentry/sentry-native/pull/290#issuecomment-642227678

Interestingly, Electron ignores it, too. See here.

jan-auer avatar Jul 06 '20 13:07 jan-auer