--
You received this message because you are subscribed to the Google Groups "Crashpad-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to crashpad-dev...@chromium.org.
To post to this group, send email to crashp...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/crashpad-dev/CA%2BAHSgYgW1uoCb-yJToZZ%3DbcXVt8kPczbNTAWdxPXBdgbEFLLQ%40mail.gmail.com.
Hi crashpad-dev,I'm interested in reporting a new type of stability data: structured data representing chromium's internal state. In the conventional case, this data is available in addition to the usual crash report data. In this case, the data can be added as an extra minidump stream. However, the data can also be available on its own. In this case, it can also be reported as a minidump, with the usual streams missing.I'm currently focusing on the unconventional case. Based on previous exchanges, I've gone ahead and manufactured a minidump wrapper for the data (https://codereview.chromium.org/2128683002/).My question are:- How can I inform CP about the minidump that needs to be uploaded? (CP should handle assigning an id, consent validation, throttling).
- If the solution is an in process API, how could I register a callback to perform the harvesting and invoke the API?
We don’t consider this an interface that we expose right now, so we should talk about that aspect of the problem, but really all you need to do is:
- Get a crashpad::CrashReportDatabase object. Depending on where you’re running, you may already have one. A Chrome browser process has one, it’s g_database in crashpad.cc. If you don’t have one yet, call crashpad::CrashReportDatabase::InitializeWithoutCreating(), giving it the path to the database on disk.
- Call PrepareNewCrashReport() on this object, which gives you a file handle you can write to.
- Call FinishedWritingCrashReport() when you’re done, or ErrorWritingCrashReport() to unwind. (CallErrorWritingCrashReport can help with the latter.)
If you do this from outside of the crashpad_handler process (which you will), the next crashpad_handler to start up will pick up your minidump. If a crashpad_handler is already running (as it normally would be), it should find your minidump within 15 minutes. It will upload it, or not, based on consent, rate-limiting, etc. I’d like to make this respond to filesystem notifications, but since all of our minidumps currently come from crashpad_handler which is able to signal the upload thread itself, this hasn’t been a priority.One important note: in order for this all to work nicely, your minidump needs to encode the “crash keys” that the Breakpad-type server expects to see in the minidump itself, in a Crashpad-specific manner. See BreakpadHTTPFormParametersFromMinidump(). If you don’t do this, Crashpad won’t really care and it’ll still upload the minidump as you asked it to, but the Breakpad-type server will throw it away because it won’t be able to figure out what to do with it. Unfortunately for you, this is where Crashpad sticks the “prod”, “plat”, and “guid” parameters when it writes its own minidumps, and it’s where it retrieves them and sets them for the Breakpad-type server when it performs an upload. (Maybe we could make crashpad_handler fall back to using its process annotation values for these keys if it finds them unset in the minidump.)