How can I upload additional files besides crash report to remote crash server?

778 views
Skip to first unread message

my...@backtrace.io

unread,
Aug 4, 2017, 10:00:23 AM8/4/17
to Crashpad-dev
Hi,

I wonder whether Crashpad can upload additional log files together with the crash dump. The client API and upload function doesn't seem to allow such operation.

Crashpad does allow user-defined minidump streams. I can put the log file in a stream. But it is not convenient, especially for multiple file attachments.

It would be nice for Crashpad to add file attachment to the client interface. Breakpad upload class supports that too.

Michael

Mark Mentovai

unread,
Aug 4, 2017, 10:38:49 AM8/4/17
to my...@backtrace.io, Crashpad-dev
The uploader itself supports this, but there’s nothing plumbed through to collect additional files for upload alongside the minidump.

We’ve generally been pulling things into the minidump instead of having them ride alongside, though. We’ve had trouble in practice when related data is split up, because the files tend to become separated. That diminishes their utility. You’ll notice that in Crashpad, we’ve even pulled the annotations (what Chrome calls “crash keys”) into the minidump, so that this information is available even when the minidump’s examined away from a collection server.

Multiple files may also complicate database design. There’s nothing insurmountable there, but it would introduce additional complexity.

What’s the source of the data you were you hoping to upload in a companion file? Does it already exist as a file on the client system, or is it somewhere in the crashing process’ memory image?


--
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+unsubscribe@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/96117ad4-b3cc-4913-8896-3d355747bd28%40chromium.org.

my...@backtrace.io

unread,
Aug 4, 2017, 12:12:45 PM8/4/17
to Crashpad-dev
Log file is usually desired. There can also be image file or other asset. They are files that exist on the client system.

Mark Mentovai

unread,
Aug 4, 2017, 3:27:06 PM8/4/17
to my...@backtrace.io, Crashpad-dev
Are the files of interest known to the crashing process? We could have an annotation-like way to communicate their paths to the handler via CrashpadInfo. Otherwise, if they need to be determined from outside, we could have the extensibility interface deal with it similarly to how it deals with custom streams.

--
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+unsubscribe@chromium.org.
To post to this group, send email to crashp...@chromium.org.

my...@backtrace.io

unread,
Aug 4, 2017, 3:48:28 PM8/4/17
to Crashpad-dev
On Friday, August 4, 2017 at 10:00:23 AM UTC-4, my...@backtrace.io wrote:
yes, the files are known to the crashing process. We only need to let handler know the paths and upload them in form data.

my...@backtrace.io

unread,
Aug 10, 2017, 10:23:53 AM8/10/17
to Crashpad-dev
On Friday, August 4, 2017 at 3:27:06 PM UTC-4, Mark Mentovai wrote:
> Are the files of interest known to the crashing process? We could have an annotation-like way to communicate their paths to the handler via CrashpadInfo. Otherwise, if they need to be determined from outside, we could have the extensibility interface deal with it similarly to how it deals with custom streams.
>
>
> On Fri, Aug 4, 2017 at 12:12 PM, <my...@backtrace.io> wrote:
> On Friday, August 4, 2017 at 10:00:23 AM UTC-4, my...@backtrace.io wrote:
>
> > Hi,
>
> >
>
> > I wonder whether Crashpad can upload additional log files together with the crash dump. The client API and upload function doesn't seem to allow such operation.
>
> >
>
> > Crashpad does allow user-defined minidump streams. I can put the log file in a stream. But it is not convenient, especially for multiple file attachments.
>
> >
>
> > It would be nice for Crashpad to add file attachment to the client interface. Breakpad upload class supports that too.
>
> >
>
> > Michael
>
>
>
> Log file is usually desired. There can also be image file or other asset. They are files that exist on the client system.
>
>
>
> --
>
> 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/d00a47f4-ca09-472a-beba-34e2d11e7255%40chromium.org.

The annotation-like way to pass file paths to Crashpad handler sounds simple and easy for integration. We see an increasing number of Crashpad users that want to upload log files along with crash dump in order to provide a full context for triage. Could you add the file attachment function to Crashpad? If yes, when do you think it might be available?

If it is not feasible in the near future, I can try adding the feature to Crashpad. It will be great to merge it to Crashpad master later. Could you let me know the best way to contribute? We like to have the feature by the end of August.

sba...@backtrace.io

unread,
Aug 21, 2017, 3:13:34 PM8/21/17
to Crashpad-dev
Hi all,

Hope all is well! A few of our users have been asking for this feature and we were going to provide them a few mechanisms to attach files with Crashpad. We're happy to enable this by attaching logs as custom streams in the minidump, but that may have other implications which would be potentially incompatible with plans in upstream. There are also other implications on things like crash reporting aggregators that do things like compaction or selective pruning of data.

We don't want to diverge from upstream, and would prefer to either contribute directly or ensure that our interfaces are compatible with what you all would prefer to have upstream.

Mark, are there any plans to include this capability in Crashpad? If not, what would be the best way for us to submit patches to allow for file attachments? From a design perspective, are there particular routes you would all prefer for inclusion into upstream or should we punt that discussion until the patch?

Mihnea Craciun

unread,
Aug 24, 2017, 10:56:37 AM8/24/17
to Crashpad-dev
Hi Mark,

