This implements the client part of the crash reporting for windows, server wise I developed
with https://sentry.io since it's opensource and they offer both hosted and onsite installs.
(I also tested with https://backtrace.io which will work equally well but appear to be less
It's a little rough around the edges but the basic functionality is there. Things of note:
- Consent/privacy, it never uploads anything to the server without the users consent, there's a
dialog for every crash, minidumps are essentialy small memory dumps and may contain personal information.
sentry however only extracts the callstacks and removes the actual dump once done, so no actual
personal information will be stored on the server.
- The crashpad api is different between windows and mac/linux due to wstrings being used for
windows for some reason, so the implementation has been seperated out in a _win.cpp file for
this reason, mac/linux may be able to share an implementation.
- I attached a copy of the required libs they need to go into win64_vc14\crashpad
-crashpad is designed to have no UI what so ever, so after installing the crashpad handler,
I revert back to our handler and call crashpad only after getting consent from the end user.
-Symbols are only required on the server, so we do not have to ship a 300mb+ symbol file to end
-I'm pretty sure there's some whitespace and other codestyle issues, which will have to be cleaned up
but are not the main focus for this review at this point in time.
-2.8 only, i don't see another 2.79 release coming and 2.8 is pretty crashy at this point in time
so it felt like a natural fit.
Setting it all up is a little tricky, but following these steps should work.
- unpack the attached libs to win64_64/crashpad
- Get an account on https://sentry.io, the free one will work, setting up our own server should work as well but will probably require a little larger investment of time.
- when you are logged in , get the minidump url from https://docs.sentry.io/clients/minidump/crashpad/
- run "win64_vc14/crashpad/bin/sentry-cli-Windows-x86_64 login" and authenticate , this will create a settings file in your profile folder so we don't have to include logins and passwords in the build scripts.
- Build with -DWITH_CRASHPAD=On -DCRASHPAD_URL=https://blahblah.whatever.minidump.url.they.gave.you
- Run the resulting blender.exe (do not run in the debugger, since the debugger will catch the exceptions, not the crashhandler)
- validate crashdumps are coming in on https://sentry.io/your-organization/your-appname/
- Remove the null deref I left in creator.c
- business as usual.
-Not a super huge fan of the popup everytime, however users prefs may not have loaded at the time of the crash, UI team might have a thing or two to say here.
-Wording of the popup also could probably be improved.
-Sentry does support getting traces from python as well, could be interesting for the python devs?
-There's some integration available between sentry and phabricator, could be interesting to explore.
I'm no export on sentry, I'm about 2 weeks of googling ahead of you guys.