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

Unable to Properly Save Dump Files on Windows #58

Open
weypro opened this issue Jan 13, 2024 · 2 comments
Open

Unable to Properly Save Dump Files on Windows #58

weypro opened this issue Jan 13, 2024 · 2 comments

Comments

@weypro
Copy link

weypro commented Jan 13, 2024

Hello. I have attempted to compile the CMake-wrapped version of Crashpad provided by Backtrace separately on Windows, aiming to retrieve and save dump files locally. I do not require the use of remote upload services. While the Windows demo can run, it consistently gets stuck at an unknown point and cannot proceed further. If I forcibly terminate the process, it does save a file, but the saved file is 0kb in size. In contrast, when using the crashpad provided by Sentry with the same examples, it executes successfully and the dump file is saved properly. Moreover, the program returns directly without any freezing issues.
I suspect that the issue might be related to the handling of network connectivity, so I registered a Backtrace account and entered the URL parameters. However, even with this, the Backtrace handle still does not operate correctly. Interestingly, when I simply change the handle path to Sentry's while keeping the client as Backtrace's, it successfully uploads the dump file.

@weypro
Copy link
Author

weypro commented Jan 13, 2024

demo: https://github.com/backtrace-labs/crashpad/blob/backtrace/examples/windows/demo/demo.cpp
My cmakelists:

cmake_minimum_required(VERSION 3.26)
project(crashpadtest)

set(CMAKE_CXX_STANDARD 17)

add_subdirectory(crashpad)

add_executable(crashpadtest main.cpp)
#target_link_libraries(crashpadtest PRIVATE crashpad_client)
target_link_libraries(crashpadtest PRIVATE client)
target_compile_definitions(crashpadtest PRIVATE
        NOMINMAX
        UNICODE
        WIN32_LEAN_AND_MEAN
        _CRT_SECURE_NO_WARNINGS
        _UNICODE
)

@gm4sl
Copy link
Contributor

gm4sl commented Jan 15, 2024

@weypro Could you please build the handler in a release configuration or, alternatively, comment out the following assertion in minidump/minidump_context_writer.cc and let us know if that helps. Thanks for the report and apologies for the trouble.

bool MinidumpXSaveAMD64CetU::InitializeFromSnapshot(
   const CPUContextX86_64* context_snapshot) {
   // NOTE(backtrace): the CET is zero'd out in exception_snapshot_win.cc and
   // the model specific register will never be set. Disabling the DCHECK to
   // prevent a fatal crash (invokes INT3).
   // DCHECK_EQ(context_snapshot->xstate.cet_u.cetmsr, 1ull);
   cet_u_.cetmsr = context_snapshot->xstate.cet_u.cetmsr;
   cet_u_.ssp = context_snapshot->xstate.cet_u.ssp;
   return true;
}

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

No branches or pull requests

2 participants