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

The latest crashpad broke the mingw64 build #744

Closed
JasonShiao opened this issue Aug 5, 2022 · 6 comments · Fixed by #803
Closed

The latest crashpad broke the mingw64 build #744

JasonShiao opened this issue Aug 5, 2022 · 6 comments · Fixed by #803

Comments

@JasonShiao
Copy link

The commit in crashpad:

cause the unknown type name 'MINIDUMP_THREAD_NAME_LIST' compile error so the Mingw64 as instruction in README.md won't build anymore

@Swatinem
Copy link
Member

Swatinem commented Aug 8, 2022

I think this has to ideally be fixed upstream by pulling in updated header definitions.
These definitions were added to minidumpapiset.h at some point, though not sure when exactly, it seems that the online docs are not updated yet either: https://docs.microsoft.com/en-us/windows/win32/api/minidumpapiset/

I’m not entirely sure if mingw ships its own copy of the windows headers, or if we have to work around this in crashpad as we do for other mingw specific issues.
That said, we do not officially support mingw, but are very happy to accept patches from the community. As a matter of fact, mingw support itself was a community effort from the start.

@Mixaill
Copy link
Contributor

Mixaill commented Aug 8, 2022

I’m not entirely sure if mingw ships its own copy of the windows headers

Yep, MinGW has their own implementation of WinAPI headers.

or if we have to work around this in crashpad as we do for other mingw specific issues.

We can supply definitions inside #if defined(__MINGW32__)

@kerenkhatiwada
Copy link
Member

Status changed based on the above. Feel free to update as needed!

@past-due
Copy link
Contributor

past-due commented Aug 23, 2022

I’m not entirely sure if mingw ships its own copy of the windows headers

Yep, MinGW has their own implementation of WinAPI headers.

or if we have to work around this in crashpad as we do for other mingw specific issues.

We can supply definitions inside #if defined(__MINGW32__)

From a quick look, it appears that all that is missing is something like:

#if defined(__MINGW32__) || defined(__MINGW64__)

//! \brief Contains the name of the thread with the given thread ID.
struct __attribute__((packed, aligned(4))) MINIDUMP_THREAD_NAME {
  //! \brief The identifier of the thread.
  uint32_t ThreadId;

  //! \brief RVA64 of a MINIDUMP_STRING containing the name of the thread.
  RVA64 RvaOfThreadName;
};

//! \brief Variable-sized struct which contains a list of MINIDUMP_THREAD_NAME
//! structs.
struct __attribute__((packed, aligned(4))) MINIDUMP_THREAD_NAME_LIST {
  //! \brief The number of MINIDUMP_THREAD_NAME structs following this field.
  uint32_t NumberOfThreadNames;

  //! \brief A variably-sized array containing zero of more
  //! MINIDUMP_THREAD_NAME.
  //!    The length of the array is indicated by the NumberOfThreadNames field
  //!    in this struct.
  struct MINIDUMP_THREAD_NAME ThreadNames[0];
};

#endif

@past-due
Copy link
Contributor

@supervacuus @Swatinem: I've opened a PR in the sentry crashpad repo to fix this: getsentry/crashpad#78

@supervacuus
Copy link
Collaborator

Thx, @past-due! I will try to have a look at it this week but it might be next week.

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

Successfully merging a pull request may close this issue.

6 participants