I have been maintaining my own custom patch for crashpad to upload additional files for a bit over an year now.
I suffered through possibly two major refactoring changes in that code area and maintained it.
I am here just to lend my voice to the group of people pleading for official mainline support for custom file attachments to the crash upload.

Thanks for the great job you're doing.
Regards,
Mihnea

Mark Mentovai

unread,
Aug 24, 2017, 11:48:04 AM8/24/17
to Crashpad-dev
Hi, everyone. Sorry for the delay in responding.

I can see this feature’s utility for sure. I have two concerns with treating attached files as distinct files from the minidump: it leads to a more complex design for the local crash report database, and it makes it easier for the attachments and the minidump to become separated from each other. We’ve had a very real problem in the past with the latter issue when using the Breakpad client. It was too easy for annotations (“crash keys”) to became separated from the minidumps that they belonged to. This is why annotations are now stored in a Crashpad minidump’s MinidumpCrashpadInfo stream, in addition to being sent to the collection server as an <inpute type="text" /> for Breakpad compatibility.

Taking a step back to look at the bigger picture, I think that everyone’s really asking for a way to attach files to minidumps somehow, but that it’s probably not important what the precise transport mechanism is. The Breakpad client made these attachments look like <input type="file" /> that were siblings to the minidump, but that’s more of an implementation detail to me.

What I’d like to propose for the design of this feature is to archive these attachments in the minidump file itself. Now, it would be possible to hang them off of a custom user stream, or we could hang them somewhere off of our MinidumpCrashpadInfo stream. That’d be fairly easy to implement on our end, but it’d require special tooling to extract the attached files. One of our goals with Crashpad is to keep things to familiar and comfortable formats and tools when possible.

An old idea that I had that I’d like to consider using for this feature is to make our minidumps into “polyglot files”. A minidump is identified by its header, which is conveniently at the beginning of the file. A .zip archive is identified by its header, which is actually a trailer at the end of the file. We can smush a minidump and .zip archive together, and let the attached files live in the .zip portion. Existing minidump tools could be used to interact with the minidump portion of the file, and existing zip tools could be used to interact with the .zip portion. This is similar to how self-extracting .zip files are laid out as executables, while it remains possible to interact with them using standard zip tools.

An annotation-like interface for the crashing process to communicate desired attachments to the handler via absolute pathname should be uncontroversial.

--
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+unsubscribe@chromium.org.

To post to this group, send email to crashp...@chromium.org.

Mihnea Craciun

unread,
Aug 24, 2017, 12:31:41 PM8/24/17
to Mark Mentovai, Crashpad-dev
Hi Mark, 
Cating the files together sounds like really an out of the box idea and I can see it working just fine.
On the other hand, I for one, would be just as happy with a second upload request sent to a second, different URL, which frees the existing processing back-ends of any compatibility burden.



Samy Bahra

unread,
Sep 14, 2017, 4:11:44 PM9/14/17
to Crashpad-dev, ma...@chromium.org
Hi all,

Any updates on this effort? Mark, if this is far off in the horizon, we could submit a patch allowing multipart POST for attachments some time this month.

Mirroring Mihnea, uploading using multipart would work best for us as well. Multipart POST is terrific in that it's easier for compatibility purposes for Breakpad-compatible Crashpad-services. It would just need to be differentiated from other parts for annotations.

If we go with embedding in minidump: This also works quite well for us, but folks would want to be able to attach arbitrary files, and unfortunately, it means Crashpad-specific framing needs to be developed to encode file name, mime type and so forth (auto-derivation of MIME type is possible for us).

If we go with concatenation (lowest preference): This works but I do know quite a few folks would prefer not to use `.zip` if they can avoid it, especially on crash path. Folks may append gzip, snappy streams or things like compressed image files / assets.
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.

--
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.

Mark Mentovai

unread,
Oct 2, 2017, 2:37:38 PM10/2/17
to Samy Bahra, Crashpad-dev
Samy and others-

I know that there’s enthusiasm for this feature, and we do have a future need for it in our own use as well, but it’s not quite an immediate need for us. It’d be great to harness the energy that the community has for it on a shorter timeframe, though. So here’s what I’ll do: I’ll write up a design doc for how we’d like to see this feature implemented, and check it into the repository. We can discuss it and if there are any takers, we can get to work on an implementation.

What do you think?

If the model works well, then the other thing we might want to try this approach with is HTTPS public key pinning.

Mark

To unsubscribe from this group and stop receiving emails from it, send an email to crashpad-dev+unsubscribe@chromium.org.

To post to this group, send email to crashp...@chromium.org.

Samy Bahra

unread,
Oct 2, 2017, 3:03:48 PM10/2/17
to Mark Mentovai, Crashpad-dev
Perfect! Thanks Mark. We are happy to put someone on it.

an...@openfin.co

unread,
Jul 26, 2018, 1:10:00 PM7/26/18
to Crashpad-dev, ma...@chromium.org
Hi all - apologies for resurrecting this thread, but what's the current status on this? I couldn't find the design doc that was mentioned.

Joshua Peraza

unread,
Jul 26, 2018, 3:42:04 PM7/26/18
to an...@openfin.co, Crashpad-dev, Mark Mentovai
This is maybe the thread you're looking for:

The generic database has been updated to support file attachments, but there is not yet a client interface to pass them to the handler.

Reply all
Reply to author
Forward
0 new messages