Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Issue 867363003: win: Implementation of CrashReportDatabase for Windows (Closed)

Created:
5 years, 10 months ago by scottmg
Modified:
5 years, 10 months ago
CC:
crashpad-dev_chromium.org
Base URL:
https://chromium.googlesource.com/crashpad/crashpad@master
Target Ref:
refs/heads/master
Project:
crashpad
Visibility:
Public.

Description

win: Implementation of CrashReportDatabase for Windows As there are no extended file attributes available on all Windows file systems (NTFS supports alternate data streams, but Chrome still supports running on FAT), instead of using metadata attached to the file, metadata is stored separately in a simple record-based file and keyed by UUID. Initially, I attempted a metadata file beside each report, each locked separately more closely mirroring the Mac implementation. But given the expected number of of active reports (in the 10s to 100s range?) and the size of the metadata for each, simply storing it all in one file is much less complicated when considering error situations. If the serialization/deserialization becomes a measurable problem, it could be optimized at some complexity by reading/writing only as necessary, or optimizing the storage. R=mark@chromium.org, rsesek@chromium.org BUG=crashpad:1 Committed: https://chromium.googlesource.com/crashpad/crashpad/+/0849154aedd9262d5a38a4a0c9c019e644bce906

Patch Set 1 #

Patch Set 2 : some impl #

Patch Set 3 : . #

Patch Set 4 : load/save a metadata file #

Patch Set 5 : wip #

Patch Set 6 : rewrite with single metadata file #

Patch Set 7 : tidy, docstrings #

Total comments: 43

Patch Set 8 : some fixes #

Patch Set 9 : fixed size binary data file #

Total comments: 11

Patch Set 10 : fixes #

Total comments: 15

Patch Set 11 : Remove unused function and \returns #

Patch Set 12 : validation on strings #

Total comments: 61

Patch Set 13 : fixes #

Patch Set 14 : simpler scoped-like behaviour for Metadata #

Patch Set 15 : relocate database test #

Patch Set 16 : comment #

Patch Set 17 : move lock inside #

Patch Set 18 : filepath relative to reports dirs #

Patch Set 19 : ScopedTempDir::Rename implementation for posix #

Total comments: 8

Patch Set 20 : fixes #

Total comments: 18

Patch Set 21 : add CS to metadata #

Patch Set 22 : Create -> protected #

Patch Set 23 : revert cs #

Patch Set 24 : comment on upload crashes #

Patch Set 25 : CreateFile #

Total comments: 3

Patch Set 26 : log on Read() failure #

Total comments: 39

Patch Set 27 : fixes2 #

Total comments: 10

Patch Set 28 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+795 lines, -18 lines) Patch
M client/client.gyp View 1 2 1 chunk +14 lines, -4 lines 0 comments Download
M client/crash_report_database_mac.mm View 1 2 3 4 5 6 7 8 9 3 chunks +3 lines, -4 lines 0 comments Download
M client/crash_report_database_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +25 lines, -1 line 0 comments Download
A client/crash_report_database_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +699 lines, -0 lines 0 comments Download
M util/misc/uuid.h View 1 2 chunks +6 lines, -0 lines 0 comments Download
M util/misc/uuid.cc View 1 2 chunks +7 lines, -0 lines 0 comments Download
M util/test/scoped_temp_dir.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +4 lines, -1 line 0 comments Download
M util/test/scoped_temp_dir_posix.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +6 lines, -0 lines 0 comments Download
M util/test/scoped_temp_dir_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +31 lines, -8 lines 0 comments Download

Messages

