What would be the best way to implement crash reporting in a cross-platform app in c++ (windows, mac, linux)? Looked into google breakpad, but spent a few weeks trying to make socorro (UI) work to no avail.
edit: @Nim to clear up, I want开发者_运维知识库 to send a stack-trace to my server when some exception occurs.
When we went crossplatform (from being previously Windows-only), we spent a lot of time researching the possible tools for exactly this. Google Breakpad really is the best crossplatform solution out there.
Your problem is Socorro, which is huge, obfuscated, and confusing. I can suggest two routes:
- Drop the current version of Socorro, which is way too much in love with newfangled OSS toys like Hadoop, and roll back to Socorro 1.x. You'll need to do a bit more work to set up your processors, and your dumps will go into a Postgres table, but you'll have way fewer moving parts and crazy infrastructure to deal with.
- Forget about Socorro altogether and write your own processors for the Breakpad dumps and a UI to view them with. Breakpad has already done the really hard work -- parsing the symbols and catching the exceptions -- so all you need to write is a collector that the dumps can get uploaded to, a farm to run the Breakpad processors on them, someplace to store the processed results, and something to view them.
Knowing what we do now, we would have probably gone with the second option rather than trying to integrate Socorro — the amount of time it's taken us to find a version of Socorro that works for us and adapt it to our workflow has already exceeded what it would have taken for us to just write a system that does exactly what we want.
I doubt there is a reliable one except google-breakpad as win/mac/linux all-in-one solution. Your best bet would be to use a cross-platform logging library and handle SEH exceptions and use windbg if you need minidumps (here is some good resources on that: http://www.debuginfo.com/articles.html)
精彩评论