From 94f7f9eeb2e6f6b56ef6546cd0dc720b4b45ce06 Mon Sep 17 00:00:00 2001 From: Mark Mentovai Date: Wed, 11 Mar 2015 17:43:46 -0400 Subject: [PATCH] MinidumpCrashpadInfo: the default constructor should zero-initialize. This regressed in 359bdd86225c when a non-POD UUID data member was added to MinidumpCrashpadInfo, which made MinidumpCrashpadInfo non-POD. This problem seems to have affected MinidumpModuleCodeViewRecordPDB70 since it was added, but it is not likely to have caused any problems there because that structure never appears without having all of its members populated. By comparison, MinidumpCrashpadInfo may be sparsely populated. This caused 4 of the 5 MinidumpCrashpadInfoWriter tests to fail on Windows. TEST=crashpad_minidump_test MinidumpCrashpadInfoWriter.* R=rsesek@chromium.org Review URL: https://codereview.chromium.org/1001683002 --- minidump/minidump_extensions.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/minidump/minidump_extensions.h b/minidump/minidump_extensions.h index b2bb50eb..93164186 100644 --- a/minidump/minidump_extensions.h +++ b/minidump/minidump_extensions.h @@ -283,6 +283,16 @@ struct MinidumpModuleCodeViewRecordPDB20 { //! \sa MinidumpModuleCodeViewRecordPDB20 //! \sa IMAGE_DEBUG_MISC struct MinidumpModuleCodeViewRecordPDB70 { + // UUID has a constructor, which makes it non-POD, which makes this structure + // non-POD. In order for the default constructor to zero-initialize other + // members, an explicit constructor must be provided. + MinidumpModuleCodeViewRecordPDB70() + : signature(), + uuid(), + age(), + pdb_name() { + } + //! \brief The magic number identifying this structure version, stored in //! #signature. //! @@ -444,6 +454,16 @@ struct ALIGNAS(4) PACKED MinidumpModuleCrashpadInfoList { //! #version, so that newer parsers will be able to determine whether the added //! fields are valid or not. struct ALIGNAS(4) PACKED MinidumpCrashpadInfo { + // UUID has a constructor, which makes it non-POD, which makes this structure + // non-POD. In order for the default constructor to zero-initialize other + // members, an explicit constructor must be provided. + MinidumpCrashpadInfo() + : version(), + client_id(), + simple_annotations(), + module_list() { + } + //! \brief The structure’s currently-defined version number. //! //! \sa version