backtrace-labs / crashpad

A fork of Crashpad with file attachment support and other improvements.
Apache License 2.0
99 stars 33 forks source link

App reports invalid attachments from Chrome crashpad database #55

Open alecazam opened 11 months ago

alecazam commented 11 months ago

Our game has a debug builds that don't include crashpad in the build, and crashpad_handler.exe isn't deployed alongside the .exe. Only our shipping builds do this. Yet when running the debug build, we get crashpad errors in our logs with errors trying to find attachments from Chrome. This is worriesome that somehow our app even without the crashpad library or handler is somehow triggering crashpad errors.

[1115/142504.058:ERROR:filesystem_win.cc(130)] GetFileAttributes C:\Users\foo\AppData\Local\Google\Chrome\User Data\Crashpad\attachments\c46abb11-db2d-4000-ae60-62c212511087: The system cannot find the file specified. (0x2)
[1115/142504.059:ERROR:filesystem_win.cc(130)] GetFileAttributes C:\Users\foo\AppData\Local\Google\Chrome\User Data\Crashpad\attachments\66f378f7-2f27-47b4-9284-722b89ddb398: The system cannot find the file specified. (0x2)
[1115/142504.059:ERROR:filesystem_win.cc(130)] GetFileAttributes C:\Users\foo\AppData\Local\Google\Chrome\User Data\Crashpad\attachments\201f16ff-7792-4774-8648-26ea43ec91a9: The system cannot find the file specified. (0x2)
[1115/142504.064:ERROR:filesystem_win.cc(130)] GetFileAttributes C:\Users\foo\AppData\Local\Google\Chrome\User Data\Crashpad\attachments\65950f34-8e80-4070-935b-25950d63ef02: The system cannot find the file specified. (0x2) 

The workaround for now, was to go to this folder delete the metadata file from Google/Chrome.

KrzaQ commented 11 months ago

Don't initialize crashpad in the debug build if you don't want to use it.

alecazam commented 11 months ago

We don't and we can't. The library isn't even loaded. So makes no sense why these errors show up. I've already reported the code in the Issues for how to wipe the crashpad database, and in Release we do that every time we launch. That code wasn't a part of the sample code from Backtrace. Without it, we were getting similar errors above but from our app metadata. The errors above are from Google Chrome but in our game.

alecazam commented 11 months ago

#if IS_RELEASE

#include <client/crashpad_client.h>
#include <client/settings.h>
#include <client/crash_report_database.h>
#include <client/crashpad_info.h>

// This is using libs built from new sources
// renamed from client.lib
#pragma comment( lib, "crashpad_client.lib" )

#endif
KrzaQ commented 11 months ago

Are you disabling the actual function calls for crashpad initialization?

alecazam commented 11 months ago

Yes, they're all in that file.

if IS_RELEASE

InitializeCrashpad( backtraceToken );

else

(void)backtraceToken;

endif

KrzaQ commented 11 months ago

In that case, backtrace-crashpad is unlikely to be the culprit. Is it possible that your game or one of its dependencies include Google Chrome or something Chrome-based to render webpages (e.g. help, eula)?

alecazam commented 11 months ago

Yes, maybe there's a Chromium or mini chromium that is causing this. Will see if that's the case.