Makefile.fetch | 1 Makefile.gbuild | 3 Makefile.in | 13 Repository.mk | 2 RepositoryExternal.mk | 24 bin/symbolstore.py | 644 +++++++++++++ bin/upload_symbols.py | 50 + cli_ure/Executable_climaker.mk | 2 cli_ure/Library_cli_cppuhelper_native.mk | 1 cli_ure/Library_cli_uno.mk | 1 config_host.mk.in | 2 config_host/config_features.h.in | 5 configure.ac | 37 desktop/Executable_minidump_upload.mk | 27 desktop/Library_crashreport.mk | 49 desktop/Library_sofficeapp.mk | 8 desktop/Module_desktop.mk | 4 desktop/StaticLibrary_minidump.mk | 19 desktop/source/app/app.cxx | 68 + desktop/source/app/crashreport.cxx | 124 ++ desktop/source/app/sofficemain.cxx | 64 + desktop/source/app/sofficemain.h | 2 desktop/source/inc/desktopdllapi.h | 24 desktop/source/minidump/minidump.cxx | 207 ++++ desktop/source/minidump/minidump_upload.cxx | 32 desktop/source/pkgchk/unopkg/unopkg_app.cxx | 2 desktop/source/pkgchk/unopkg/unopkg_main.h | 2 distro-configs/LibreOfficeLinux.conf | 1 distro-configs/LibreOfficeWin32.conf | 1 distro-configs/LibreOfficeWin64.conf | 1 download.lst | 2 external/Module_external.mk | 1 external/breakpad/ExternalProject_breakpad.mk | 29 external/breakpad/Makefile | 14 external/breakpad/Module_breakpad.mk | 26 external/breakpad/README | 21 external/breakpad/StaticLibrary_breakpad.mk | 37 external/breakpad/UnpackedTarball_breakpad.mk | 21 external/breakpad/breakpad-stackwalk.patch.1 | 32 external/breakpad/breakpad-use-correct-http-header.patch.1 | 14 external/breakpad/breakpad-wshadow.patch.1 | 232 ++++ external/breakpad/breakpad-wshadow2.patch.1 | 144 ++ external/libpng/configs/pnglibconf.h | 37 framework/Library_fwk.mk | 2 framework/source/services/desktop.cxx | 16 include/desktop/crashreport.hxx | 80 + include/desktop/dllapi.h | 30 include/desktop/minidump.hxx | 25 include/sal/config.h | 3 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx | 3 sal/Library_sal.mk | 1 sal/inc/internal/signalshared.hxx | 42 sal/osl/all/signalshared.cxx | 164 +++ sal/osl/unx/signal.cxx | 215 ---- sal/osl/w32/salinit.cxx | 6 sal/osl/w32/signal.cxx | 257 ----- solenv/gbuild/extensions/pre_MergedLibsList.mk | 1 solenv/gbuild/platform/com_MSC_defs.mk | 2 svx/Library_svx.mk | 7 svx/UIConfig_svx.mk | 1 svx/source/dialog/crashreportdlg.cxx | 100 ++ svx/source/dialog/crashreportdlg.hxx | 45 svx/source/dialog/crashreportui.cxx | 100 ++ svx/uiconfig/ui/crashreportdlg.ui | 118 ++ svx/util/svx.component | 4 vcl/Library_vcl.mk | 2 vcl/opengl/win/WinDeviceInfo.cxx | 6 vcl/opengl/x11/X11DeviceInfo.cxx | 7 vcl/source/opengl/OpenGLHelper.cxx | 3 vcl/source/window/builder.cxx | 6 70 files changed, 2838 insertions(+), 438 deletions(-)
New commits: commit 747f5023c44d709cae8fb6f15306afd9480baff9 Author: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> Date: Thu Jan 12 16:47:40 2017 +0100 Disable CrashReportUI since we don't offer upload - only want the dumps Change-Id: I6d084757d83204cb960905d7eb78571b13f8f875 diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 3be4f9e..bfe5219 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1053,7 +1053,8 @@ bool crashReportInfoExists() #if HAVE_FEATURE_BREAKPAD void handleCrashReport() { - static const char SERVICENAME_CRASHREPORT[] = "com.sun.star.comp.svx.CrashReportUI"; + // Don't show the dialog since we don't offer upload - only want the dumps + /*static const char SERVICENAME_CRASHREPORT[] = "com.sun.star.comp.svx.CrashReportUI"; css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); @@ -1067,7 +1068,7 @@ void handleCrashReport() css::util::URL aURL; css::uno::Any aRet = xRecoveryUI->dispatchWithReturnValue(aURL, css::uno::Sequence< css::beans::PropertyValue >()); bool bRet = false; - aRet >>= bRet; + aRet >>= bRet;*/ } #endif commit a5699485d8ccd2ec3b43d4116f8b83e2b2a8f8c0 Author: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> Date: Thu Jan 12 16:46:45 2017 +0100 Add build id to crash metadata Change-Id: I0e11a96936ea08cc439fcc1b1e3ff1f59c636665 diff --git a/desktop/Library_crashreport.mk b/desktop/Library_crashreport.mk index ba2f348..d6d9b8b 100644 --- a/desktop/Library_crashreport.mk +++ b/desktop/Library_crashreport.mk @@ -36,6 +36,7 @@ $(eval $(call gb_Library_use_libraries,crashreport,\ cppuhelper \ sal \ salhelper \ + utl \ $(gb_UWINAPI) \ )) diff --git a/desktop/source/app/crashreport.cxx b/desktop/source/app/crashreport.cxx index 428339d..04b234f 100644 --- a/desktop/source/app/crashreport.cxx +++ b/desktop/source/app/crashreport.cxx @@ -10,6 +10,7 @@ #include <desktop/crashreport.hxx> #include <rtl/bootstrap.hxx> #include <osl/file.hxx> +#include <unotools/bootstrap.hxx> #include <config_version.h> #include <config_folders.h> @@ -65,6 +66,7 @@ void CrashReporter::writeCommonInfo() std::ofstream minidump_file(ini_path, std::ios_base::trunc); minidump_file << "ProductName=LibreOffice\n"; minidump_file << "Version=" LIBO_VERSION_DOTTED "\n"; + minidump_file << "BuildID=" << utl::Bootstrap::getBuildIdData("") << "\n"; minidump_file << "URL=http://crashreport.libreoffice.org/submit/\n"; for (auto& keyValue : maKeyValues) { commit c1c98cd4a8a121b367c56d6af2a03d28af3adb17 Author: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> Date: Thu Jan 12 14:28:04 2017 +0100 Prevent warning b/c of unreachable code Change-Id: If18350314600132b2663e99b85abe3684585e6cf diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index dba80c0..2d71eb8 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -1764,16 +1764,16 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & } } } - SAL_WARN_IF(!xWindow, "vcl.layout", "probably need to implement " << name.getStr() << " or add a make" << name.getStr() << " function"); + //SAL_WARN_IF(!xWindow, "vcl.layout", "probably need to implement " << name.getStr() << " or add a make" << name.getStr() << " function"); if (xWindow) { xWindow->SetHelpId(m_sHelpRoot + id); - SAL_INFO("vcl.layout", "for " << name.getStr() << + /*SAL_INFO("vcl.layout", "for " << name.getStr() << ", created " << xWindow.get() << " child of " << pParent << "(" << xWindow->mpWindowImpl->mpParent.get() << "/" << xWindow->mpWindowImpl->mpRealParent.get() << "/" << xWindow->mpWindowImpl->mpBorderWindow.get() << ") with helpid " << - xWindow->GetHelpId().getStr()); + xWindow->GetHelpId().getStr());*/ m_aChildren.push_back(WinAndId(id, xWindow, bVertical)); } return xWindow; commit fac9a3e0de01ac0a95b04010d3fb12ccfd142326 Author: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> Date: Thu Jan 12 13:49:17 2017 +0100 Fix CrashReportDialog Change-Id: I0a4ba001dcd8dc5d1027f798c8abbf6d2162314e diff --git a/svx/source/dialog/crashreportdlg.cxx b/svx/source/dialog/crashreportdlg.cxx index a05a8e0..f9652a8 100644 --- a/svx/source/dialog/crashreportdlg.cxx +++ b/svx/source/dialog/crashreportdlg.cxx @@ -33,7 +33,7 @@ CrashReportDialog::CrashReportDialog(vcl::Window* pParent): mpBtnSend->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl)); mpBtnCancel->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl)); mpBtnClose->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl)); - mpEditPostUpload->SetReadOnly(true); + mpEditPostUpload->SetReadOnly(); } CrashReportDialog::~CrashReportDialog() @@ -53,19 +53,7 @@ void CrashReportDialog::dispose() Dialog::dispose(); } -namespace { - -OUString getLibDir() -{ - OUString aOriginal = "$BRAND_BASE_DIR/" LIBO_LIBEXEC_FOLDER; - rtl::Bootstrap::expandMacros(aOriginal); - - return aOriginal; -} - -} - -IMPL_LINK_TYPED(CrashReportDialog, BtnHdl, Button*, pBtn, void) +IMPL_LINK(CrashReportDialog, BtnHdl, Button*, pBtn) { if (pBtn == mpBtnSend.get()) { @@ -106,6 +94,7 @@ IMPL_LINK_TYPED(CrashReportDialog, BtnHdl, Button*, pBtn, void) { Close(); } + return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/dialog/crashreportdlg.hxx b/svx/source/dialog/crashreportdlg.hxx index 89f567a..f99a4e1 100644 --- a/svx/source/dialog/crashreportdlg.hxx +++ b/svx/source/dialog/crashreportdlg.hxx @@ -20,9 +20,9 @@ class CrashReportDialog : public Dialog { public: - CrashReportDialog(vcl::Window* pParent); + explicit CrashReportDialog(vcl::Window* pParent); - ~CrashReportDialog(); + virtual ~CrashReportDialog() override; virtual void dispose() override; @@ -37,7 +37,7 @@ private: OUString maSuccessMsg; - DECL_LINK_TYPED(BtnHdl, Button*, void); + DECL_LINK(BtnHdl, Button*); }; #endif commit 7e17379869dd626747f86f0cb9ae3cad01db1d24 Author: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> Date: Thu Jan 12 10:20:39 2017 +0100 Update crashreportdlg.ui from master Easier than backporting changes Change-Id: Ic62d587c47d3840df5a33eb07b13b8dc1145d84e diff --git a/svx/uiconfig/ui/crashreportdlg.ui b/svx/uiconfig/ui/crashreportdlg.ui index c148ee8..9dd35f6 100644 --- a/svx/uiconfig/ui/crashreportdlg.ui +++ b/svx/uiconfig/ui/crashreportdlg.ui @@ -4,22 +4,27 @@ <requires lib="gtk+" version="3.12"/> <object class="GtkDialog" id="CrashReportDialog"> <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Crash Report</property> + <property name="resizable">False</property> <property name="type_hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> <property name="orientation">vertical</property> - <property name="spacing">2</property> + <property name="spacing">12</property> <child internal-child="action_area"> <object class="GtkButtonBox" id="dialog-action_area1"> <property name="can_focus">False</property> <property name="layout_style">end</property> <child> <object class="GtkButton" id="btn_send"> - <property name="label" translatable="yes">Send report</property> + <property name="label" translatable="yes">_Send Crash Report</property> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="has_default">True</property> <property name="receives_default">True</property> + <property name="use_underline">True</property> </object> <packing> <property name="expand">True</property> @@ -29,10 +34,11 @@ </child> <child> <object class="GtkButton" id="btn_cancel"> - <property name="label" translatable="yes">Don't send report</property> + <property name="label" translatable="yes">_Donât Send</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> + <property name="use_underline">True</property> </object> <packing> <property name="expand">True</property> @@ -63,9 +69,9 @@ <object class="GtkLabel" id="ed_pre"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes">We are sorry but it seems that %PRODUCTNAME crashed the last time. + <property name="label" translatable="yes">Unfortunately it seems that %PRODUCTNAME crashed when it was last run. -You can help us fix this issue by sending the crash report to the %PRODUCTNAME crash reporting server.</property> +You can help us to fix this issue by sending an anonymous crash report to the %PRODUCTNAME crash reporting server.</property> <property name="wrap">True</property> </object> <packing> @@ -80,7 +86,7 @@ You can help us fix this issue by sending the crash report to the %PRODUCTNAME c <property name="valign">center</property> <property name="xalign">0</property> <property name="label" translatable="yes">The crash report was successfully uploaded. -You can soon find the report on: +You can soon find the report at: crashreport.libreoffice.org/stats/crash_details/%CRASHID</property> <property name="wrap">True</property> <property name="selectable">True</property> @@ -96,7 +102,7 @@ crashreport.libreoffice.org/stats/crash_details/%CRASHID</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Please check the report and if no bug report is connected to the crash report yet, open a new bug report at bugs.documentfoundation.org. Add detailed instructions on how to reproduce the crash and the shown crash ID into the crash report field. -Thank you for your help in improving LibreOffice.</property> +Thank you for your help in improving %PRODUCTNAME.</property> <property name="wrap">True</property> </object> <packing> commit d46b45146ef1f3fb5e72c7a409291b2ae4e6b3d3 Author: Michael Stahl <mst...@redhat.com> Date: Fri Jan 6 17:15:17 2017 +0100 breakpad: document how to read mini-dumps locally Change-Id: I888930079fc93c609769ac31a025c410b9adad96 diff --git a/external/breakpad/README b/external/breakpad/README index 41fbde6..dfd2bf9 100644 --- a/external/breakpad/README +++ b/external/breakpad/README @@ -1 +1,21 @@ -Render glTF 3D models. +Google breakpad crash-reporting library + +https://chromium.googlesource.com/breakpad/breakpad + +When this is enabled and soffice.bin crashes, a "mini-dump" file is written +as "instdir/crash/*.dmp". + +There is an UI to upload the mini-dump to a TDF server but of course +that only makes sense if the server has symbols available that match +the build, which is not the case if you have built LO yourself. + +If you want to get the backtrace from local mini-dump files: + +* with Visual Studio: + 1. open the *.dmp file from the Visual Studio IDE File->Open->File + 2. then click "Debug Native Only" + +* otherwise: + 1. run "make symbols" to extract the debuginfo from the binaries + 2. run "workdir/UnpackedTarball/breakpad/src/processor/minidump_stackwalk foo.dmp workdir/symbols" + commit c8e36d0d7beaec9bbdb85b16a0fea43fe3f60e24 Author: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> Date: Thu Jan 12 10:14:16 2017 +0100 Merge fixes Change-Id: I781c4677bf25b3d95c95c82212a611abd4517978 diff --git a/external/breakpad/ExternalProject_breakpad.mk b/external/breakpad/ExternalProject_breakpad.mk index ca7db24..10fa6ce 100644 --- a/external/breakpad/ExternalProject_breakpad.mk +++ b/external/breakpad/ExternalProject_breakpad.mk @@ -9,8 +9,6 @@ $(eval $(call gb_ExternalProject_ExternalProject,breakpad)) -$(eval $(call gb_ExternalProject_use_autoconf,breakpad,build)) - $(eval $(call gb_ExternalProject_register_targets,breakpad,\ build \ )) diff --git a/external/breakpad/Module_breakpad.mk b/external/breakpad/Module_breakpad.mk index 6cc740a..be91053 100644 --- a/external/breakpad/Module_breakpad.mk +++ b/external/breakpad/Module_breakpad.mk @@ -11,7 +11,6 @@ $(eval $(call gb_Module_Module,breakpad)) $(eval $(call gb_Module_add_targets,breakpad,\ UnpackedTarball_breakpad \ - ExternalPackage_breakpad \ )) ifneq ($(OS)$(COM),WNTMSC) commit 135f70e5b52158ee4add59bbb241b759087f4cb4 Author: Michael Stahl <mst...@redhat.com> Date: Tue Jul 19 14:25:14 2016 +0200 desktop: simplify $(ENABLE_BREAKPAD) checks Change-Id: Ibe2da6214b1f6555922313b22e2882a2ddb4b9e7 diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk index d333e41..e57b8b1 100644 --- a/desktop/Library_sofficeapp.mk +++ b/desktop/Library_sofficeapp.mk @@ -23,11 +23,10 @@ $(eval $(call gb_Library_add_libs,sofficeapp,\ ) \ )) -$(eval $(call gb_Library_use_external,sofficeapp,boost_headers)) - -ifeq ($(ENABLE_BREAKPAD),TRUE) -$(eval $(call gb_Library_use_external,sofficeapp,breakpad)) -endif +$(eval $(call gb_Library_use_externals,sofficeapp, \ + $(if $(ENABLE_BREAKPAD),breakpad) \ + boost_headers \ +)) $(eval $(call gb_Library_use_custom_headers,sofficeapp,\ officecfg/registry \ @@ -49,7 +48,7 @@ $(eval $(call gb_Library_use_libraries,sofficeapp,\ comphelper \ cppu \ cppuhelper \ - $(if $(filter TRUE,$(ENABLE_BREAKPAD)), \ + $(if $(ENABLE_BREAKPAD), \ crashreport \ ) \ deploymentmisc \ commit d00a0f1f6494899563de5ab952c8f74cef32f85b Author: Michael Stahl <mst...@redhat.com> Date: Thu Mar 31 23:58:14 2016 +0200 breakpad: fix module makefile ff9b7d118b34b53ec947af881fccd822e2aeb1fd removed the ExternalPackage instead of the ExternalProject. Change-Id: I9240526b29d0559e1485253383d39b5858e4039b diff --git a/external/breakpad/Module_breakpad.mk b/external/breakpad/Module_breakpad.mk index 3880760..6cc740a 100644 --- a/external/breakpad/Module_breakpad.mk +++ b/external/breakpad/Module_breakpad.mk @@ -10,8 +10,8 @@ $(eval $(call gb_Module_Module,breakpad)) $(eval $(call gb_Module_add_targets,breakpad,\ - ExternalProject_breakpad \ UnpackedTarball_breakpad \ + ExternalPackage_breakpad \ )) ifneq ($(OS)$(COM),WNTMSC) commit b282ee24bedabe016d3f4db4539881edde70f5ba Author: Rene Engelhard <r...@debian.org> Date: Mon Mar 28 22:39:12 2016 +0200 don't build/install minidump_upload with ENABLE_BREAKPAD= Change-Id: I0f7d9811d669c2884b0c1704878678b01529e52f diff --git a/Repository.mk b/Repository.mk index f89d510..4fbcb5a 100644 --- a/Repository.mk +++ b/Repository.mk @@ -88,7 +88,7 @@ $(eval $(call gb_Helper_register_executables_for_install,SDK,sdk, \ )) $(eval $(call gb_Helper_register_executables_for_install,OOO,brand, \ - minidump_upload \ + $(call gb_Helper_optional,BREAKPAD,minidump_upload) \ $(if $(filter-out ANDROID IOS MACOSX WNT,$(OS)),oosplash) \ soffice_bin \ $(if $(filter DESKTOP,$(BUILD_TYPE)),unopkg_bin) \ diff --git a/desktop/Module_desktop.mk b/desktop/Module_desktop.mk index 9837714..f88f376 100644 --- a/desktop/Module_desktop.mk +++ b/desktop/Module_desktop.mk @@ -36,7 +36,7 @@ ifneq (,$(filter DESKTOP,$(BUILD_TYPE))) $(eval $(call gb_Module_add_targets,desktop,\ Executable_soffice_bin \ Executable_unopkg_bin \ - Executable_minidump_upload \ + $(if $(ENABLE_BREAKPAD),Executable_minidump_upload) \ Library_migrationoo2 \ Library_migrationoo3 \ Library_unopkgapp \ commit 4348b0c27286f01507ce7bb098b88852f05b5304 Author: Michael Stahl <mst...@redhat.com> Date: Mon Feb 29 16:30:48 2016 +0100 desktop: fix infinite loop with --enable-breakpad Change-Id: I81a0405edc29fa7205d00a5cb920b2d0e800602e diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 02bd06e..3be4f9e 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1033,7 +1033,7 @@ bool crashReportInfoExists() #if HAVE_FEATURE_BREAKPAD std::string path = CrashReporter::getIniFileName(); std::ifstream aFile(path); - while (!aFile.eof()) + while (aFile.good()) { std::string line; std::getline(aFile, line); commit 61f8d1a2787896fc40cfe746d7bb3da3831fe936 Author: David Tardon <dtar...@redhat.com> Date: Mon Feb 15 07:48:58 2016 +0100 actually allow gbuild to see breakpad makefiles... Change-Id: I12ba34f30508c0a888445a2d9b68d48807b74e8c diff --git a/external/Module_external.mk b/external/Module_external.mk index 6d38fd5..482c374 100644 --- a/external/Module_external.mk +++ b/external/Module_external.mk @@ -24,6 +24,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\ $(call gb_Helper_optional,APACHE_COMMONS,apache-commons) \ $(call gb_Helper_optional,APR,apr) \ $(call gb_Helper_optional,BOOST,boost) \ + $(call gb_Helper_optional,BREAKPAD,breakpad) \ $(call gb_Helper_optional,BSH,beanshell) \ $(call gb_Helper_optional,CAIRO,cairo) \ $(call gb_Helper_optional,CDR,libcdr) \ commit 32c4b83728720db2055f89a3b3f53e1b293c1457 Author: Michael Stahl <mst...@redhat.com> Date: Mon Feb 29 21:56:49 2016 +0100 desktop: fix undefined CrashReporter::AddKeyValue on MSVC Change-Id: Ie10b4849957734c2548c73dff8485cc673769e13 diff --git a/include/desktop/crashreport.hxx b/include/desktop/crashreport.hxx index b774862..f4616e8 100644 --- a/include/desktop/crashreport.hxx +++ b/include/desktop/crashreport.hxx @@ -33,7 +33,12 @@ class ExceptionHandler; * * AdapterDeviceId * */ -class CRASHREPORT_DLLPUBLIC CrashReporter +class +#if HAVE_FEATURE_BREAKPAD +// MSVC 2013 has undefined symbols for inline functions if it's exported +CRASHREPORT_DLLPUBLIC +#endif +/*class*/ CrashReporter { public: static void AddKeyValue(const OUString& rKey, const OUString& rValue); commit 662f6755adcaf71d89e9cb061faf49156e068524 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Thu Jan 5 22:35:52 2017 +0100 add the locale info to the crashreporter metadata We have a few crashes that seem locale dependent. Especially the font related problems. Change-Id: I0cc977413dc2328ea705c96c2d4048e4f3c58bbc Reviewed-on: https://gerrit.libreoffice.org/32764 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 6ec91e7..02bd06e 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -2355,6 +2355,8 @@ void Desktop::OpenClients() } #if HAVE_FEATURE_BREAKPAD CrashReporter::writeCommonInfo(); + // write this information here to avoid depending on vcl in the crash reporter lib + CrashReporter::AddKeyValue("Language", Application::GetSettings().GetLanguageTag().getBcp47()); #endif OfficeIPCThread::EnableRequests(); commit 7b95634aaa066a99949d3ffc444268fa6faaa127 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Wed Dec 28 23:57:36 2016 +0100 add a crashreporter entry when we start the shutdown This will help us identify shutdown related crashes. Change-Id: Id09c3dfdc94c430d5dcb2aebb017f17db80f17e5 Reviewed-on: https://gerrit.libreoffice.org/32485 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk index 74e72a9..843bc08 100644 --- a/framework/Library_fwk.mk +++ b/framework/Library_fwk.mk @@ -41,6 +41,8 @@ $(eval $(call gb_Library_use_libraries,fwk,\ comphelper \ cppu \ cppuhelper \ + $(call gb_Helper_optional,BREAKPAD, \ + crashreport) \ fwe \ fwi \ i18nlangtag \ diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index 9090f83..8000f3d 100644 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -61,6 +61,7 @@ #include <comphelper/sequence.hxx> #include <cppuhelper/supportsservice.hxx> #include <vcl/svapp.hxx> +#include <desktop/crashreport.hxx> #include <tools/errinf.hxx> #include <comphelper/extract.hxx> @@ -297,13 +298,14 @@ sal_Bool SAL_CALL Desktop::terminate() impl_sendCancelTerminationEvent(lCalledTerminationListener); else { - // "Protect" us against dispose before terminate calls! - // see dispose() for further information. - /* SAFE AREA --------------------------------------------------------------------------------------- */ - SolarMutexClearableGuard aWriteLock; - m_bIsTerminated = true; - aWriteLock.clear(); - /* UNSAFE AREA ------------------------------------------------------------------------------------- */ + // "Protect" us against dispose before terminate calls! + // see dispose() for further information. + /* SAFE AREA --------------------------------------------------------------------------------------- */ + SolarMutexClearableGuard aWriteLock; + CrashReporter::AddKeyValue("ShutDown", OUString::boolean(true)); + m_bIsTerminated = true; + aWriteLock.clear(); + /* UNSAFE AREA ------------------------------------------------------------------------------------- */ impl_sendNotifyTerminationEvent(); commit 8740a64744a419f03069f60b8c4278066873d07a Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sun Dec 11 00:06:47 2016 +0100 don't overwrite the crashreport info that are written before upload There was a race condition that the OpenGL code was initialized before the old report has been uploaded. Therefore the OpenGL setting was overwritten by the new start and we were not getting the old value. Now we store any value that wants to be added before the dump.ini is ready in a temporary map and will write them as soon as we write all the common information. This problem was introduced by the dialog requesting permission to upload the crash report. Change-Id: I29391a1ff56bac6381218c5a4aefb58c2c03f024 Reviewed-on: https://gerrit.libreoffice.org/31846 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/desktop/source/app/crashreport.cxx b/desktop/source/app/crashreport.cxx index c1d57de..428339d 100644 --- a/desktop/source/app/crashreport.cxx +++ b/desktop/source/app/crashreport.cxx @@ -27,28 +27,54 @@ osl::Mutex CrashReporter::maMutex; #endif google_breakpad::ExceptionHandler* CrashReporter::mpExceptionHandler = nullptr; +bool CrashReporter::mbInit = false; +std::map<OUString, OUString> CrashReporter::maKeyValues; + +namespace { + +void writeToStream(std::ofstream& strm, const OUString& rKey, const OUString& rValue) +{ + strm << rtl::OUStringToOString(rKey, RTL_TEXTENCODING_UTF8).getStr() << "="; + strm << rtl::OUStringToOString(rValue, RTL_TEXTENCODING_UTF8).getStr() << "\n"; +} + +} void CrashReporter::AddKeyValue(const OUString& rKey, const OUString& rValue) { osl::MutexGuard aGuard(maMutex); - std::string ini_path = getIniFileName(); - std::ofstream ini_file(ini_path, std::ios_base::app); - ini_file << rtl::OUStringToOString(rKey, RTL_TEXTENCODING_UTF8).getStr() << "="; - ini_file << rtl::OUStringToOString(rValue, RTL_TEXTENCODING_UTF8).getStr() << "\n"; + if (mbInit) + { + std::string ini_path = getIniFileName(); + std::ofstream ini_file(ini_path, std::ios_base::app); + writeToStream(ini_file, rKey, rValue); + } + else + { + maKeyValues.insert(std::pair<OUString, OUString>(rKey, rValue)); + } } #endif void CrashReporter::writeCommonInfo() { + osl::MutexGuard aGuard(maMutex); // limit the amount of code that needs to be executed before the crash reporting std::string ini_path = CrashReporter::getIniFileName(); std::ofstream minidump_file(ini_path, std::ios_base::trunc); minidump_file << "ProductName=LibreOffice\n"; minidump_file << "Version=" LIBO_VERSION_DOTTED "\n"; minidump_file << "URL=http://crashreport.libreoffice.org/submit/\n"; + for (auto& keyValue : maKeyValues) + { + writeToStream(minidump_file, keyValue.first, keyValue.second); + } + maKeyValues.clear(); minidump_file.close(); + mbInit = true; + updateMinidumpLocation(); } diff --git a/include/desktop/crashreport.hxx b/include/desktop/crashreport.hxx index 47e1fba..b774862 100644 --- a/include/desktop/crashreport.hxx +++ b/include/desktop/crashreport.hxx @@ -52,6 +52,10 @@ private: static osl::Mutex maMutex; + static bool mbInit; + + static std::map<OUString, OUString> maKeyValues; // used to temporarily save entries before the old info has been uploaded + static google_breakpad::ExceptionHandler* mpExceptionHandler; }; commit 3e71b4d5eb9657f1246a862b56a8a9d792a8561a Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Wed Jun 8 12:14:30 2016 +0200 use a dynamic library for minidump shared code This has the disadvantage to make the minidump_upload executable depend on LibreOffice libraries but there seems to be no other way to make the 7.1 SDK happy. Change-Id: I82c37f503ed29cb50711eae7db22063f49747a48 Reviewed-on: https://gerrit.libreoffice.org/26055 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> (cherry picked from commit 3498cd3e7b2c820fc3f3025eb4434666a444fda1) Reviewed-on: https://gerrit.libreoffice.org/26915 Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> diff --git a/desktop/Executable_minidump_upload.mk b/desktop/Executable_minidump_upload.mk index 2c02023..959d4af8 100644 --- a/desktop/Executable_minidump_upload.mk +++ b/desktop/Executable_minidump_upload.mk @@ -10,11 +10,12 @@ $(eval $(call gb_Executable_Executable,minidump_upload)) $(eval $(call gb_Executable_use_libraries,minidump_upload,\ + crashreport \ sal \ )) -$(eval $(call gb_Executable_use_static_libraries,minidump_upload,\ - minidump \ +$(eval $(call gb_Executable_add_defs,minidump_upload,\ + -DUNICODE \ )) $(eval $(call gb_Executable_use_external,minidump_upload,curl)) diff --git a/desktop/Library_crashreport.mk b/desktop/Library_crashreport.mk index 5b14519..ba2f348 100644 --- a/desktop/Library_crashreport.mk +++ b/desktop/Library_crashreport.mk @@ -14,7 +14,10 @@ $(eval $(call gb_Library_set_include,crashreport,\ -I$(SRCDIR)/desktop/inc \ )) -$(eval $(call gb_Library_use_external,crashreport,breakpad)) +$(eval $(call gb_Library_use_externals,crashreport,\ + breakpad \ +curl \ +)) $(eval $(call gb_Library_add_defs,crashreport,\ -DCRASHREPORT_DLLIMPLEMENTATION \ @@ -38,6 +41,7 @@ $(eval $(call gb_Library_use_libraries,crashreport,\ $(eval $(call gb_Library_add_exception_objects,crashreport,\ desktop/source/app/crashreport \ + desktop/source/minidump/minidump \ )) diff --git a/desktop/Module_desktop.mk b/desktop/Module_desktop.mk index c16bfe8..9837714 100644 --- a/desktop/Module_desktop.mk +++ b/desktop/Module_desktop.mk @@ -19,7 +19,7 @@ $(eval $(call gb_Module_add_targets,desktop,\ Library_sofficeapp \ $(if $(ENABLE_BREAKPAD), \ Library_crashreport \ - StaticLibrary_minidump) \ + ) \ $(if $(ENABLE_HEADLESS),,Library_spl) \ Package_branding \ $(if $(CUSTOM_BRAND_DIR),Package_branding_custom) \ diff --git a/desktop/source/minidump/minidump.cxx b/desktop/source/minidump/minidump.cxx index 135b24a..e44fc4c 100644 --- a/desktop/source/minidump/minidump.cxx +++ b/desktop/source/minidump/minidump.cxx @@ -13,6 +13,7 @@ #include <memory> #include <fstream> #include <sstream> +#include <string> #include <curl/curl.h> @@ -178,6 +179,8 @@ bool uploadContent(std::map<std::string, std::string>& parameters, std::string& return true; } +namespace crashreport { + bool readConfig(const std::string& iniPath, std::string& response) { std::ifstream file(iniPath); @@ -199,4 +202,6 @@ bool readConfig(const std::string& iniPath, std::string& response) return uploadContent(parameters, response); } +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/desktop/source/minidump/minidump_upload.cxx b/desktop/source/minidump/minidump_upload.cxx index 934f1ad..ded2f1d 100644 --- a/desktop/source/minidump/minidump_upload.cxx +++ b/desktop/source/minidump/minidump_upload.cxx @@ -10,6 +10,7 @@ #include <desktop/minidump.hxx> #include <iostream> +#include <string> int main(int argc, char** argv) { @@ -21,7 +22,7 @@ int main(int argc, char** argv) std::string iniPath(argv[1]); std::string response; - if (!readConfig(iniPath, response)) + if (!crashreport::readConfig(iniPath, response)) return EXIT_FAILURE; std::cout << "Response: " << response << std::endl; diff --git a/include/desktop/minidump.hxx b/include/desktop/minidump.hxx index bdd91b2..63336ca 100644 --- a/include/desktop/minidump.hxx +++ b/include/desktop/minidump.hxx @@ -12,7 +12,13 @@ #include <string> -bool readConfig(const std::string& iniPath, std::string& response); +#include <desktop/dllapi.h> + +namespace crashreport { + +CRASHREPORT_DLLPUBLIC bool readConfig(const std::string& iniPath, std::string& response); + +} #endif diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk index 87e37cb..d638229 100644 --- a/svx/Library_svx.mk +++ b/svx/Library_svx.mk @@ -40,14 +40,6 @@ $(eval $(call gb_Library_add_defs,svx,\ $(eval $(call gb_Library_set_precompiled_header,svx,$(SRCDIR)/svx/inc/pch/precompiled_svx)) -ifeq ($(ENABLE_BREAKPAD),TRUE) - -$(eval $(call gb_Library_use_static_libraries,svx, \ - minidump \ -)) - -endif - $(eval $(call gb_Library_use_libraries,svx,\ basegfx \ sb \ diff --git a/svx/source/dialog/crashreportdlg.cxx b/svx/source/dialog/crashreportdlg.cxx index 0d800b8..a05a8e0 100644 --- a/svx/source/dialog/crashreportdlg.cxx +++ b/svx/source/dialog/crashreportdlg.cxx @@ -72,7 +72,7 @@ IMPL_LINK_TYPED(CrashReportDialog, BtnHdl, Button*, pBtn, void) std::string ini_path = CrashReporter::getIniFileName(); std::string response; - bool bSuccess = readConfig(ini_path, response); + bool bSuccess = crashreport::readConfig(ini_path, response); OUString aCrashID = OUString::createFromAscii(response.c_str()); commit 4e1d2a65c454f07988409c7d0a9539c2931df3af Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Mon Jun 27 04:42:22 2016 +0200 I screwed up with the breakpad minidump_stackwalk patch This does not affect normal LibreOffice and is only important for the server side. Change-Id: I270262ed6e1b22c3ef41099fda19fa386f386203 diff --git a/external/breakpad/breakpad-stackwalk.patch.1 b/external/breakpad/breakpad-stackwalk.patch.1 index 9a3ce95..8df1fa3 100644 --- a/external/breakpad/breakpad-stackwalk.patch.1 +++ b/external/breakpad/breakpad-stackwalk.patch.1 @@ -24,9 +24,9 @@ diff -ur breakpad.org/src/processor/stackwalk_common.cc breakpad/src/processor/s kOutputSeparator, base_address + module->size() - 1, kOutputSeparator, - main_module != NULL && base_address == main_address ? 1 : 0); -+ main_module != NULL && base_address == main_address ? 1 : 0), ++ main_module != NULL && base_address == main_address ? 1 : 0, + kOutputSeparator, -+ StripSeparator(PathnameStripper::File(module->code_identifier())).c_str(); ++ StripSeparator(PathnameStripper::File(module->code_identifier())).c_str()); } } commit e8616bb42344a7497b5611e450f72fa83a49839c Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Mon Jun 27 04:41:57 2016 +0200 always compile breakpad with O2 Change-Id: I4cda93fee47244cf3eb7b13bb6cb2a3eab007cf0 diff --git a/external/breakpad/ExternalProject_breakpad.mk b/external/breakpad/ExternalProject_breakpad.mk index 221a92e..ca7db24 100644 --- a/external/breakpad/ExternalProject_breakpad.mk +++ b/external/breakpad/ExternalProject_breakpad.mk @@ -22,7 +22,7 @@ else # !ifeq($(COM),MSC) $(call gb_ExternalProject_get_state_target,breakpad,build) : $(call gb_ExternalProject_run,build,\ - ./configure \ + CXX_FLAGS="-O2" ./configure \ && $(MAKE) \ ) commit c2d5b758477bfc344072010136f20f8feb5bd47b Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Mon Jun 27 02:14:58 2016 +0200 better use a backward compatible way to change the output Change-Id: If5829e321db8af1f09cccafaf34a18343492f514 diff --git a/external/breakpad/breakpad-stackwalk.patch.1 b/external/breakpad/breakpad-stackwalk.patch.1 index 26803f1..9a3ce95 100644 --- a/external/breakpad/breakpad-stackwalk.patch.1 +++ b/external/breakpad/breakpad-stackwalk.patch.1 @@ -1,16 +1,32 @@ diff -ur breakpad.org/src/processor/stackwalk_common.cc breakpad/src/processor/stackwalk_common.cc ---- breakpad.org/src/processor/stackwalk_common.cc 2016-06-25 01:38:53.282302964 +0200 -+++ breakpad/src/processor/stackwalk_common.cc 2016-06-25 01:42:58.463821357 +0200 -@@ -767,9 +767,11 @@ +--- breakpad.org/src/processor/stackwalk_common.cc 2016-06-27 02:06:43.304932691 +0200 ++++ breakpad/src/processor/stackwalk_common.cc 2016-06-27 02:10:22.815642476 +0200 +@@ -750,7 +750,7 @@ + // one per line, in the following machine-readable pipe-delimited + // text format: + // Module|{Module Filename}|{Version}|{Debug Filename}|{Debug Identifier}| +-// {Base Address}|{Max Address}|{Main} ++// {Base Address}|{Max Address}|{Main}|{Code Identifier} + static void PrintModulesMachineReadable(const CodeModules *modules) { + if (!modules) + return; +@@ -767,7 +767,7 @@ ++module_sequence) { const CodeModule *module = modules->GetModuleAtSequence(module_sequence); uint64_t base_address = module->base_address(); - printf("Module%c%s%c%s%c%s%c%s%c0x%08" PRIx64 "%c0x%08" PRIx64 "%c%d\n", -+ printf("Module%c%s%c%s%c%s%c%s%c%s%c0x%08" PRIx64 "%c0x%08" PRIx64 "%c%d\n", ++ printf("Module%c%s%c%s%c%s%c%s%c0x%08" PRIx64 "%c0x%08" PRIx64 "%c%d%c%s\n", kOutputSeparator, StripSeparator(PathnameStripper::File(module->code_file())).c_str(), -+ kOutputSeparator, -+ StripSeparator(PathnameStripper::File(module->code_identifier())).c_str(), kOutputSeparator, StripSeparator(module->version()).c_str(), +@@ -778,7 +778,9 @@ + kOutputSeparator, base_address, + kOutputSeparator, base_address + module->size() - 1, kOutputSeparator, - StripSeparator(PathnameStripper::File(module->debug_file())).c_str(), +- main_module != NULL && base_address == main_address ? 1 : 0); ++ main_module != NULL && base_address == main_address ? 1 : 0), ++ kOutputSeparator, ++ StripSeparator(PathnameStripper::File(module->code_identifier())).c_str(); + } + } + commit d0f8153e350da0e3be0be975413a21c7de3b967c Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sat Jun 25 02:10:51 2016 +0200 add some info how to use the symbol upload script Change-Id: Ic1d1b57966661b6012efcda0b007b9e75b6be0ef Reviewed-on: https://gerrit.libreoffice.org/26650 Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Tested-by: Jenkins <c...@libreoffice.org> diff --git a/bin/upload_symbols.py b/bin/upload_symbols.py index d382f70..f708797 100755 --- a/bin/upload_symbols.py +++ b/bin/upload_symbols.py @@ -16,6 +16,7 @@ def main(): if len(sys.argv) != 4: print(sys.argv) print("Invalid number of parameters") + print("Usage: upload-symbols.py symbols.zip config.ini \"long explanation\"") sys.exit(1) upload_url = "http://crashreport.libreoffice.org/upload/" commit 8a05dece93c99a48f1091444fe4448cb787f5c89 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sat Jun 25 02:03:47 2016 +0200 add code_id to the minidump_stackwalk Change-Id: Ibcc32344780b7ad5814678cf7dd9a2167ede1661 Reviewed-on: https://gerrit.libreoffice.org/26649 Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/external/breakpad/UnpackedTarball_breakpad.mk b/external/breakpad/UnpackedTarball_breakpad.mk index 59073eb..445047b 100644 --- a/external/breakpad/UnpackedTarball_breakpad.mk +++ b/external/breakpad/UnpackedTarball_breakpad.mk @@ -15,6 +15,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,breakpad,\ external/breakpad/breakpad-use-correct-http-header.patch.1 \ external/breakpad/breakpad-wshadow.patch.1 \ external/breakpad/breakpad-wshadow2.patch.1 \ + external/breakpad/breakpad-stackwalk.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/breakpad/breakpad-stackwalk.patch.1 b/external/breakpad/breakpad-stackwalk.patch.1 new file mode 100644 index 0000000..26803f1 --- /dev/null +++ b/external/breakpad/breakpad-stackwalk.patch.1 @@ -0,0 +1,16 @@ +diff -ur breakpad.org/src/processor/stackwalk_common.cc breakpad/src/processor/stackwalk_common.cc +--- breakpad.org/src/processor/stackwalk_common.cc 2016-06-25 01:38:53.282302964 +0200 ++++ breakpad/src/processor/stackwalk_common.cc 2016-06-25 01:42:58.463821357 +0200 +@@ -767,9 +767,11 @@ + ++module_sequence) { + const CodeModule *module = modules->GetModuleAtSequence(module_sequence); + uint64_t base_address = module->base_address(); +- printf("Module%c%s%c%s%c%s%c%s%c0x%08" PRIx64 "%c0x%08" PRIx64 "%c%d\n", ++ printf("Module%c%s%c%s%c%s%c%s%c%s%c0x%08" PRIx64 "%c0x%08" PRIx64 "%c%d\n", + kOutputSeparator, + StripSeparator(PathnameStripper::File(module->code_file())).c_str(), ++ kOutputSeparator, ++ StripSeparator(PathnameStripper::File(module->code_identifier())).c_str(), + kOutputSeparator, StripSeparator(module->version()).c_str(), + kOutputSeparator, + StripSeparator(PathnameStripper::File(module->debug_file())).c_str(), commit e7b2ee20f4f1511c44057a64897781382bb50db7 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Fri Jun 17 21:44:49 2016 +0200 add some OpenGL info to the crash reporter Change-Id: Id377bc3bd814fad822d577603b1f147b71ad9ae2 Reviewed-on: https://gerrit.libreoffice.org/26445 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/vcl/opengl/win/WinDeviceInfo.cxx b/vcl/opengl/win/WinDeviceInfo.cxx index f68a72f..21432bd 100644 --- a/vcl/opengl/win/WinDeviceInfo.cxx +++ b/vcl/opengl/win/WinDeviceInfo.cxx @@ -709,8 +709,10 @@ bool WinOpenGLDeviceInfo::FindBlocklistedDeviceInList() bool WinOpenGLDeviceInfo::isDeviceBlocked() { - // CrashReporter::AddKeyAndValue("AdapterVendorId", maAdapterVendorID); - // CrashReporter::AddKeyAndValue("AdapterDeviceId", maAdapterDeviceID); + CrashReporter::AddKeyValue("OpenGLVendor", maAdapterVendorID); + CrashReporter::AddKeyValue("OpenGLDevice", maAdapterDeviceID); + CrashReporter::AddKeyValue("OpenGLDriver", maDriverVersion); + SAL_INFO("vcl.opengl", maDriverVersion); SAL_INFO("vcl.opengl", maDriverDate); SAL_INFO("vcl.opengl", maDeviceID); commit 192444319a677fa9170bc590dc2261105a380780 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Fri Jun 17 21:26:34 2016 +0200 move the code for tdf#99410 to the sal init windows code Change-Id: I4ead30fa1736a3a99fb3379e89367934c8df2809 Reviewed-on: https://gerrit.libreoffice.org/26444 Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Tested-by: Jenkins <c...@libreoffice.org> diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx index d5d5b84..d1c5885 100644 --- a/desktop/source/app/sofficemain.cxx +++ b/desktop/source/app/sofficemain.cxx @@ -100,12 +100,6 @@ static bool dumpCallback(const wchar_t* path, const wchar_t* id, #endif extern "C" int DESKTOP_DLLPUBLIC soffice_main() { -#if defined(_WIN64) && _MSC_VER <= 1800 - // tdf#99410: MSVC 2013 runtime library has problems with some math functions if - // the CPU supports them and they are disabled in the OS - _set_FMA3_enable(0); -#endif - #if HAVE_FEATURE_BREAKPAD #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID diff --git a/sal/osl/w32/salinit.cxx b/sal/osl/w32/salinit.cxx index 04fab27..a03f8ae 100644 --- a/sal/osl/w32/salinit.cxx +++ b/sal/osl/w32/salinit.cxx @@ -55,6 +55,12 @@ extern "C" void invalidParameterHandler( void sal_detail_initialize(int argc, char ** argv) { +#if defined(_WIN64) && _MSC_VER <= 1800 + // tdf#99410: MSVC 2013 runtime library has problems with some math functions if + // the CPU supports them and they are disabled in the OS + _set_FMA3_enable(0); +#endif + sal_initGlobalTimer(); // SetProcessDEPPolicy(PROCESS_DEP_ENABLE); // SetDllDirectoryW(L""); commit ced2f7735f116907684a99f1af37c5fc22dfd97e Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Fri Jun 17 18:49:26 2016 +0200 better message for crash report dialog Change-Id: I02903cda46809798ec7664cf620c06ea7687e54e Reviewed-on: https://gerrit.libreoffice.org/26443 Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Tested-by: Jenkins <c...@libreoffice.org> diff --git a/svx/source/dialog/crashreportdlg.cxx b/svx/source/dialog/crashreportdlg.cxx index 00dcedd..0d800b8 100644 --- a/svx/source/dialog/crashreportdlg.cxx +++ b/svx/source/dialog/crashreportdlg.cxx @@ -26,10 +26,14 @@ CrashReportDialog::CrashReportDialog(vcl::Window* pParent): get(mpBtnClose, "btn_close"); get(mpEditPreUpload, "ed_pre"); get(mpEditPostUpload, "ed_post"); + get(mpFtBugReport, "ed_bugreport"); + + maSuccessMsg = mpEditPostUpload->GetText(); mpBtnSend->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl)); mpBtnCancel->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl)); mpBtnClose->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl)); + mpEditPostUpload->SetReadOnly(true); } CrashReportDialog::~CrashReportDialog() @@ -44,6 +48,7 @@ void CrashReportDialog::dispose() mpBtnClose.clear(); mpEditPreUpload.clear(); mpEditPostUpload.clear(); + mpFtBugReport.clear(); Dialog::dispose(); } @@ -72,15 +77,26 @@ IMPL_LINK_TYPED(CrashReportDialog, BtnHdl, Button*, pBtn, void) OUString aCrashID = OUString::createFromAscii(response.c_str()); if (bSuccess) - mpEditPostUpload->SetText(mpEditPostUpload->GetText() + " " + aCrashID); + { + OUString aProcessedMessage = maSuccessMsg.replaceAll("%CRASHID", aCrashID.replaceAll("Crash-ID=","")); + + // vclbuilder seems to replace _ with ~ even in text + mpEditPostUpload->SetText(aProcessedMessage.replaceAll("~", "_")); + } else - mpEditPostUpload->SetText(mpEditPostUpload->GetText() + " Error!"); + mpEditPostUpload->SetText("Error!"); mpBtnClose->Show(); + mpFtBugReport->Show(); mpEditPreUpload->Hide(); mpEditPostUpload->Show(); mpBtnSend->Hide(); + mpBtnSend->Disable(); mpBtnCancel->Hide(); + mpBtnCancel->Disable(); + mpBtnClose->GrabFocus(); + + this->setOptimalLayoutSize(); } else if (pBtn == mpBtnCancel.get()) { diff --git a/svx/source/dialog/crashreportdlg.hxx b/svx/source/dialog/crashreportdlg.hxx index 3ea5ab2..89f567a 100644 --- a/svx/source/dialog/crashreportdlg.hxx +++ b/svx/source/dialog/crashreportdlg.hxx @@ -14,6 +14,7 @@ #include <vcl/button.hxx> #include <vcl/fixed.hxx> #include <vcl/edit.hxx> +#include <vcl/vclmedit.hxx> class CrashReportDialog : public Dialog { @@ -31,7 +32,10 @@ private: VclPtr<Button> mpBtnCancel; VclPtr<Button> mpBtnClose; VclPtr<FixedText> mpEditPreUpload; - VclPtr<FixedText> mpEditPostUpload; + VclPtr<VclMultiLineEdit> mpEditPostUpload; + VclPtr<VclMultiLineEdit> mpFtBugReport; + + OUString maSuccessMsg; DECL_LINK_TYPED(BtnHdl, Button*, void); }; diff --git a/svx/uiconfig/ui/crashreportdlg.ui b/svx/uiconfig/ui/crashreportdlg.ui index 0bed5a6..c148ee8 100644 --- a/svx/uiconfig/ui/crashreportdlg.ui +++ b/svx/uiconfig/ui/crashreportdlg.ui @@ -56,16 +56,17 @@ <packing> <property name="expand">False</property> <property name="fill">False</property> - <property name="position">3</property> + <property name="position">4</property> </packing> </child> <child> <object class="GtkLabel" id="ed_pre"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes">We are sorry but it seems that LibreOffice crashed the last time. -You can help us fix this issue by sending the crash report to the -LibreOffice crash reporting server.</property> + <property name="label" translatable="yes">We are sorry but it seems that %PRODUCTNAME crashed the last time. + +You can help us fix this issue by sending the crash report to the %PRODUCTNAME crash reporting server.</property> + <property name="wrap">True</property> </object> <packing> <property name="expand">False</property> @@ -74,14 +75,15 @@ LibreOffice crash reporting server.</property> </packing> </child> <child> - <object class="GtkLabel" id="ed_post"> + <object class="GtkTextView" id="ed_post"> <property name="can_focus">False</property> <property name="valign">center</property> <property name="xalign">0</property> <property name="label" translatable="yes">The crash report was successfully uploaded. -You can soon find the report on crashreport.libreoffice.org. -The report can be found by</property> +You can soon find the report on: +crashreport.libreoffice.org/stats/crash_details/%CRASHID</property> <property name="wrap">True</property> + <property name="selectable">True</property> </object> <packing> <property name="expand">False</property> @@ -89,6 +91,20 @@ The report can be found by</property> <property name="position">1</property> </packing> </child> + <child> + <object class="GtkTextView" id="ed_bugreport"> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Please check the report and if no bug report is connected to the crash report yet, open a new bug report at bugs.documentfoundation.org. +Add detailed instructions on how to reproduce the crash and the shown crash ID into the crash report field. +Thank you for your help in improving LibreOffice.</property> + <property name="wrap">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> </object> </child> </object> commit 4239fe65f324e72a6565c699d84248a7a8bd055b Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Wed Jun 15 22:32:44 2016 +0200 work around MSVCR2013 bug around AVX, tdf#99410 http://crashreport.libreoffice.org/stats/crash_details/d7bc6c8a-e8c2-4c1f-8291-ccab84ea892c Change-Id: I76f9614bc54988c001c9b252707e4b5d4c588112 Reviewed-on: https://gerrit.libreoffice.org/26339 Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Tested-by: Jenkins <c...@libreoffice.org> diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx index d1c5885..d5d5b84 100644 --- a/desktop/source/app/sofficemain.cxx +++ b/desktop/source/app/sofficemain.cxx @@ -100,6 +100,12 @@ static bool dumpCallback(const wchar_t* path, const wchar_t* id, #endif extern "C" int DESKTOP_DLLPUBLIC soffice_main() { +#if defined(_WIN64) && _MSC_VER <= 1800 + // tdf#99410: MSVC 2013 runtime library has problems with some math functions if + // the CPU supports them and they are disabled in the OS + _set_FMA3_enable(0); +#endif + #if HAVE_FEATURE_BREAKPAD #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID commit 63b91b02cedb48cdcc4030ec3084c890f2bbd39b Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Wed Jun 15 20:15:20 2016 +0200 passing a NULL pointer to fileno is not allowed See crash reports at http://crashreport.libreoffice.org/stats/signature/do_msvcr_magic+0x7 and documentation at https://msdn.microsoft.com/en-us/library/zs6wbdhx.aspx Change-Id: Ia9166d3b9fa10b87585821504e39cdfecbd22eda Reviewed-on: https://gerrit.libreoffice.org/26317 Reviewed-by: Michael Stahl <mst...@redhat.com> Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx index 0007975..1a56cd7 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx @@ -558,6 +558,9 @@ static void do_msvcr_magic(rtl_uString *jvm_dll) FILE *f = _wfopen(reinterpret_cast<LPCWSTR>(Module->buffer), L"rb"); + if (!f) + return; + if (fstat(fileno(f), &st) == -1) { fclose(f); commit 21ceb627f752ef59aafe8e7bfa11d0084e14b822 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Mon Jun 13 01:20:08 2016 +0200 we are using our own minidump_upload executable Change-Id: Icee770ff8e2db019031d618528a9aab83041389d Reviewed-on: https://gerrit.libreoffice.org/26244 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 08e53c7..0c537b9 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -3461,10 +3461,6 @@ endif $(call gb_LinkTarget_use_external_project,$(1),breakpad) -$(eval $(call gb_Helper_register_packages_for_install,ooo,\ - breakpad \ -)) - endef endif # ENABLE_BREAKPAD diff --git a/external/breakpad/ExternalPackage_breakpad.mk b/external/breakpad/ExternalPackage_breakpad.mk deleted file mode 100644 index 6c0d0bf..0000000 --- a/external/breakpad/ExternalPackage_breakpad.mk +++ /dev/null @@ -1,20 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_ExternalPackage_ExternalPackage,breakpad,breakpad)) - -$(eval $(call gb_ExternalPackage_use_external_project,breakpad,breakpad)) - -ifeq ($(OS),LINUX) -$(eval $(call gb_ExternalPackage_add_file,breakpad,$(LIBO_LIB_FOLDER)/minidump_upload,src/tools/linux/symupload/minidump_upload)) -else ifeq ($(OS)),WNT) -$(eval $(call gb_ExternalPackage_add_file,breakpad,$(LIBO_LIB_FOLDER)/minidump_upload,src/tools/linux/symupload/minidump_upload)) -endif - -# vim: set noet sw=4 ts=4: commit 8bb4b1727d38b0489ba44a76b5b3d7e5ca6d5007 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sun Jun 5 22:34:26 2016 +0200 enable breakpad in distro configs Change-Id: Ib321a62223c77e3f62d48f358a228465280458ad Reviewed-on: https://gerrit.libreoffice.org/26022 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/distro-configs/LibreOfficeLinux.conf b/distro-configs/LibreOfficeLinux.conf index 0866baa..1d154e4 100644 --- a/distro-configs/LibreOfficeLinux.conf +++ b/distro-configs/LibreOfficeLinux.conf @@ -36,5 +36,5 @@ --disable-gio --disable-randr-link --disable-kde4 ---enable-mergelibs --enable-breakpad +--enable-mergelibs diff --git a/distro-configs/LibreOfficeWin32.conf b/distro-configs/LibreOfficeWin32.conf index c231ccd..a2cbff9 100644 --- a/distro-configs/LibreOfficeWin32.conf +++ b/distro-configs/LibreOfficeWin32.conf @@ -8,6 +8,7 @@ --enable-ext-nlpsolver --enable-online-update --enable-win-mozab-driver +--enable-breakpad --with-help --with-myspell-dicts --with-package-format=msi diff --git a/distro-configs/LibreOfficeWin64.conf b/distro-configs/LibreOfficeWin64.conf index cc8211f..99d6beb 100644 --- a/distro-configs/LibreOfficeWin64.conf +++ b/distro-configs/LibreOfficeWin64.conf @@ -9,6 +9,7 @@ --enable-ext-nlpsolver --enable-online-update --disable-firebird-sdbc +--enable-breakpad --with-help --with-myspell-dicts --with-package-format=msi commit 7d23c2a679a78ead3c5b1814704c7508f3a5f609 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sun Jun 5 22:26:25 2016 +0200 remove old debug output Change-Id: Icf0e38c6725a129d3afb22b1cc79f72071c8e919 Reviewed-on: https://gerrit.libreoffice.org/25934 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/desktop/source/minidump/minidump.cxx b/desktop/source/minidump/minidump.cxx index 0075ca9..135b24a 100644 --- a/desktop/source/minidump/minidump.cxx +++ b/desktop/source/minidump/minidump.cxx @@ -11,7 +11,6 @@ #include <map> #include <memory> -#include <iostream> #include <fstream> #include <sstream> @@ -162,8 +161,6 @@ bool uploadContent(std::map<std::string, std::string>& parameters, std::string& curl_easy_strerror(cc)); #endif - const char* error_description = curl_easy_strerror(cc); - if (formpost != nullptr) { curl_formfree(formpost); @@ -173,8 +170,6 @@ bool uploadContent(std::map<std::string, std::string>& parameters, std::string& curl_slist_free_all(headerlist); } - std::cerr << response_body << " " << error_description << std::endl; - response = response_body; if( CURLE_OK != cc ) @@ -191,13 +186,13 @@ bool readConfig(const std::string& iniPath, std::string& response) // make sure that at least the mandatory parameters are in there if (parameters.find("DumpFile") == parameters.end()) { - std::cerr << "ini file needs to contain a key DumpFile!"; + response = "ini file needs to contain a key DumpFile!"; return false; } if (parameters.find("Version") == parameters.end()) { - std::cerr << "ini file needs to contain a key Version!"; + response = "ini file needs to contain a key Version!"; return false; } commit 0ba68f6e98e65b720d354c352f7f1d0437ad1932 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Fri Jun 3 13:26:46 2016 +0200 report the crash id back to the user Change-Id: I5cc1e698294a5674d691529af8cc14e4cd87a711 Reviewed-on: https://gerrit.libreoffice.org/25865 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/desktop/source/minidump/minidump.cxx b/desktop/source/minidump/minidump.cxx index c0d68c2..0075ca9 100644 --- a/desktop/source/minidump/minidump.cxx +++ b/desktop/source/minidump/minidump.cxx @@ -82,7 +82,7 @@ std::string generate_json(const std::map<std::string, std::string>& parameters) return stream.str(); } -bool uploadContent(std::map<std::string, std::string>& parameters) +bool uploadContent(std::map<std::string, std::string>& parameters, std::string& response) { CURL* curl = curl_easy_init(); if (!curl) @@ -175,6 +175,7 @@ bool uploadContent(std::map<std::string, std::string>& parameters) std::cerr << response_body << " " << error_description << std::endl; + response = response_body; if( CURLE_OK != cc ) return false; @@ -182,7 +183,7 @@ bool uploadContent(std::map<std::string, std::string>& parameters) return true; } -bool readConfig(const std::string& iniPath) +bool readConfig(const std::string& iniPath, std::string& response) { std::ifstream file(iniPath); std::map<std::string, std::string> parameters = readStrings(file); @@ -200,7 +201,7 @@ bool readConfig(const std::string& iniPath) return false; } - return uploadContent(parameters); + return uploadContent(parameters, response); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/desktop/source/minidump/minidump_upload.cxx b/desktop/source/minidump/minidump_upload.cxx index 6a581db..934f1ad 100644 --- a/desktop/source/minidump/minidump_upload.cxx +++ b/desktop/source/minidump/minidump_upload.cxx @@ -20,9 +20,11 @@ int main(int argc, char** argv) } std::string iniPath(argv[1]); - if (!readConfig(iniPath)) + std::string response; + if (!readConfig(iniPath, response)) return EXIT_FAILURE; + std::cout << "Response: " << response << std::endl; return EXIT_SUCCESS; } diff --git a/include/desktop/minidump.hxx b/include/desktop/minidump.hxx index 21d52e8..bdd91b2 100644 --- a/include/desktop/minidump.hxx +++ b/include/desktop/minidump.hxx @@ -12,7 +12,7 @@ #include <string> -bool readConfig(const std::string& iniPath); +bool readConfig(const std::string& iniPath, std::string& response); #endif diff --git a/svx/source/dialog/crashreportdlg.cxx b/svx/source/dialog/crashreportdlg.cxx index 90c5c10..00dcedd 100644 --- a/svx/source/dialog/crashreportdlg.cxx +++ b/svx/source/dialog/crashreportdlg.cxx @@ -23,9 +23,13 @@ CrashReportDialog::CrashReportDialog(vcl::Window* pParent): { get(mpBtnSend, "btn_send"); get(mpBtnCancel, "btn_cancel"); + get(mpBtnClose, "btn_close"); + get(mpEditPreUpload, "ed_pre"); + get(mpEditPostUpload, "ed_post"); mpBtnSend->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl)); mpBtnCancel->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl)); + mpBtnClose->SetClickHdl(LINK(this, CrashReportDialog, BtnHdl)); } CrashReportDialog::~CrashReportDialog() @@ -37,6 +41,9 @@ void CrashReportDialog::dispose() { mpBtnSend.clear(); mpBtnCancel.clear(); + mpBtnClose.clear(); + mpEditPreUpload.clear(); + mpEditPostUpload.clear(); Dialog::dispose(); } @@ -58,17 +65,30 @@ IMPL_LINK_TYPED(CrashReportDialog, BtnHdl, Button*, pBtn, void) if (pBtn == mpBtnSend.get()) { std::string ini_path = CrashReporter::getIniFileName(); - readConfig(ini_path); - // TODO: moggi: return the id for the user to look it up - Close(); + + std::string response; + bool bSuccess = readConfig(ini_path, response); + + OUString aCrashID = OUString::createFromAscii(response.c_str()); + + if (bSuccess) + mpEditPostUpload->SetText(mpEditPostUpload->GetText() + " " + aCrashID); + else + mpEditPostUpload->SetText(mpEditPostUpload->GetText() + " Error!"); + + mpBtnClose->Show(); + mpEditPreUpload->Hide(); + mpEditPostUpload->Show(); + mpBtnSend->Hide(); + mpBtnCancel->Hide(); } else if (pBtn == mpBtnCancel.get()) { Close(); } - else + else if (pBtn == mpBtnClose.get()) { - assert(false); + Close(); } } diff --git a/svx/source/dialog/crashreportdlg.hxx b/svx/source/dialog/crashreportdlg.hxx index e6041f8..3ea5ab2 100644 --- a/svx/source/dialog/crashreportdlg.hxx +++ b/svx/source/dialog/crashreportdlg.hxx @@ -12,6 +12,8 @@ #include <vcl/dialog.hxx> #include <vcl/button.hxx> +#include <vcl/fixed.hxx> +#include <vcl/edit.hxx> class CrashReportDialog : public Dialog { @@ -27,6 +29,9 @@ private: VclPtr<Button> mpBtnSend; VclPtr<Button> mpBtnCancel; + VclPtr<Button> mpBtnClose; + VclPtr<FixedText> mpEditPreUpload; + VclPtr<FixedText> mpEditPostUpload; DECL_LINK_TYPED(BtnHdl, Button*, void); }; diff --git a/svx/uiconfig/ui/crashreportdlg.ui b/svx/uiconfig/ui/crashreportdlg.ui index e8d1355..0bed5a6 100644 --- a/svx/uiconfig/ui/crashreportdlg.ui +++ b/svx/uiconfig/ui/crashreportdlg.ui @@ -40,15 +40,27 @@ <property name="position">1</property> </packing> </child> + <child> + <object class="GtkButton" id="btn_close"> + <property name="label" translatable="yes">Close</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> </object> <packing> <property name="expand">False</property> <property name="fill">False</property> - <property name="position">0</property> + <property name="position">3</property> </packing> </child> <child> - <object class="GtkLabel" id="label1"> + <object class="GtkLabel" id="ed_pre"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">We are sorry but it seems that LibreOffice crashed the last time. @@ -58,10 +70,27 @@ LibreOffice crash reporting server.</property> <packing> <property name="expand">False</property> <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="ed_post"> + <property name="can_focus">False</property> + <property name="valign">center</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">The crash report was successfully uploaded. +You can soon find the report on crashreport.libreoffice.org. +The report can be found by</property> + <property name="wrap">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> <property name="position">1</property> </packing> </child> </object> </child> </object> + <object class="GtkActionGroup" id="actiongroup1"/> </interface> commit fc327608335984d30501b17bc129a3c234825b06 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Fri Jun 3 12:38:14 2016 +0200 don't just silently ignore the return value Change-Id: Ia65c29b61e78de4b908b11cd803d93da4b7e3a2d Reviewed-on: https://gerrit.libreoffice.org/25864 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/desktop/source/minidump/minidump.cxx b/desktop/source/minidump/minidump.cxx index 64303d4..c0d68c2 100644 --- a/desktop/source/minidump/minidump.cxx +++ b/desktop/source/minidump/minidump.cxx @@ -200,9 +200,7 @@ bool readConfig(const std::string& iniPath) return false; } - uploadContent(parameters); - - return true; + return uploadContent(parameters); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit ddd5c0537f84abc965cb24a494e8e6792b227074 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Fri Jun 3 12:37:18 2016 +0200 integrate the minidump upload into the normal LibreOffice Change-Id: Id1808ceebf6c54698f7d1656a0ce96bcaece89ac Reviewed-on: https://gerrit.libreoffice.org/25863 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/desktop/source/minidump/minidump.cxx b/desktop/source/minidump/minidump.cxx index 371d17c..64303d4 100644 --- a/desktop/source/minidump/minidump.cxx +++ b/desktop/source/minidump/minidump.cxx @@ -7,7 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "minidump.hxx" +#include <desktop/minidump.hxx> #include <map> #include <memory> diff --git a/desktop/source/minidump/minidump_upload.cxx b/desktop/source/minidump/minidump_upload.cxx index 7f8d617..6a581db 100644 --- a/desktop/source/minidump/minidump_upload.cxx +++ b/desktop/source/minidump/minidump_upload.cxx @@ -7,9 +7,9 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "minidump.hxx" +#include <desktop/minidump.hxx> -#include<iostream> +#include <iostream> int main(int argc, char** argv) { diff --git a/desktop/source/minidump/minidump.hxx b/include/desktop/minidump.hxx similarity index 100% rename from desktop/source/minidump/minidump.hxx rename to include/desktop/minidump.hxx diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk index 2588352..87e37cb 100644 --- a/svx/Library_svx.mk +++ b/svx/Library_svx.mk @@ -40,6 +40,14 @@ $(eval $(call gb_Library_add_defs,svx,\ $(eval $(call gb_Library_set_precompiled_header,svx,$(SRCDIR)/svx/inc/pch/precompiled_svx)) +ifeq ($(ENABLE_BREAKPAD),TRUE) + +$(eval $(call gb_Library_use_static_libraries,svx, \ + minidump \ +)) + +endif + $(eval $(call gb_Library_use_libraries,svx,\ basegfx \ sb \ @@ -75,6 +83,8 @@ $(eval $(call gb_Library_use_libraries,svx,\ $(eval $(call gb_Library_use_externals,svx,\ boost_headers \ + $(call gb_Helper_optional,BREAKPAD, \ + curl) \ icuuc \ icu_headers \ )) diff --git a/svx/source/dialog/crashreportdlg.cxx b/svx/source/dialog/crashreportdlg.cxx index aeb5c14..90c5c10 100644 --- a/svx/source/dialog/crashreportdlg.cxx +++ b/svx/source/dialog/crashreportdlg.cxx @@ -9,10 +9,12 @@ #include "crashreportdlg.hxx" + #include <config_folders.h> #include <rtl/bootstrap.hxx> #include <desktop/crashreport.hxx> +#include <desktop/minidump.hxx> #include <osl/file.hxx> CrashReportDialog::CrashReportDialog(vcl::Window* pParent): @@ -56,13 +58,7 @@ IMPL_LINK_TYPED(CrashReportDialog, BtnHdl, Button*, pBtn, void) if (pBtn == mpBtnSend.get()) { std::string ini_path = CrashReporter::getIniFileName(); - OUString aCommand; - osl::FileBase::getSystemPathFromFileURL(getLibDir() + "/minidump_upload" + SAL_EXEEXTENSION, aCommand); - - aCommand = aCommand; - OString aOStringCommand = rtl::OUStringToOString(aCommand, RTL_TEXTENCODING_UTF8) + " " + ini_path.c_str(); - int retVal = std::system(aOStringCommand.getStr()); - SAL_WARN_IF(retVal != 0, "svx.dialog", "Failed to upload minidump. Error Code: " << retVal); + readConfig(ini_path); // TODO: moggi: return the id for the user to look it up Close(); } commit 5f22f6afad7ddc745869e3726d894437020df57c Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Thu Jun 2 19:15:47 2016 +0200 extract the minidump uploader code into a static lib The plan for the near future is to still ship the executable but replace the interal use if possible with using the static library. At some point when it is not needed for debugging anymore and everything works correctly we should only build the uploader executable in dev configurations. The huge disadvantage of the interal solution is that it is nearly impossible for a user to upload a crash report if LibO starts working correctly. Also LibO overwrites the file with the information after the upload whereas the executable does not. Change-Id: Ib9854946be3a34e580964c18e1a9c0cce16221d1 Reviewed-on: https://gerrit.libreoffice.org/25862 Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/desktop/Executable_minidump_upload.mk b/desktop/Executable_minidump_upload.mk index 7fe9546..2c02023 100644 --- a/desktop/Executable_minidump_upload.mk +++ b/desktop/Executable_minidump_upload.mk @@ -13,6 +13,10 @@ $(eval $(call gb_Executable_use_libraries,minidump_upload,\ sal \ )) +$(eval $(call gb_Executable_use_static_libraries,minidump_upload,\ + minidump \ +)) + $(eval $(call gb_Executable_use_external,minidump_upload,curl)) $(eval $(call gb_Executable_add_exception_objects,minidump_upload,\ diff --git a/desktop/Module_desktop.mk b/desktop/Module_desktop.mk index bfe61a1..c16bfe8 100644 --- a/desktop/Module_desktop.mk +++ b/desktop/Module_desktop.mk @@ -17,7 +17,9 @@ $(eval $(call gb_Module_add_targets,desktop,\ Library_deploymentmisc \ Library_offacc \ Library_sofficeapp \ - $(if $(ENABLE_BREAKPAD),Library_crashreport) \ + $(if $(ENABLE_BREAKPAD), \ + Library_crashreport \ + StaticLibrary_minidump) \ $(if $(ENABLE_HEADLESS),,Library_spl) \ Package_branding \ $(if $(CUSTOM_BRAND_DIR),Package_branding_custom) \ diff --git a/desktop/StaticLibrary_minidump.mk b/desktop/StaticLibrary_minidump.mk new file mode 100644 index 0000000..70cab1a --- /dev/null +++ b/desktop/StaticLibrary_minidump.mk @@ -0,0 +1,19 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_StaticLibrary_StaticLibrary,minidump)) + +$(eval $(call gb_StaticLibrary_use_external,minidump,curl)) + +$(eval $(call gb_StaticLibrary_add_exception_objects,minidump,\ + desktop/source/minidump/minidump \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/desktop/source/minidump/minidump.cxx b/desktop/source/minidump/minidump.cxx new file mode 100644 index 0000000..371d17c --- /dev/null +++ b/desktop/source/minidump/minidump.cxx @@ -0,0 +1,208 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "minidump.hxx" + +#include <map> +#include <memory> +#include <iostream> +#include <fstream> +#include <sstream> + +#include <curl/curl.h> + +static const char kUserAgent[] = "Breakpad/1.0 (Linux)"; + +std::map<std::string, std::string> readStrings(std::istream& file) +{ + std::map<std::string, std::string> parameters; + + while (!file.eof()) + { + std::string line; + std::getline(file, line); + int sep = line.find('='); + if (sep >= 0) + { + std::string key = line.substr(0, sep); + std::string value = line.substr(sep + 1); + parameters[key] = value; + } + } + + return parameters; +} + +// Callback to get the response data from server. +static size_t WriteCallback(void *ptr, size_t size, + size_t nmemb, void *userp) +{ + if (!userp) + return 0; + + std::string* response = static_cast<std::string *>(userp); + size_t real_size = size * nmemb; + response->append(static_cast<char *>(ptr), real_size); + return real_size; +} + +void getProperty(const std::string& key, std::string& value, + std::map<std::string, std::string>& parameters) +{ + auto itr = parameters.find(key); + if (itr != parameters.end()) + { + value = itr->second; + parameters.erase(itr); + } +} + +std::string generate_json(const std::map<std::string, std::string>& parameters) +{ + std::ostringstream stream; + stream << "{\n"; + bool first = true; + for (auto itr = parameters.begin(), itrEnd = parameters.end(); itr != itrEnd; ++itr) + { + if (!first) + { + stream << ",\n"; + } + first = false; + stream << "\"" << itr->first << "\": \"" << itr->second << "\""; + } + stream << "\n}"; + + return stream.str(); +} + +bool uploadContent(std::map<std::string, std::string>& parameters) +{ + CURL* curl = curl_easy_init(); + if (!curl) + return false; + + std::string proxy, proxy_user_pwd, ca_certificate_file, file, url, version; + + getProperty("Proxy", proxy, parameters); + getProperty("ProxyUserPW", proxy_user_pwd, parameters); + getProperty("CAFile", ca_certificate_file, parameters); + + getProperty("DumpFile", file, parameters); + getProperty("URL", url, parameters); + getProperty("Version", version, parameters); + if (url.empty()) + return false; + + if (file.empty()) + return false; + + if (version.empty()) + return false; + + curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); + curl_easy_setopt(curl, CURLOPT_USERAGENT, kUserAgent); + // Set proxy information if necessary. + if (!proxy.empty()) + curl_easy_setopt(curl, CURLOPT_PROXY, proxy.c_str()); + if (!proxy_user_pwd.empty()) + curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, proxy_user_pwd.c_str()); + + if (!ca_certificate_file.empty()) + curl_easy_setopt(curl, CURLOPT_CAINFO, ca_certificate_file.c_str()); + + curl_httppost* formpost = nullptr; + curl_httppost* lastptr = nullptr; + std::string additional_data = generate_json(parameters); + curl_formadd(&formpost, &lastptr, + CURLFORM_COPYNAME, "AdditionalData", + CURLFORM_COPYCONTENTS, additional_data.c_str(), + CURLFORM_END); + + curl_formadd(&formpost, &lastptr, + CURLFORM_COPYNAME, "Version", + CURLFORM_COPYCONTENTS, version.c_str(), + CURLFORM_END); + + std::string response_body; + long response_code; + curl_formadd(&formpost, &lastptr, + CURLFORM_COPYNAME, "upload_file_minidump", + CURLFORM_FILE, file.c_str(), + CURLFORM_END); + + curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost); + + + // Disable 100-continue header. + char buf[] = "Expect:"; + curl_slist* headerlist = nullptr; + headerlist = curl_slist_append(headerlist, buf); + curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist); + + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, + static_cast<void *>(&response_body)); + + // Fail if 400+ is returned from the web server. + curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1); + + CURLcode cc = curl_easy_perform(curl); + curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code); +#ifndef NDEBUG + if (cc != CURLE_OK) + fprintf(stderr, "Failed to send http request to %s, error: %s\n", + url.c_str(), + curl_easy_strerror(cc)); +#endif + + const char* error_description = curl_easy_strerror(cc); + + if (formpost != nullptr) + { + curl_formfree(formpost); + } + if (headerlist != nullptr) + { + curl_slist_free_all(headerlist); + } + + std::cerr << response_body << " " << error_description << std::endl; + + + if( CURLE_OK != cc ) + return false; + + return true; +} + +bool readConfig(const std::string& iniPath) +{ + std::ifstream file(iniPath); + std::map<std::string, std::string> parameters = readStrings(file); + + // make sure that at least the mandatory parameters are in there + if (parameters.find("DumpFile") == parameters.end()) + { + std::cerr << "ini file needs to contain a key DumpFile!"; + return false; + } + + if (parameters.find("Version") == parameters.end()) + { + std::cerr << "ini file needs to contain a key Version!"; + return false; + } + + uploadContent(parameters); + + return true; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/desktop/source/minidump/minidump.hxx b/desktop/source/minidump/minidump.hxx new file mode 100644 index 0000000..21d52e8 --- /dev/null +++ b/desktop/source/minidump/minidump.hxx @@ -0,0 +1,19 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_DESKTOP_MINIDUMP_MINIDUMP_HXX +#define INCLUDED_DESKTOP_MINIDUMP_MINIDUMP_HXX + +#include <string> + +bool readConfig(const std::string& iniPath); + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/desktop/source/minidump/minidump_upload.cxx b/desktop/source/minidump/minidump_upload.cxx index 597580d..7f8d617 100644 --- a/desktop/source/minidump/minidump_upload.cxx +++ b/desktop/source/minidump/minidump_upload.cxx @@ -7,189 +7,11 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include <string> -#include <map> -#include <memory> -#include <iostream> -#include <fstream> +#include "minidump.hxx" -#include <curl/curl.h> +#include<iostream> -static const char kUserAgent[] = "Breakpad/1.0 (Linux)"; - -std::map<std::string, std::string> readStrings(std::istream& file) -{ - std::map<std::string, std::string> parameters; - - - while (!file.eof()) - { - std::string line; - std::getline(file, line); - int sep = line.find('='); - if (sep >= 0) - { - std::string key = line.substr(0, sep); - std::string value = line.substr(sep + 1); - parameters[key] = value; - } - } - - return parameters; -} - -// Callback to get the response data from server. -static size_t WriteCallback(void *ptr, size_t size, - size_t nmemb, void *userp) -{ - if (!userp) - return 0; - - std::string* response = reinterpret_cast<std::string *>(userp); - size_t real_size = size * nmemb; - response->append(reinterpret_cast<char *>(ptr), real_size); - return real_size; -} - -void getProperty(const std::string& key, std::string& value, - std::map<std::string, std::string>& parameters) -{ - auto itr = parameters.find(key); - if (itr != parameters.end()) - { - value = itr->second; - parameters.erase(itr); - } -} - -bool uploadContent(std::map<std::string, std::string>& parameters) -{ - CURL* curl = curl_easy_init(); - if (!curl) - return false; - - std::string proxy, proxy_user_pwd, ca_certificate_file, file, url; - - getProperty("Proxy", proxy, parameters); - getProperty("ProxyUserPW", proxy_user_pwd, parameters); - getProperty("CAFile", ca_certificate_file, parameters); - - getProperty("DumpFile", file, parameters); - getProperty("URL", url, parameters); - if (url.empty()) - return false; - - if (file.empty()) - return false; - - if (version.empty()) - return false; - - curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); - curl_easy_setopt(curl, CURLOPT_USERAGENT, kUserAgent); - // Set proxy information if necessary. - if (!proxy.empty()) - curl_easy_setopt(curl, CURLOPT_PROXY, proxy.c_str()); - if (!proxy_user_pwd.empty()) - curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, proxy_user_pwd.c_str()); - - if (!ca_certificate_file.empty()) - curl_easy_setopt(curl, CURLOPT_CAINFO, ca_certificate_file.c_str()); - - curl_httppost* formpost = nullptr; - curl_httppost* lastptr = nullptr; - for (auto itr = parameters.begin(), itEnd = parameters.end(); itr != itEnd; ++itr) - { - curl_formadd(&formpost, &lastptr, - CURLFORM_COPYNAME, itr->first.c_str(), - CURLFORM_COPYCONTENTS, itr->second.c_str(), - CURLFORM_END); - } - - std::string response_body; - long response_code; - curl_formadd(&formpost, &lastptr, - CURLFORM_COPYNAME, "upload_file_minidump", - CURLFORM_FILE, file.c_str(), - CURLFORM_END); - - curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost); - - - // Disable 100-continue header. - char buf[] = "Expect:"; - curl_slist* headerlist = NULL; - headerlist = curl_slist_append(headerlist, buf); - curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist); - - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, - reinterpret_cast<void *>(&response_body)); - - // Fail if 400+ is returned from the web server. - curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1); - - CURLcode cc = curl_easy_perform(curl); - curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code); -#ifndef NDEBUG - if (cc != CURLE_OK) - fprintf(stderr, "Failed to send http request to %s, error: %s\n", - url.c_str(), - curl_easy_strerror(cc)); -#endif - - const char* error_description = curl_easy_strerror(cc); - - if (formpost != NULL) - { - curl_formfree(formpost); - } - if (headerlist != NULL) - { - curl_slist_free_all(headerlist); - } - - std::cerr << response_body << " " << error_description << std::endl; - - - if( CURLE_OK != cc ) - return false; - - return true; -} - -bool readConfig(char** argv) -{ - std::string iniPath = argv[1]; - - std::ifstream file(iniPath); - std::map<std::string, std::string> parameters = readStrings(file); - - // make sure that at least the mandatory parameters are in there - if (parameters.find("DumpFile") == parameters.end()) - { - std::cerr << "ini file needs to contain a key DumpFile!"; - return false; - } - - if (parameters.find("Version") == parameters.end()) - { - std::cerr << "ini file needs to contain a key Version!"; - return false; - } - - if (parameters.find("ProductName") == parameters.end()) - { - std::cerr << "ini file needs to contain a ket ProductName!"; - return false; - } - - uploadContent(parameters); - - return true; -} - -int main(int argc, char* argv[]) +int main(int argc, char** argv) { if (argc < 2) { @@ -197,7 +19,8 @@ int main(int argc, char* argv[]) return EXIT_FAILURE; } - if (!readConfig(argv)) + std::string iniPath(argv[1]); + if (!readConfig(iniPath)) return EXIT_FAILURE; return EXIT_SUCCESS; commit cb2a4be6fcf3888d9fa4870503b2830fbe3788e6 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Thu Jun 2 17:04:27 2016 +0200 add some more error checking to minidump uploader Change-Id: Ia06fec80ea67e88b8c26cdeb5bfc9cee2459ad4a Reviewed-on: https://gerrit.libreoffice.org/25861 Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/desktop/source/minidump/minidump_upload.cxx b/desktop/source/minidump/minidump_upload.cxx index 24039e5..597580d 100644 --- a/desktop/source/minidump/minidump_upload.cxx +++ b/desktop/source/minidump/minidump_upload.cxx @@ -79,6 +79,12 @@ bool uploadContent(std::map<std::string, std::string>& parameters) if (url.empty()) return false; + if (file.empty()) + return false; + + if (version.empty()) + return false; + curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); curl_easy_setopt(curl, CURLOPT_USERAGENT, kUserAgent); // Set proxy information if necessary. commit 7194c4a4d9a6e08f6b6a693691b1139cf2435fa2 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Mon May 30 05:51:36 2016 +0200 use the existing url to path function also in the ini file part Change-Id: Ia92261a63cfe1d51f68f312a27d5ba4b42719c47 Reviewed-on: https://gerrit.libreoffice.org/25647 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/desktop/source/app/crashreport.cxx b/desktop/source/app/crashreport.cxx index b8e0127..c1d57de 100644 --- a/desktop/source/app/crashreport.cxx +++ b/desktop/source/app/crashreport.cxx @@ -60,11 +60,9 @@ OUString getCrashUserProfileDirectory() rtl::Bootstrap::expandMacros(url); osl::Directory::create(url); -#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID - return url.copy(7); -#elif defined WNT - return url.copy(8); -#endif + OUString aProfilePath; + osl::FileBase::getSystemPathFromFileURL(url, aProfilePath); + return aProfilePath; } } commit e841a8bcf7bdb2bfe1d34d8f0eeeb7f43fd9864f Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sun May 29 12:15:18 2016 +0200 use the existing URL to path tools Change-Id: I20aa47556205f5efc70f8f5ea39c63009110f986 Reviewed-on: https://gerrit.libreoffice.org/25646 Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/include/sal/config.h b/include/sal/config.h index e891a6b..48119cc 100644 --- a/include/sal/config.h +++ b/include/sal/config.h @@ -29,6 +29,7 @@ #ifdef WIN32 #define SAL_W32 #define SAL_DLLEXTENSION ".dll" +#define SAL_EXEEXTENSION ".exe" #define SAL_PATHSEPARATOR ';' #define SAL_PATHDELIMITER '\\' #define SAL_NEWLINE_STRING "\r\n" @@ -56,6 +57,7 @@ defined(AIX) || defined(OPENBSD) || defined(DRAGONFLY) || defined(ANDROID) #define SAL_UNX #define SAL_DLLEXTENSION ".so" +#define SAL_EXEEXTENSION "" #define SAL_DLLPREFIX "lib" #define SAL_PATHSEPARATOR ':' #define SAL_PATHDELIMITER '/' @@ -66,6 +68,7 @@ #ifdef MACOSX #define SAL_UNX #define SAL_DLLEXTENSION ".dylib" +#define SAL_EXEEXTENSION "" #define SAL_DLLPREFIX "lib" #define SAL_PATHSEPARATOR ':' #define SAL_PATHDELIMITER '/' diff --git a/svx/source/dialog/crashreportdlg.cxx b/svx/source/dialog/crashreportdlg.cxx index 730dff5..aeb5c14 100644 --- a/svx/source/dialog/crashreportdlg.cxx +++ b/svx/source/dialog/crashreportdlg.cxx @@ -13,6 +13,7 @@ #include <rtl/bootstrap.hxx> #include <desktop/crashreport.hxx> +#include <osl/file.hxx> CrashReportDialog::CrashReportDialog(vcl::Window* pParent): Dialog(pParent, "CrashReportDialog", @@ -40,12 +41,12 @@ void CrashReportDialog::dispose() namespace { -OString getLibDir() +OUString getLibDir() { OUString aOriginal = "$BRAND_BASE_DIR/" LIBO_LIBEXEC_FOLDER; rtl::Bootstrap::expandMacros(aOriginal); - return rtl::OUStringToOString(aOriginal, RTL_TEXTENCODING_UTF8); + return aOriginal; } } @@ -55,13 +56,14 @@ IMPL_LINK_TYPED(CrashReportDialog, BtnHdl, Button*, pBtn, void) if (pBtn == mpBtnSend.get()) { std::string ini_path = CrashReporter::getIniFileName(); -#if defined WNT - OString aCommand = getLibDir().copy(8) + "/minidump_upload.exe " + ini_path.c_str(); -#else - OString aCommand = getLibDir().copy(7) + "/minidump_upload " + ini_path.c_str(); -#endif - int retVal = std::system(aCommand.getStr()); - SAL_WARN_IF(retVal != 0, "crashreport", "Failed to upload minidump. Error Code: " << retVal); + OUString aCommand; + osl::FileBase::getSystemPathFromFileURL(getLibDir() + "/minidump_upload" + SAL_EXEEXTENSION, aCommand); + + aCommand = aCommand; + OString aOStringCommand = rtl::OUStringToOString(aCommand, RTL_TEXTENCODING_UTF8) + " " + ini_path.c_str(); + int retVal = std::system(aOStringCommand.getStr()); + SAL_WARN_IF(retVal != 0, "svx.dialog", "Failed to upload minidump. Error Code: " << retVal); + // TODO: moggi: return the id for the user to look it up Close(); } else if (pBtn == mpBtnCancel.get()) commit e4aeec92c577fe457ae9dd992cd1f2b5d9ba42de Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Wed May 25 00:09:21 2016 +0200 crash report lib should be part of mergelib Change-Id: I23c338f9fcf7eeea4a440013ea6c1b9206e040f3 Reviewed-on: https://gerrit.libreoffice.org/25430 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/solenv/gbuild/extensions/pre_MergedLibsList.mk b/solenv/gbuild/extensions/pre_MergedLibsList.mk index 1ca047f..9d43038 100644 --- a/solenv/gbuild/extensions/pre_MergedLibsList.mk +++ b/solenv/gbuild/extensions/pre_MergedLibsList.mk @@ -18,6 +18,7 @@ gb_MERGEDLIBS := \ canvastools \ configmgr \ cppcanvas \ + $(call gb_Helper_optional,BREAKPAD,crashreport) \ $(call gb_Helper_optional,DBCONNECTIVITY,dbtools) \ deployment \ deploymentmisc \ commit 8cca34a4ed502304e6bba461738356d1f70a0a74 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Tue May 24 21:31:32 2016 +0200 don't use the VM URL anywhere Change-Id: I0967c8fcea972b2dde58e3481f4767e225d3b2ba diff --git a/bin/upload_symbols.py b/bin/upload_symbols.py index fd4246e..d382f70 100755 --- a/bin/upload_symbols.py +++ b/bin/upload_symbols.py @@ -18,8 +18,8 @@ def main(): print("Invalid number of parameters") sys.exit(1) - upload_url = "http://vm171.documentfoundation.org/upload/" - login_url = "http://vm171.documentfoundation.org/accounts/login/" + upload_url = "http://crashreport.libreoffice.org/upload/" + login_url = "http://crashreport.libreoffice.org/accounts/login/" config = configparser.ConfigParser() config.read(sys.argv[2]) commit 8650fd2cf0dc3f036bae6e80582f8bb1bd79dc2b Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Tue May 24 21:05:02 2016 +0200 use correct path for minidump_upload on windows Change-Id: I1cd60d8b8b1c55b039f76bdaa4f73dc31e654d12 diff --git a/svx/source/dialog/crashreportdlg.cxx b/svx/source/dialog/crashreportdlg.cxx index 74066a8..730dff5 100644 --- a/svx/source/dialog/crashreportdlg.cxx +++ b/svx/source/dialog/crashreportdlg.cxx @@ -55,7 +55,11 @@ IMPL_LINK_TYPED(CrashReportDialog, BtnHdl, Button*, pBtn, void) if (pBtn == mpBtnSend.get()) { std::string ini_path = CrashReporter::getIniFileName(); +#if defined WNT + OString aCommand = getLibDir().copy(8) + "/minidump_upload.exe " + ini_path.c_str(); +#else OString aCommand = getLibDir().copy(7) + "/minidump_upload " + ini_path.c_str(); +#endif int retVal = std::system(aCommand.getStr()); SAL_WARN_IF(retVal != 0, "crashreport", "Failed to upload minidump. Error Code: " << retVal); Close(); commit efabb5a64a7cf241d6250ece2547e1837d380584 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Tue May 24 21:03:35 2016 +0200 add the file extension for minidumps on windows Change-Id: Ib5692ef839c500cac7d2551d0b0ee6faf141132a diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx index 8820d7f..d1c5885 100644 --- a/desktop/source/app/sofficemain.cxx +++ b/desktop/source/app/sofficemain.cxx @@ -89,7 +89,7 @@ static bool dumpCallback(const wchar_t* path, const wchar_t* id, std::ofstream minidump_file(ini_path, std::ios_base::app); // TODO: moggi: can we avoid this conversion std::wstring_convert<std::codecvt_utf8<wchar_t>> conv1; - std::string aPath = conv1.to_bytes(std::wstring(path)) + conv1.to_bytes(std::wstring(id)); + std::string aPath = conv1.to_bytes(std::wstring(path)) + conv1.to_bytes(std::wstring(id)) + ".dmp"; minidump_file << "DumpFile=" << aPath << "\n";; minidump_file.close(); SAL_WARN("desktop", "minidump generated: " << aPath); commit beb337539b3a5d7ceb8280bc16473b7505f245fe Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Tue May 24 21:02:58 2016 +0200 use correct URL for crashreport Change-Id: Ia7d584685961e8573c1c35f2560a66664632f5f7 diff --git a/desktop/source/app/crashreport.cxx b/desktop/source/app/crashreport.cxx index 7a8446c..b8e0127 100644 --- a/desktop/source/app/crashreport.cxx +++ b/desktop/source/app/crashreport.cxx @@ -46,7 +46,7 @@ void CrashReporter::writeCommonInfo() std::ofstream minidump_file(ini_path, std::ios_base::trunc); minidump_file << "ProductName=LibreOffice\n"; minidump_file << "Version=" LIBO_VERSION_DOTTED "\n"; - minidump_file << "URL=http://crashreport.libreoffice.org/submit\n"; + minidump_file << "URL=http://crashreport.libreoffice.org/submit/\n"; minidump_file.close(); updateMinidumpLocation(); commit db2424e88a28278ce6c52bc19de05e3cd016504f Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Tue May 24 20:51:32 2016 +0200 copy and paste error in minidump uploader Change-Id: I114325f2de2f2953d158b88f5f0e0a3bac853368 diff --git a/desktop/source/minidump/minidump_upload.cxx b/desktop/source/minidump/minidump_upload.cxx index 658918a..24039e5 100644 --- a/desktop/source/minidump/minidump_upload.cxx +++ b/desktop/source/minidump/minidump_upload.cxx @@ -75,7 +75,7 @@ bool uploadContent(std::map<std::string, std::string>& parameters) getProperty("CAFile", ca_certificate_file, parameters); getProperty("DumpFile", file, parameters); - getProperty("URL", file, parameters); + getProperty("URL", url, parameters); if (url.empty()) return false; commit 4204966420bcb9c48d2b332eefe978cbda8bb6ca Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Tue May 24 09:24:48 2016 +0200 this is unnecessary and os.path.abspath seems to be confused in cygwin Change-Id: I125eb2e3416c998ca16f9c9772a1e24183a222af diff --git a/bin/symbolstore.py b/bin/symbolstore.py index 823be62..f232423 100755 --- a/bin/symbolstore.py +++ b/bin/symbolstore.py @@ -340,7 +340,7 @@ class Dumper: def __init__(self, dump_syms, symbol_path, archs=None, srcdir=None, copy_debug=False, vcsinfo=False, srcsrv=False): # popen likes absolute paths, at least on windows - self.dump_syms = os.path.abspath(dump_syms) + self.dump_syms = dump_syms self.symbol_path = symbol_path if archs is None: # makes the loop logic simpler commit 5314e2a2e0d06805a4517f2e947611b1f308f9bd Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Tue May 24 09:12:41 2016 +0200 make the symbol generation also work correctly on windows Change-Id: I2fc5e8fb2535ac076f045435c828126a52ea5bbd diff --git a/Makefile.in b/Makefile.in index 9414577..218336f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -351,7 +351,12 @@ findunusedheaders: symbols: rm -fr $(WORKDIR)/symbols/ mkdir -p $(WORKDIR)/symbols/ +ifeq ($(OS),WNT) + $(SRCDIR)/bin/symbolstore.py $(WORKDIR)/UnpackedTarball/breakpad/src/tools/windows/binaries/dump_syms.exe $(WORKDIR)/symbols/ $(INSTDIR)/program/* +else $(SRCDIR)/bin/symbolstore.py $(WORKDIR)/UnpackedTarball/breakpad/src/tools/linux/dump_syms/dump_syms $(WORKDIR)/symbols/ $(INSTDIR)/program/* +endif + cd $(WORKDIR)/symbols/ && zip -r $(WORKDIR)/symbols.zip * upload-symbols: commit cde24415cfd1ccd2a1fe7929016907c61fb51c0d Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Tue May 24 06:20:00 2016 +0200 fix previous commits Change-Id: I91e9f1d0f40dd3dd50b03a27ded2f96c71cd1ffd diff --git a/desktop/source/app/crashreport.cxx b/desktop/source/app/crashreport.cxx index 80c5920..7a8446c 100644 --- a/desktop/source/app/crashreport.cxx +++ b/desktop/source/app/crashreport.cxx @@ -60,11 +60,11 @@ OUString getCrashUserProfileDirectory() rtl::Bootstrap::expandMacros(url); osl::Directory::create(url); -+#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID -+ return url.copy(7); -+#elif defined WNT -+ return url.copy(8); -+#endif +#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID + return url.copy(7); +#elif defined WNT + return url.copy(8); +#endif } } commit 124c5d8608b55029149e63d4290dfaaded695737 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Tue May 24 04:27:46 2016 +0200 make debuggin failures a bit easier Change-Id: I0b17ab513e05ee95c378399348557cfee8341fb0 diff --git a/bin/upload_symbols.py b/bin/upload_symbols.py index f9aa40c..fd4246e 100755 --- a/bin/upload_symbols.py +++ b/bin/upload_symbols.py @@ -14,6 +14,7 @@ def detect_platform(): def main(): if len(sys.argv) != 4: + print(sys.argv) print("Invalid number of parameters") sys.exit(1) commit 53def319e25af60c04903a4ad61b0d67cd0b486a Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Tue May 24 04:27:18 2016 +0200 add build system part for upload crashreport symbols Change-Id: Ib8dc0267034716740ba6d7f60cf635adc4bd1561 diff --git a/Makefile.gbuild b/Makefile.gbuild index 8c41a28..bcfa569 100644 --- a/Makefile.gbuild +++ b/Makefile.gbuild @@ -20,4 +20,7 @@ include $(SRCDIR)/solenv/gbuild/gbuild.mk $(eval $(call gb_Module_make_global_targets,$(SRCDIR)/RepositoryModule_$(gb_Side).mk)) +upload-symbols: + bin/upload_symbols.py $(WORKDIR)/symbols.zip $(BREAKPAD_SYMBOL_CONFIG) "$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)$(LIBO_VERSION_SUFFIX)$(LIBO_VERSION_SUFFIX_SUFFIX)" + # vim: set noet sw=4 ts=4: diff --git a/Makefile.in b/Makefile.in index 148294b..9414577 100644 --- a/Makefile.in +++ b/Makefile.in @@ -354,6 +354,9 @@ symbols: $(SRCDIR)/bin/symbolstore.py $(WORKDIR)/UnpackedTarball/breakpad/src/tools/linux/dump_syms/dump_syms $(WORKDIR)/symbols/ $(INSTDIR)/program/* cd $(WORKDIR)/symbols/ && zip -r $(WORKDIR)/symbols.zip * +upload-symbols: + $(MAKE) -f $(SRCDIR)/Makefile.gbuild upload-symbols + dump-deps: @$(SRCDIR)/bin/module-deps.pl $(MAKE) $(SRCDIR)/Makefile.gbuild diff --git a/config_host.mk.in b/config_host.mk.in index 4bb7427..46fb4ed 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -41,6 +41,7 @@ export BOOST_IOSTREAMS_LIB=@BOOST_IOSTREAMS_LIB@ export BOOST_LDFLAGS=@BOOST_LDFLAGS@ export BOOST_SYSTEM_LIB=@BOOST_SYSTEM_LIB@ export BRAND_INTRO_IMAGES=@BRAND_INTRO_IMAGES@ +export BREAKPAD_SYMBOL_CONFIG=@BREAKPAD_SYMBOL_CONFIG@ export BSH_JAR=@BSH_JAR@ export BUILD_PLATFORM=@build@ export BUILD_POSTGRESQL_SDBC=@BUILD_POSTGRESQL_SDBC@ diff --git a/configure.ac b/configure.ac index 2146f48..2f1980d 100644 --- a/configure.ac +++ b/configure.ac @@ -1980,6 +1980,12 @@ AC_ARG_WITH(ant-home, ], ,) +AC_ARG_WITH(symbol-config, + AS_HELP_STRING([--with-symbol-config], + [Configuration for the crashreport symbol upload]), + [], + [$with_symbol_config=no]) + ... etc. - the rest is truncated
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits