summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-11-23 17:48:16 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-02-22 20:51:50 +0000
commit0c15cf444bc80992c67b3d7eae8c71526d9a078d (patch)
treee46b6d0c9b902f29ec96e953ba40502c6b6890e5
parent76b7803fde43c994bb7ad2e37e2e4f27b1470f06 (diff)
upload crashes correctly to server for linux
Change-Id: I75778dc572a2888b3966cb5731f7e59209c7a942 Reviewed-on: https://gerrit.libreoffice.org/22551 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--desktop/source/app/sofficemain.cxx20
1 files changed, 17 insertions, 3 deletions
diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx
index b14df2f30a15..3c93c681a919 100644
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -19,6 +19,7 @@
#include <sal/config.h>
#include <config_features.h>
+#include <config_folders.h>
#include "desktopdllapi.h"
@@ -61,27 +62,40 @@
#if HAVE_FEATURE_BREAKPAD
+OString getLibDir()
+{
+ OUString aOriginal = "$BRAND_BASE_DIR/" LIBO_ETC_FOLDER;
+ rtl::Bootstrap::expandMacros(aOriginal);
+
+ return rtl::OUStringToOString(aOriginal, RTL_TEXTENCODING_UTF8);
+}
+
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* /*context*/, bool succeeded)
{
// send the minidump to the server (not yet implemented)
- SAL_WARN("sofficemain", "minidump generated: " << descriptor.path());
+ SAL_WARN("crashreport", "minidump generated: " << descriptor.path());
+ OString aCommand = getLibDir().copy(7) + "/minidump_upload -p LibreOffice -v \"5.1.0.0\" ";
+ aCommand = aCommand + descriptor.path() + " " + "http://libreofficecrash.org/submit";
+ int retVal = std::system(aCommand.getStr());
+ SAL_WARN_IF(retVal != 0, "crashreport", "Failed to upload minidump. Error Code: " << retVal);
return succeeded;
}
#endif
#endif
-
extern "C" int DESKTOP_DLLPUBLIC soffice_main()
{
#if HAVE_FEATURE_BREAKPAD
+ //limit the amount of code that needs to be executed before the crash reporting
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
google_breakpad::MinidumpDescriptor descriptor("/tmp");
google_breakpad::ExceptionHandler eh(descriptor, NULL, dumpCallback, NULL, true, -1);
-#endif
+#else
#endif
+#endif
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS)
/* Run test for OpenGL support in own process to avoid crash with broken