Total messages: 55 (13 generated)
scottmg
5 years, 10 months ago (2015-02-02 18:03:29 UTC) #4
Robert Sesek
Nice! Two points 1) I remember in Chrome on Windows we had an issue with ...
5 years, 10 months ago (2015-02-02 23:06:09 UTC) #5
Robert Sesek
https://codereview.chromium.org/867363003/diff/180001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/180001/client/crash_report_database_win.cc#newcode214 client/crash_report_database_win.cc:214: if (lines[0].as_string() != "crashpad metadata") I thought about this ...
5 years, 10 months ago (2015-02-03 16:29:29 UTC) #6
scottmg
Thanks! Partially addressed pending further discussion on the file format. https://codereview.chromium.org/867363003/diff/180001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/180001/client/crash_report_database_win.cc#newcode62 ...
5 years, 10 months ago (2015-02-03 18:56:40 UTC) #7
scottmg
On 2015/02/03 18:56:40, scottmg wrote: > Thanks! Partially addressed pending further discussion on the file ...
5 years, 10 months ago (2015-02-03 20:55:54 UTC) #9
scottmg
Hi Robert, could you take another look?
5 years, 10 months ago (2015-02-04 23:15:55 UTC) #10
Robert Sesek
On 2015/02/04 23:15:55, scottmg wrote: > Hi Robert, could you take another look? Sorry, I've ...
5 years, 10 months ago (2015-02-04 23:16:42 UTC) #11
Robert Sesek
I like it! The all-binary version is much cleaner. https://codereview.chromium.org/867363003/diff/180001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/180001/client/crash_report_database_win.cc#newcode196 client/crash_report_database_win.cc:196: ...
5 years, 10 months ago (2015-02-05 18:43:09 UTC) #12
scottmg
Thanks! Added implementation of new ErrorWritingCrashReport too. https://codereview.chromium.org/867363003/diff/180001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/180001/client/crash_report_database_win.cc#newcode196 client/crash_report_database_win.cc:196: ScopedFileHandle input_file(ScopedFileHandle(LoggingOpenFileForRead(path))); ...
5 years, 10 months ago (2015-02-05 19:27:55 UTC) #14
Robert Sesek
I'm being paranoid, but might as well be safe. FYI: I'm out Fri&Mon so Mark ...
5 years, 10 months ago (2015-02-05 22:46:18 UTC) #15
scottmg
I don't mind adding the extra verification on Read() but it does seem a bit ...
5 years, 10 months ago (2015-02-05 23:43:11 UTC) #16
Robert Sesek
On 2015/02/05 23:43:11, scottmg wrote: > I don't mind adding the extra verification on Read() ...
5 years, 10 months ago (2015-02-05 23:46:08 UTC) #17
scottmg
OK, sounds good. I did the two below which are the ones that could be ...
5 years, 10 months ago (2015-02-06 00:02:40 UTC) #18
Mark Mentovai
https://codereview.chromium.org/867363003/diff/320001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/320001/client/crash_report_database_win.cc#newcode23 client/crash_report_database_win.cc:23: #include "base/files/file_path.h" Since crash_report_database.h is the top #include and ...
5 years, 10 months ago (2015-02-06 21:13:24 UTC) #19
scottmg
Thanks. After your comments, I'm going to see if I can avoid returning mutable ReportDisk*s ...
5 years, 10 months ago (2015-02-06 22:58:18 UTC) #20
Mark Mentovai
OK, let me know when you’ve got the next round ready. https://codereview.chromium.org/867363003/diff/320001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): ...
5 years, 10 months ago (2015-02-06 23:29:52 UTC) #21
scottmg
Primary changes since ps#12 are to make Metadata be Scoped and have responsibility for any ...
5 years, 10 months ago (2015-02-07 01:21:58 UTC) #23
scottmg
On 2015/02/07 01:21:58, scottmg (ooo mon feb 9th) wrote: > Primary changes since ps#12 are ...
5 years, 10 months ago (2015-02-07 04:58:30 UTC) #24
scottmg
Mac test code implemented now, ready for another look.
5 years, 10 months ago (2015-02-10 19:44:20 UTC) #25
Robert Sesek
https://codereview.chromium.org/867363003/diff/320001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/320001/client/crash_report_database_win.cc#newcode257 client/crash_report_database_win.cc:257: // Each record will have two NUL-terminated strings in ...
5 years, 10 months ago (2015-02-10 20:32:26 UTC) #26
scottmg
https://codereview.chromium.org/867363003/diff/320001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/320001/client/crash_report_database_win.cc#newcode257 client/crash_report_database_win.cc:257: // Each record will have two NUL-terminated strings in ...
5 years, 10 months ago (2015-02-10 20:58:45 UTC) #28
Mark Mentovai
https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc#newcode245 client/crash_report_database_win.cc:245: if (!LockFileEx(handle, If two threads in the same process ...
5 years, 10 months ago (2015-02-10 22:16:29 UTC) #29
Robert Sesek
https://codereview.chromium.org/867363003/diff/480001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/480001/client/crash_report_database_win.cc#newcode140 client/crash_report_database_win.cc:140: static scoped_ptr<Metadata> Create(const base::FilePath& metadata_file, On 2015/02/10 20:58:45, scottmg ...
5 years, 10 months ago (2015-02-10 22:39:35 UTC) #30
scottmg
https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc#newcode245 client/crash_report_database_win.cc:245: if (!LockFileEx(handle, On 2015/02/10 22:16:29, Mark Mentovai wrote: > ...
5 years, 10 months ago (2015-02-10 22:44:01 UTC) #32
scottmg
https://codereview.chromium.org/867363003/diff/480001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/480001/client/crash_report_database_win.cc#newcode140 client/crash_report_database_win.cc:140: static scoped_ptr<Metadata> Create(const base::FilePath& metadata_file, On 2015/02/10 22:39:35, Robert ...
5 years, 10 months ago (2015-02-10 22:47:33 UTC) #33
Mark Mentovai
https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc#newcode245 client/crash_report_database_win.cc:245: if (!LockFileEx(handle, scottmg wrote: > Hmm, I had only ...
5 years, 10 months ago (2015-02-10 22:49:29 UTC) #34
scottmg
https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc#newcode245 client/crash_report_database_win.cc:245: if (!LockFileEx(handle, On 2015/02/10 22:49:29, Mark Mentovai wrote: > ...
5 years, 10 months ago (2015-02-10 23:28:37 UTC) #35
Mark Mentovai
https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc#newcode245 client/crash_report_database_win.cc:245: if (!LockFileEx(handle, scottmg wrote: > Er, wait! Writing the ...
5 years, 10 months ago (2015-02-10 23:37:03 UTC) #36
scottmg
https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc#newcode245 client/crash_report_database_win.cc:245: if (!LockFileEx(handle, On 2015/02/10 23:28:37, scottmg wrote: > On ...
5 years, 10 months ago (2015-02-10 23:42:17 UTC) #37
scottmg
https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc#newcode245 client/crash_report_database_win.cc:245: if (!LockFileEx(handle, On 2015/02/10 23:37:03, Mark Mentovai wrote: > ...
5 years, 10 months ago (2015-02-10 23:54:40 UTC) #38
Mark Mentovai
https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc#newcode245 client/crash_report_database_win.cc:245: if (!LockFileEx(handle, scottmg wrote: > Oh dear. And in ...
5 years, 10 months ago (2015-02-11 00:31:36 UTC) #39
scottmg
https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc#newcode245 client/crash_report_database_win.cc:245: if (!LockFileEx(handle, On 2015/02/11 00:31:35, Mark Mentovai wrote: > ...
5 years, 10 months ago (2015-02-11 01:13:40 UTC) #40
Robert Sesek
https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/520001/client/crash_report_database_win.cc#newcode245 client/crash_report_database_win.cc:245: if (!LockFileEx(handle, On 2015/02/11 01:13:40, scottmg wrote: > [[ ...
5 years, 10 months ago (2015-02-11 03:16:08 UTC) #41
scottmg
https://codereview.chromium.org/867363003/diff/640001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/640001/client/crash_report_database_win.cc#newcode264 client/crash_report_database_win.cc:264: // If Read() fails, for whatever reason (corruption, etc.) ...
5 years, 10 months ago (2015-02-11 04:39:29 UTC) #42
Robert Sesek
LGTM https://codereview.chromium.org/867363003/diff/640001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/640001/client/crash_report_database_win.cc#newcode264 client/crash_report_database_win.cc:264: // If Read() fails, for whatever reason (corruption, ...
5 years, 10 months ago (2015-02-11 17:24:31 UTC) #43
Mark Mentovai
https://codereview.chromium.org/867363003/diff/660001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/660001/client/crash_report_database_win.cc#newcode21 client/crash_report_database_win.cc:21: #include <limits> Unused? https://codereview.chromium.org/867363003/diff/660001/client/crash_report_database_win.cc#newcode54 client/crash_report_database_win.cc:54: //! directory could not ...
5 years, 10 months ago (2015-02-11 17:25:50 UTC) #44
Mark Mentovai
Robert Sesek wrote: > I was thinking Crashpad may want to log its output to ...
5 years, 10 months ago (2015-02-11 17:29:52 UTC) #45
scottmg
https://codereview.chromium.org/867363003/diff/660001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/660001/client/crash_report_database_win.cc#newcode21 client/crash_report_database_win.cc:21: #include <limits> On 2015/02/11 17:25:50, Mark Mentovai wrote: > ...
5 years, 10 months ago (2015-02-11 19:24:55 UTC) #50
Mark Mentovai
LGTM. Nice job! https://codereview.chromium.org/867363003/diff/660001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/660001/client/crash_report_database_win.cc#newcode202 client/crash_report_database_win.cc:202: }; scottmg wrote: > Done (padded ...
5 years, 10 months ago (2015-02-11 19:39:56 UTC) #51
scottmg
Thanks for ploughing through. :) https://codereview.chromium.org/867363003/diff/730001/client/crash_report_database_win.cc File client/crash_report_database_win.cc (right): https://codereview.chromium.org/867363003/diff/730001/client/crash_report_database_win.cc#newcode316 client/crash_report_database_win.cc:316: if (string_table.empty() || string_table.back() ...
5 years, 10 months ago (2015-02-11 19:56:52 UTC) #53
Mark Mentovai
LGTM
5 years, 10 months ago (2015-02-11 19:57:59 UTC) #54
scottmg
5 years, 10 months ago (2015-02-11 20:17:10 UTC) #55
Message was sent while issue was closed.
Committed patchset #28 (id:750001) manually as
0849154aedd9262d5a38a4a0c9c019e644bce906 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698