diff -Nru kcrash-5.18.0/.arcconfig kcrash-5.44.0/.arcconfig --- kcrash-5.18.0/.arcconfig 1970-01-01 00:00:00.000000000 +0000 +++ kcrash-5.44.0/.arcconfig 2018-03-03 09:52:04.000000000 +0000 @@ -0,0 +1,3 @@ +{ + "phabricator.uri" : "https://phabricator.kde.org/" +} diff -Nru kcrash-5.18.0/autotests/CMakeLists.txt kcrash-5.44.0/autotests/CMakeLists.txt --- kcrash-5.18.0/autotests/CMakeLists.txt 2016-01-01 19:52:07.000000000 +0000 +++ kcrash-5.44.0/autotests/CMakeLists.txt 2018-03-03 09:52:04.000000000 +0000 @@ -15,7 +15,11 @@ return() endif() +# Include src so we have access to config-kcrash.h +include_directories(${CMAKE_CURRENT_BINARY_DIR}/../src) + ecm_add_tests( + coreconfigtest.cpp kcrashtest.cpp LINK_LIBRARIES Qt5::Core Qt5::Test ) diff -Nru kcrash-5.18.0/autotests/coreconfigtest.cpp kcrash-5.44.0/autotests/coreconfigtest.cpp --- kcrash-5.18.0/autotests/coreconfigtest.cpp 1970-01-01 00:00:00.000000000 +0000 +++ kcrash-5.44.0/autotests/coreconfigtest.cpp 2018-03-03 09:52:04.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2016 Harald Sitter + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include "../src/coreconfig.cpp" + +class CoreConfigTest : public QObject +{ + Q_OBJECT +private Q_SLOTS: + void initTestCase() {} + + void testExec() + { + KCrash::CoreConfig c(QFINDTESTDATA("core_patterns/exec")); +#ifdef KCRASH_CORE_PATTERN_RAISE + QCOMPARE(c.isProcess(), true); +#else + QCOMPARE(c.isProcess(), false); +#endif + } + + void testNoFile() + { + KCrash::CoreConfig c("/meow/kitteh/meow"); + QCOMPARE(c.isProcess(), false); + } + + void testNoExec() + { + KCrash::CoreConfig c(QFINDTESTDATA("core_patterns/no-exec")); + QCOMPARE(c.isProcess(), false); + } +}; + +QTEST_MAIN(CoreConfigTest) + +#include "coreconfigtest.moc" diff -Nru kcrash-5.18.0/autotests/core_patterns/exec kcrash-5.44.0/autotests/core_patterns/exec --- kcrash-5.18.0/autotests/core_patterns/exec 1970-01-01 00:00:00.000000000 +0000 +++ kcrash-5.44.0/autotests/core_patterns/exec 2018-03-03 09:52:04.000000000 +0000 @@ -0,0 +1 @@ +|/lib/systemd/systemd-coredump %P %u %g %s %t 1213213 %e diff -Nru kcrash-5.18.0/autotests/core_patterns/no-exec kcrash-5.44.0/autotests/core_patterns/no-exec --- kcrash-5.18.0/autotests/core_patterns/no-exec 1970-01-01 00:00:00.000000000 +0000 +++ kcrash-5.44.0/autotests/core_patterns/no-exec 2018-03-03 09:52:04.000000000 +0000 @@ -0,0 +1 @@ +/tmp/cores/core.%e.%p.%h.%t diff -Nru kcrash-5.18.0/autotests/kcrashtest.cpp kcrash-5.44.0/autotests/kcrashtest.cpp --- kcrash-5.18.0/autotests/kcrashtest.cpp 2016-01-01 19:52:07.000000000 +0000 +++ kcrash-5.44.0/autotests/kcrashtest.cpp 2018-03-03 09:52:04.000000000 +0000 @@ -30,8 +30,11 @@ void initTestCase() { // Don't bring up drkonqi qputenv("KDE_DEBUG", "1"); + // change to the bin dir + QDir::setCurrent(QCoreApplication::applicationDirPath()); } void testAutoRestart(); + void testAutoRestartDirectly(); void testEmergencySave(); }; @@ -64,6 +67,7 @@ QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); env.insert(QStringLiteral("ASAN_OPTIONS"), QStringLiteral("handle_segv=0,poison_heap=0")); // Disable ASAN proc.setProcessEnvironment(env); + proc.setProcessChannelMode(QProcess::ForwardedChannels); proc.start(processName, QStringList() << flag); bool ok = proc.waitForFinished(); QVERIFY(ok); @@ -80,11 +84,16 @@ QCOMPARE(QString(logData), QString(expectedOutput)); } -void KCrashTest::testAutoRestart() +void KCrashTest::testAutoRestart() // use kdeinit if possible, otherwise directly (ex: on CI) { startCrasher("AR", "starting AR\nautorestarted AR\n"); } +void KCrashTest::testAutoRestartDirectly() // test directly (so a developer can test the CI case) +{ + startCrasher("ARD", "starting ARD\nautorestarted ARD\n"); +} + void KCrashTest::testEmergencySave() { startCrasher("ES", "starting ES\nsaveFunction called\n"); diff -Nru kcrash-5.18.0/autotests/test_crasher.cpp kcrash-5.44.0/autotests/test_crasher.cpp --- kcrash-5.18.0/autotests/test_crasher.cpp 2016-01-01 19:52:07.000000000 +0000 +++ kcrash-5.44.0/autotests/test_crasher.cpp 2018-03-03 09:52:04.000000000 +0000 @@ -43,6 +43,8 @@ if (flag == "AR") { // auto restart KCrash::setFlags(KCrash::AutoRestart); + } else if (flag == "ARD") { // auto restart, always directly + KCrash::setFlags(KCrash::AutoRestart | KCrash::AlwaysDirectly); } else if (flag == "ES") { // emergency save KCrash::setEmergencySaveFunction(saveFunction); } diff -Nru kcrash-5.18.0/CMakeLists.txt kcrash-5.44.0/CMakeLists.txt --- kcrash-5.18.0/CMakeLists.txt 2016-01-01 19:52:07.000000000 +0000 +++ kcrash-5.44.0/CMakeLists.txt 2018-03-03 09:52:04.000000000 +0000 @@ -1,18 +1,20 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.0) -project(KCrash) +set(KF5_VERSION "5.44.0") # handled by release scripts +set(KF5_DEP_VERSION "5.44.0") # handled by release scripts +project(KCrash VERSION ${KF5_VERSION}) include(FeatureSummary) -find_package(ECM 5.18.0 NO_MODULE) +find_package(ECM 5.44.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) -set(REQUIRED_QT_VERSION 5.3.0) +set(REQUIRED_QT_VERSION 5.7.0) find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core) include(KDEInstallDirs) -include(KDEFrameworkCompilerSettings) +include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(KDECMakeSettings) if (NOT APPLE) @@ -25,10 +27,12 @@ include(GenerateExportHeader) include(ECMSetupVersion) include(ECMGenerateHeaders) +include(ECMAddQch) -set(KF5_VERSION "5.18.0") # handled by release scripts -set(KF5_DEP_VERSION "5.18.0") # handled by release scripts -ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KCrash +option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) +add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") + +ecm_setup_version(PROJECT VARIABLE_PREFIX KCrash VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kcrash_version.h" PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5CrashConfigVersion.cmake" SOVERSION 5) @@ -36,6 +40,22 @@ find_package(KF5CoreAddons ${KF5_DEP_VERSION} REQUIRED) find_package(KF5WindowSystem ${KF5_DEP_VERSION} REQUIRED) +# On KF5.29 we want kernel pattern raising to be default, so automate the +# switch. +# This can be savely removed for KF5.29+ +set(KCRASH_CORE_PATTERN_RAISE_DEFAULT ON) +if(${KF5_VERSION} VERSION_LESS "5.29.0") + set(KCRASH_CORE_PATTERN_RAISE_DEFAULT OFF) + set(FEATURE_ADDENDUM "This will be enabled by default in 5.29.") +endif() + +option(KCRASH_CORE_PATTERN_RAISE + "Enables raising signals to kernel core patterns (iff the pattern is a process). You may wish to not intall drkonqi if this can cause a UI conflict." + ${KCRASH_CORE_PATTERN_RAISE_DEFAULT}) +add_feature_info("Core Pattern Raising" + KCRASH_CORE_PATTERN_RAISE + "Raising signals to kernel core patterns (iff the pattern is a process). You may wish to not install drkonqi if this can cause a UI conflict. ${FEATURE_ADDENDUM}") + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/po) include(ECMPoQmTools) ecm_install_po_files_as_qm(po) @@ -47,9 +67,19 @@ # create a Config.cmake and a ConfigVersion.cmake file and install them set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Crash") -include(ECMPackageConfigHelpers) +if (BUILD_QCH) + ecm_install_qch_export( + TARGETS KF5Crash_QCH + FILE KF5CrashQchTargets.cmake + DESTINATION "${CMAKECONFIG_INSTALL_DIR}" + COMPONENT Devel + ) + set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5CrashQchTargets.cmake\")") +endif() + +include(CMakePackageConfigHelpers) -ecm_configure_package_config_file( +configure_package_config_file( "${CMAKE_CURRENT_SOURCE_DIR}/KF5CrashConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/KF5CrashConfig.cmake" INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} @@ -69,4 +99,6 @@ DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel ) +install(FILES kcrash.categories DESTINATION ${KDE_INSTALL_CONFDIR}) + feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff -Nru kcrash-5.18.0/debian/changelog kcrash-5.44.0/debian/changelog --- kcrash-5.18.0/debian/changelog 2016-03-07 22:19:20.000000000 +0000 +++ kcrash-5.44.0/debian/changelog 2019-11-29 19:38:22.000000000 +0000 @@ -1,3 +1,228 @@ +kcrash (5.44.0-0ubuntu1~16.04.sav0) xenial; urgency=medium + + * Backport to Xenial + + -- Rob Savoury Fri, 29 Nov 2019 11:38:22 -0800 + +kcrash (5.44.0-0ubuntu1) bionic; urgency=medium + + * New upstream release (5.44.0) + + -- Rik Mills Mon, 12 Mar 2018 19:56:42 +0000 + +kcrash (5.43.0-0ubuntu1) bionic; urgency=medium + + * New upstream release (5.43.0) + + -- Rik Mills Sun, 11 Feb 2018 11:14:24 +0000 + +kcrash (5.42.0-0ubuntu1) bionic; urgency=medium + + * Drop patch disabling formally broken test + * Install kcrash.categories file + * New upstream release (5.42.0) + + -- Rik Mills Fri, 26 Jan 2018 22:20:27 +0000 + +kcrash (5.41.0-0ubuntu1) bionic; urgency=low + + * New upstream release (5.41.0) + + -- Walter Lapchynski Sun, 10 Dec 2017 22:03:53 -0600 + +kcrash (5.41.0-0ubuntu1)U NRELEASED; urgency=low + + * New upstream release (5.41.0) + + -- Walter Lapchynski Sat, 09 Dec 2017 19:44:04 +0000 + +kcrash (5.40.0-0ubuntu1) bionic; urgency=medium + + * New upstream release (5.39.0) + * New upstream release (5.40.0) + + -- Rik Mills Fri, 24 Nov 2017 17:15:31 +0000 + +kcrash (5.38.0-0ubuntu2) artful; urgency=medium + + * debian/patches: add kubuntu_disable_broken_test.patch + - Disable kcrash autorestart test, which fails when run on ubuntu + test infrastructure, but passes in LXC and qemu using the official + cloud-vm image + + -- Rik Mills Thu, 21 Sep 2017 09:22:46 +0100 + +kcrash (5.38.0-0ubuntu1) artful; urgency=low + + * New upstream release (5.38.0) + + -- Rik Mills Mon, 11 Sep 2017 13:14:33 +0100 + +kcrash (5.37.0-0ubuntu1) artful; urgency=low + + * New upstream release (5.37.0) + + -- Rik Mills Sat, 12 Aug 2017 18:48:20 +0100 + +kcrash (5.36.0-0ubuntu1) artful; urgency=low + + * New upstream release (5.36.0) + + -- José Manuel Santamaría Lema Tue, 11 Jul 2017 23:53:09 +0100 + +kcrash (5.35.0-0ubuntu1) artful; urgency=low + + * New upstream release (5.35.0) + + -- José Manuel Santamaría Lema Mon, 12 Jun 2017 22:58:18 +0100 + +kcrash (5.34.0-0ubuntu1) artful; urgency=low + + * New upstream release (5.34.0) + + -- José Manuel Santamaría Lema Mon, 15 May 2017 21:26:13 +0100 + +kcrash (5.33.0-0ubuntu1) artful; urgency=low + + * New upstream release (5.33.0) + + -- José Manuel Santamaría Lema Sat, 29 Apr 2017 18:05:33 +0100 + +kcrash (5.31.0-0ubuntu1) zesty; urgency=medium + + * Pass '-fno-keep-inline-functions' to gcc in the acc test in order to + avoid possible spurious test failures. + * Use the build-needed restriction instead of rebuilding the package + instead of rebuilding the package in debian/tests/testuite. + * New upstream release (5.31.0) + + -- José Manuel Santamaría Lema Tue, 14 Feb 2017 22:51:15 +0000 + +kcrash (5.30.0-0ubuntu1) zesty; urgency=low + + * New upstream release (5.30.0) + + -- Rik Mills Wed, 01 Feb 2017 18:34:59 +0000 + +kcrash (5.28.0-0ubuntu1) zesty; urgency=low + + [ Rik Mills ] + * New upstream release (5.27.0) + * Merge with debian/master + + [ José Manuel Santamaría Lema ] + * Update Vcs-Git field to use https:// instead of git:// + * New upstream release (5.28.0) + + -- José Manuel Santamaría Lema Mon, 05 Dec 2016 20:17:07 +0000 + +kcrash (5.27.0-1) unstable; urgency=medium + + [ Automatic packaging ] + * Update build-deps and deps with the info from cmake + + [ Maximiliano Curia ] + * New upstream release (5.27) + * Bump group breaks (5.27) + + -- Maximiliano Curia Sat, 15 Oct 2016 16:59:36 +0200 + +kcrash (5.26.0-1) unstable; urgency=medium + + [ Automatic packaging ] + * Update build-deps and deps with the info from cmake + + [ Maximiliano Curia ] + * Bump group breaks (5.26) + * Replace dbus-launch with dbus-run-session in tests + + -- Maximiliano Curia Thu, 29 Sep 2016 11:58:56 +0200 + +kcrash (5.26.0-0ubuntu1) yakkety; urgency=low + + * New upstream release (5.26.0) + + -- Rik Mills Thu, 22 Sep 2016 13:42:37 +0100 + +kcrash (5.25.0-1) unstable; urgency=medium + + [ Automatic packaging ] + * Update build-deps and deps with the info from cmake + + [ Maximiliano Curia ] + * Bump group breaks (5.25) + + -- Maximiliano Curia Fri, 19 Aug 2016 09:09:37 +0200 + +kcrash (5.24.0-0ubuntu1) yakkety; urgency=medium + + * New upstream release (5.24.0) + + -- Philip Muškovac Tue, 26 Jul 2016 08:38:44 +0000 + +kcrash (5.23.0-1) unstable; urgency=medium + + [ Automatic packaging ] + * Update build-deps and deps with the info from cmake + + -- Maximiliano Curia Sat, 18 Jun 2016 18:46:32 +0200 + +kcrash (5.23.0-0ubuntu1) yakkety; urgency=medium + + * New upstream release (5.23.0) + + -- Clive Johnston Mon, 11 Jul 2016 22:09:40 +0200 + +kcrash (5.22.0-1) unstable; urgency=medium + + [ Automatic packaging ] + * Update build-deps and deps with the info from cmake + + -- Maximiliano Curia Thu, 19 May 2016 16:21:34 +0200 + +kcrash (5.22.0-0ubuntu1) yakkety; urgency=medium + + [ Scarlett Clark ] + * New upstream release. + * Debian merge: No remaining changes. + + [ Philip Muškovac ] + * Update the Vcs URLs now that the repositories are hosted on + Launchpad + + [ Clive Johnston ] + * New upstream release + + -- Clive Johnston Tue, 17 May 2016 16:15:03 -0700 + +kcrash (5.21.0-1) experimental; urgency=medium + + [ Maximiliano Curia ] + * Replace the "Historical name" ddeb-migration by its "Modern, clearer" replacement dbgsym-migration. + * Add upstream metadata (DEP-12) + * debian/control: Update Vcs-Browser and Vcs-Git fields + * Update acc test script + * uscan no longer supports more than one main upstream tarball being listed + + [ Automatic packaging ] + * Update build-deps and deps with the info from cmake + * Bump Standards-Version to 3.9.8 + + -- Maximiliano Curia Sat, 07 May 2016 10:54:57 +0200 + +kcrash (5.19.0-1) experimental; urgency=medium + + * New upstream release (5.19.0). + + -- Maximiliano Curia Sat, 13 Feb 2016 15:15:54 +0100 + +kcrash (5.18.0-1) experimental; urgency=medium + + * New upstream release (5.17.0). + * New upstream release (5.18.0). + + -- Maximiliano Curia Wed, 27 Jan 2016 13:33:27 +0100 + kcrash (5.18.0-0ubuntu1) xenial; urgency=medium [ Scarlett Clark ] @@ -6,7 +231,7 @@ [ Philip Muškovac ] * New upstream release - -- Philip Muškovac Mon, 07 Mar 2016 23:19:20 +0100 + -- Philip Muškovac Wed, 06 Jan 2016 14:58:21 +0100 kcrash (5.16.0-1) unstable; urgency=medium diff -Nru kcrash-5.18.0/debian/control kcrash-5.44.0/debian/control --- kcrash-5.18.0/debian/control 2016-03-07 22:19:20.000000000 +0000 +++ kcrash-5.44.0/debian/control 2018-03-12 19:56:42.000000000 +0000 @@ -5,27 +5,27 @@ Uploaders: Maximiliano Curia Build-Depends: cmake (>= 2.8.12), debhelper (>= 9), - extra-cmake-modules (>= 5.18.0~), - libkf5coreaddons-dev (>= 5.18.0~), - libkf5windowsystem-dev (>= 5.18.0~), - libqt5x11extras5-dev (>= 5.4), + extra-cmake-modules (>= 5.44.0~), + libkf5coreaddons-dev (>= 5.44.0~), + libkf5windowsystem-dev (>= 5.44.0~), + libqt5x11extras5-dev (>= 5.6.1~), libx11-dev, pkg-kde-tools (>= 0.15.15ubuntu1~), - qtbase5-dev (>= 5.4), + qtbase5-dev (>= 5.6.1~), xauth, xvfb -Standards-Version: 3.9.6 +Standards-Version: 3.9.8 Homepage: https://projects.kde.org/projects/frameworks/kcrash -Vcs-Browser: http://anonscm.debian.org/cgit/pkg-kde/frameworks/kcrash.git -Vcs-Git: git://anonscm.debian.org/pkg-kde/frameworks/kcrash.git +Vcs-Browser: https://code.launchpad.net/~kubuntu-packagers/kubuntu-packaging/+git/kcrash +Vcs-Git: https://git.launchpad.net/~kubuntu-packagers/kubuntu-packaging/+git/kcrash Package: libkf5crash-dev -Section: libdevel Architecture: any -Depends: libkf5coreaddons-dev (>= 5.16.0~), +Section: libdevel +Depends: libkf5coreaddons-dev (>= 5.44.0~), libkf5crash5 (= ${binary:Version}), - libkf5windowsystem-dev (>= 5.16.0~), - qtbase5-dev (>= 5.4), + libkf5windowsystem-dev (>= 5.44.0~), + qtbase5-dev (>= 5.6.1~), ${misc:Depends} Description: Support for application crash analysis and bug report from apps KCrash provides support for intercepting and handling application crashes. @@ -34,18 +34,7 @@ Package: libkf5crash5 Architecture: any -Depends: ${misc:Depends}, ${shlibs:Depends} -Description: Support for application crash analysis and bug report from apps - KCrash provides support for intercepting and handling application crashes. -Multi-Arch: same - -Package: libkf5crash5-dbg -Priority: extra -Section: debug -Architecture: any Multi-Arch: same -Depends: libkf5crash5 (= ${binary:Version}), ${misc:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} Description: Support for application crash analysis and bug report from apps KCrash provides support for intercepting and handling application crashes. - . - Contains debug symbols for kcrash. diff -Nru kcrash-5.18.0/debian/libkf5crash5.install kcrash-5.44.0/debian/libkf5crash5.install --- kcrash-5.18.0/debian/libkf5crash5.install 2016-03-07 22:19:20.000000000 +0000 +++ kcrash-5.44.0/debian/libkf5crash5.install 2018-03-12 19:56:42.000000000 +0000 @@ -1,2 +1,3 @@ +etc/xdg/kcrash.categories usr/lib/*/libKF5Crash.so.5 usr/lib/*/libKF5Crash.so.5.* diff -Nru kcrash-5.18.0/debian/libkf5crash-dev.acc.in kcrash-5.44.0/debian/libkf5crash-dev.acc.in --- kcrash-5.18.0/debian/libkf5crash-dev.acc.in 2016-03-07 22:19:20.000000000 +0000 +++ kcrash-5.44.0/debian/libkf5crash-dev.acc.in 2018-03-12 19:56:42.000000000 +0000 @@ -1,4 +1,4 @@ - + @@ -15,6 +15,7 @@ -fPIC + -fno-keep-inline-functions - + \ No newline at end of file diff -Nru kcrash-5.18.0/debian/rules kcrash-5.44.0/debian/rules --- kcrash-5.18.0/debian/rules 2016-03-07 22:19:20.000000000 +0000 +++ kcrash-5.44.0/debian/rules 2018-03-12 19:56:42.000000000 +0000 @@ -4,7 +4,7 @@ include /usr/share/pkg-kde-tools/qt-kde-team/3/debian-qt-kde.mk override_dh_strip: - $(overridden_command) --dbg-package=libkf5crash5-dbg + $(overridden_command) --dbgsym-migration='libkf5crash5-dbg (<= 5.19.0-1~~)' override_dh_auto_test: # Disable dh_auto_test diff -Nru kcrash-5.18.0/debian/tests/acc kcrash-5.44.0/debian/tests/acc --- kcrash-5.18.0/debian/tests/acc 2016-03-07 22:19:20.000000000 +0000 +++ kcrash-5.44.0/debian/tests/acc 2018-03-12 19:56:42.000000000 +0000 @@ -8,4 +8,11 @@ "${in_file}" > "${out_file}" done +DH_VERBOSE=1 + dh_acc +ret=$? +if [ 0 -ne $ret ]; then + cp -r logs "${ADT_ARTIFACTS}"/acc.logs +fi +exit $ret diff -Nru kcrash-5.18.0/debian/tests/control kcrash-5.44.0/debian/tests/control --- kcrash-5.18.0/debian/tests/control 2016-03-07 22:19:20.000000000 +0000 +++ kcrash-5.44.0/debian/tests/control 2018-03-12 19:56:42.000000000 +0000 @@ -1,7 +1,7 @@ Tests: testsuite Depends: @builddeps@, build-essential, - xvfb, xauth, dbus-x11, openbox -Restrictions: rw-build-tree + xvfb, xauth, dbus (>= 1.8), openbox, libgl1-mesa-dri +Restrictions: build-needed Tests: acc Depends: @, dh-acc, exuberant-ctags diff -Nru kcrash-5.18.0/debian/tests/testsuite kcrash-5.44.0/debian/tests/testsuite --- kcrash-5.18.0/debian/tests/testsuite 2016-03-07 22:19:20.000000000 +0000 +++ kcrash-5.44.0/debian/tests/testsuite 2018-03-12 19:56:42.000000000 +0000 @@ -1,10 +1,4 @@ #!/bin/sh -if [ -d /usr/lib/ccache ]; then - export PATH="/usr/lib/ccache:$PATH" -fi -debian/rules clean 2>&1 -dpkg-source --before-build . -debian/rules build 2>&1 xvfb-run -a --server-args="-screen 0 1024x768x24+32" \ - dbus-launch --exit-with-session debian/tests/testsuite.xsession + dbus-run-session -- debian/tests/testsuite.xsession diff -Nru kcrash-5.18.0/debian/upstream/metadata kcrash-5.44.0/debian/upstream/metadata --- kcrash-5.18.0/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ kcrash-5.44.0/debian/upstream/metadata 2018-03-12 19:56:42.000000000 +0000 @@ -0,0 +1,7 @@ +Name: kcrash +Changelog: https://quickgit.kde.org/?p=kcrash.git&a=log +Contact: kde-frameworks-devel@kde.org +Donation: https://www.kde.org/community/donations/index.php +Repository: https://anongit.kde.org/kcrash.git +Repository-Browse: https://quickgit.kde.org/?p=kcrash.git +Security-Contact: security@kde.org diff -Nru kcrash-5.18.0/debian/watch kcrash-5.44.0/debian/watch --- kcrash-5.18.0/debian/watch 2016-03-07 22:19:20.000000000 +0000 +++ kcrash-5.44.0/debian/watch 2018-03-12 19:56:42.000000000 +0000 @@ -1,3 +1,2 @@ version=3 -http://download.kde.org/unstable/frameworks/([\d.]+)/kcrash-([\d.]+)\.tar\.xz http://download.kde.org/stable/frameworks/([\d.]+)/kcrash-([\d.]+)\.tar\.xz diff -Nru kcrash-5.18.0/kcrash.categories kcrash-5.44.0/kcrash.categories --- kcrash-5.18.0/kcrash.categories 1970-01-01 00:00:00.000000000 +0000 +++ kcrash-5.44.0/kcrash.categories 2018-03-03 09:52:04.000000000 +0000 @@ -0,0 +1,2 @@ +# Logging categories (for kdebugsettings) +org.kde.kcrash KCrash [INFO] diff -Nru kcrash-5.18.0/KF5CrashConfig.cmake.in kcrash-5.44.0/KF5CrashConfig.cmake.in --- kcrash-5.18.0/KF5CrashConfig.cmake.in 2016-01-01 19:52:07.000000000 +0000 +++ kcrash-5.44.0/KF5CrashConfig.cmake.in 2018-03-03 09:52:04.000000000 +0000 @@ -2,8 +2,9 @@ # Any changes in this file will be overwritten by CMake. +include(CMakeFindDependencyMacro) find_dependency(Qt5Core @REQUIRED_QT_VERSION@) include("${CMAKE_CURRENT_LIST_DIR}/KF5CrashTargets.cmake") - +@PACKAGE_INCLUDE_QCHTARGETS@ diff -Nru kcrash-5.18.0/metainfo.yaml kcrash-5.44.0/metainfo.yaml --- kcrash-5.18.0/metainfo.yaml 2016-01-01 19:52:07.000000000 +0000 +++ kcrash-5.44.0/metainfo.yaml 2018-03-03 09:52:04.000000000 +0000 @@ -4,6 +4,7 @@ type: integration platforms: - name: Linux + - name: FreeBSD - name: Windows portingAid: false deprecated: false @@ -12,3 +13,7 @@ - qmake: KCrash cmake: "KF5::Crash" cmakename: KF5Crash + +public_lib: true +group: Frameworks +subgroup: Tier 2 diff -Nru kcrash-5.18.0/.reviewboardrc kcrash-5.44.0/.reviewboardrc --- kcrash-5.18.0/.reviewboardrc 2016-01-01 19:52:07.000000000 +0000 +++ kcrash-5.44.0/.reviewboardrc 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -REVIEWBOARD_URL = "https://git.reviewboard.kde.org" -REPOSITORY = 'git://anongit.kde.org/kcrash' -BRANCH = 'master' -TARGET_GROUPS = 'kdeframeworks' diff -Nru kcrash-5.18.0/src/CMakeLists.txt kcrash-5.44.0/src/CMakeLists.txt --- kcrash-5.18.0/src/CMakeLists.txt 2016-01-01 19:52:07.000000000 +0000 +++ kcrash-5.44.0/src/CMakeLists.txt 2018-03-03 09:52:04.000000000 +0000 @@ -1,6 +1,7 @@ set(kcrash_SRCS kcrash.cpp + coreconfig.cpp ${kcrash_QM_LOADER} ) @@ -45,6 +46,28 @@ DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KCrash COMPONENT Devel ) +if(BUILD_QCH) + ecm_add_qch( + KF5Crash_QCH + NAME KCrash + BASE_NAME KF5Crash + VERSION ${KF5_VERSION} + ORG_DOMAIN org.kde + SOURCES # using only public headers, to cover only public API + ${KCrash_HEADERS} + MD_MAINPAGE "${CMAKE_SOURCE_DIR}/README.md" + LINK_QCHS + Qt5Core_QCH + BLANK_MACROS + KCRASH_EXPORT + KCRASH_DEPRECATED + KCRASH_DEPRECATED_EXPORT + TAGFILE_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR} + QCH_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR} + COMPONENT Devel + ) +endif() + include(ECMGeneratePriFile) ecm_generate_pri_file(BASE_NAME KCrash LIB_NAME KF5Crash DEPS "core" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/KCrash) install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) diff -Nru kcrash-5.18.0/src/config-kcrash.h.cmake kcrash-5.44.0/src/config-kcrash.h.cmake --- kcrash-5.18.0/src/config-kcrash.h.cmake 2016-01-01 19:52:07.000000000 +0000 +++ kcrash-5.44.0/src/config-kcrash.h.cmake 2018-03-03 09:52:04.000000000 +0000 @@ -1,4 +1,5 @@ #cmakedefine01 HAVE_X11 +#cmakedefine KCRASH_CORE_PATTERN_RAISE #define kde_socklen_t socklen_t #define CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}" diff -Nru kcrash-5.18.0/src/coreconfig.cpp kcrash-5.44.0/src/coreconfig.cpp --- kcrash-5.18.0/src/coreconfig.cpp 1970-01-01 00:00:00.000000000 +0000 +++ kcrash-5.44.0/src/coreconfig.cpp 2018-03-03 09:52:04.000000000 +0000 @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2016 Harald Sitter + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "coreconfig_p.h" + +#include + +#include + +namespace KCrash { + +CoreConfig::CoreConfig(const QString &path) + : m_supported(false) + , m_process(false) +{ +#ifndef KCRASH_CORE_PATTERN_RAISE + return; // Leave everything false unless enabled. +#endif + QFile file(path); + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { + return; + } + char first = 0; + if (!file.getChar(&first)) { + return; + } + m_supported = true; + m_process = first == '|'; +} + +bool CoreConfig::isProcess() const +{ + return m_supported && m_process; +} + +} // namespace KCrash diff -Nru kcrash-5.18.0/src/coreconfig_p.h kcrash-5.44.0/src/coreconfig_p.h --- kcrash-5.18.0/src/coreconfig_p.h 1970-01-01 00:00:00.000000000 +0000 +++ kcrash-5.44.0/src/coreconfig_p.h 2018-03-03 09:52:04.000000000 +0000 @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2016 Harald Sitter + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef KCRASH_CORECONFIG_H +#define KCRASH_CORECONFIG_H + +#include + +namespace KCrash { + +class CoreConfig +{ +public: + CoreConfig(const QString &path = QStringLiteral("/proc/sys/kernel/core_pattern")); + + bool isProcess() const; + +private: + bool m_supported; + bool m_process; +}; + +} // namespace KCrash + +#endif // KCRASH_CORECONFIG_H diff -Nru kcrash-5.18.0/src/kcrash.cpp kcrash-5.44.0/src/kcrash.cpp --- kcrash-5.18.0/src/kcrash.cpp 2016-01-01 19:52:07.000000000 +0000 +++ kcrash-5.44.0/src/kcrash.cpp 2018-03-03 09:52:04.000000000 +0000 @@ -57,12 +57,8 @@ #include Q_DECLARE_LOGGING_CATEGORY(LOG_KCRASH) -#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) -// logging category for this framework, default: log stuff >= warning -Q_LOGGING_CATEGORY(LOG_KCRASH, "org.kde.kcrash", QtWarningMsg) -#else -Q_LOGGING_CATEGORY(LOG_KCRASH, "org.kde.kcrash") -#endif +// logging category for this framework, default: log stuff >= info +Q_LOGGING_CATEGORY(LOG_KCRASH, "org.kde.kcrash", QtInfoMsg) #if HAVE_X11 #include @@ -79,6 +75,8 @@ #include #endif +#include "coreconfig_p.h" + // Copy from klauncher_cmds typedef struct { long cmd; @@ -94,17 +92,18 @@ void setApplicationFilePath(const QString &filePath); } -static KCrash::HandlerType s_emergencySaveFunction = 0; -static KCrash::HandlerType s_crashHandler = 0; -static char *s_appName = 0; -static char *s_autoRestartCommand = 0; -static char *s_appPath = 0; +static KCrash::HandlerType s_emergencySaveFunction = nullptr; +static KCrash::HandlerType s_crashHandler = nullptr; +static char *s_appName = nullptr; +static char *s_autoRestartCommand = nullptr; +static char *s_appPath = nullptr; static int s_autoRestartArgc = 0; -static char **s_autoRestartCommandLine = 0; -static char *s_drkonqiPath = 0; -static char *s_kdeinit_socket_file = 0; -static KCrash::CrashFlags s_flags = 0; +static char **s_autoRestartCommandLine = nullptr; +static char *s_drkonqiPath = nullptr; +static char *s_kdeinit_socket_file = nullptr; +static KCrash::CrashFlags s_flags = KCrash::CrashFlags(); static int s_launchDrKonqi = -1; // -1=initial value 0=disabled 1=enabled +Q_GLOBAL_STATIC(KCrash::CoreConfig, s_coreConfig) static void kcrashInitialize() { @@ -132,9 +131,13 @@ && !qEnvironmentVariableIsSet("KCRASH_AUTO_RESTARTED")) { // enable drkonqi KCrash::setDrKonqiEnabled(true); + } else { + qCDebug(LOG_KCRASH) << "KCrash disabled through environment."; } KCrash::setApplicationFilePath(QCoreApplication::applicationFilePath()); + + s_coreConfig(); // Initialize. } void @@ -218,7 +221,7 @@ for (int i = 0; i < args.count(); ++i) { s_autoRestartCommandLine[i] = qstrdup(QFile::encodeName(args.at(i)).constData()); } - s_autoRestartCommandLine[args.count()] = 0; + s_autoRestartCommandLine[args.count()] = nullptr; } void KCrash::setDrKonqiEnabled(bool enabled) @@ -255,42 +258,42 @@ return s_launchDrKonqi == 1; } -// The following function copy&pasted from kinit/wrapper.cpp : -static char *getDisplay() +// The following functions copy&pasted from kinit/wrapper.cpp : +// (which copied it from kdeinit/kinit.cpp) +// Can't use QGuiApplication::platformName() here, there is no app instance. +#if HAVE_X11 || HAVE_XCB +static const char* displayEnvVarName_c() { - const char *display; - char *result; - char *screen; - char *colon; - char *i; -#if defined(NO_DISPLAY) || defined(Q_OS_WIN) - display = "NODISPLAY"; -#else - display = getenv("DISPLAY"); + return "DISPLAY"; +} #endif - if (!display || !*display) { - display = ":0"; - } - result = (char *)malloc(strlen(display) + 1); - if (result == NULL) { - return NULL; - } - strcpy(result, display); - screen = strrchr(result, '.'); - colon = strrchr(result, ':'); - if (screen && (screen > colon)) { - *screen = '\0'; +// adapted from kdeinit/kinit.cpp +// WARNING, if you change the socket name, adjust kinit.cpp too +static const QString generate_socket_file_name() +{ + +#if HAVE_X11 || HAVE_XCB + QByteArray display = qgetenv(displayEnvVarName_c()); + if (display.isEmpty()) { + fprintf(stderr, "Error: could not determine $%s.\n", displayEnvVarName_c()); + return QString(); } - while ((i = strchr(result, ':'))) { - *i = '_'; + int i; + if ((i = display.lastIndexOf('.')) > display.lastIndexOf(':') && i >= 0) { + display.truncate(i); } + + display.replace(':', '_'); #ifdef __APPLE__ - while ((i = strchr(result, '/'))) { - *i = '_'; - } + display.replace('/', '_'); #endif - return result; +#else + // not using a DISPLAY variable; use an empty string instead + QByteArray display = ""; +#endif + const QString socketFileName = QString::fromLatin1("kdeinit5_%1").arg(QLatin1String(display)); + return socketFileName; } void @@ -298,9 +301,7 @@ { if (!s_kdeinit_socket_file) { // Prepare this now to avoid mallocs in the crash handler. - char *display = getDisplay(); - const QString socketFileName = QStringLiteral("kdeinit5_%1").arg(QLatin1String(display)); - free(display); + const QString socketFileName = generate_socket_file_name(); QByteArray socketName = QFile::encodeName(QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation) + QLatin1Char('/') + socketFileName); s_kdeinit_socket_file = qstrdup(socketName.constData()); @@ -344,7 +345,7 @@ sigaddset(&mask, SIGABRT); #endif - sigprocmask(SIG_UNBLOCK, &mask, 0); + sigprocmask(SIG_UNBLOCK, &mask, nullptr); #endif s_crashHandler = handler; @@ -356,7 +357,7 @@ return s_crashHandler; } -#ifndef Q_OS_WIN +#if !defined(Q_OS_WIN) && !defined(Q_OS_OSX) static void closeAllFDs() { @@ -397,7 +398,7 @@ crashRecursionCounter++; } -#if !defined(Q_OS_WIN) +#if !defined(Q_OS_WIN) && !defined(Q_OS_OSX) if (!(s_flags & KeepFDs)) { closeAllFDs(); } @@ -426,7 +427,7 @@ #endif if (s_launchDrKonqi != 1) { - setCrashHandler(0); + setCrashHandler(nullptr); #if !defined(Q_OS_WIN) raise(sig); // dump core, or whatever is the default action for this signal. #endif @@ -522,7 +523,7 @@ #endif // NULL terminated list - argv[i] = NULL; + argv[i] = nullptr; startProcess(i, argv, true); } @@ -531,6 +532,13 @@ fprintf(stderr, "Unable to start Dr. Konqi\n"); } + if (s_coreConfig->isProcess()) { + fprintf(stderr, "Re-raising signal for core dump handling.\n"); + KCrash::setCrashHandler(nullptr); + raise(sig); + // not getting here + } + _exit(255); } @@ -608,6 +616,7 @@ { bool startDirectly = true; +#ifndef Q_OS_OSX // First try to start the app via kdeinit, if the AlwaysDirectly flag hasn't been specified. // This is done because it is dangerous to use fork() in the crash handler // (there can be functions registered to be performed before fork(), for example handling @@ -615,6 +624,7 @@ if (!(s_flags & AlwaysDirectly)) { startDirectly = !startProcessInternal(argc, argv, waitAndExit, false); } +#endif // If we can't reach kdeinit, we can still at least try to fork() if (startDirectly) { @@ -636,7 +646,7 @@ // when launching drkonqi. Note that drkonqi will stop this process in the meantime. if (directly) { //if the process was started directly, use waitpid(), as it's a child... - while (waitpid(-1, NULL, 0) != pid) {} + while (waitpid(-1, nullptr, 0) != pid) {} } else { #ifdef Q_OS_LINUX // Declare the process that will be debugging the crashed KDE app (#245529) @@ -650,7 +660,10 @@ sleep(1); } } - _exit(253); + if (!s_coreConfig->isProcess()) { + // Only exit if we don't forward to core dumps + _exit(253); + } } return (pid > 0); //return true on success @@ -723,11 +736,13 @@ fprintf(stderr, "KCrash failed to fork(), errno = %d\n", errno); return 0; case 0: - setgroups(0, 0); // Remove any extraneous groups + setgroups(0, nullptr); // Remove any extraneous groups if (setgid(getgid()) < 0 || setuid(getuid()) < 0) { _exit(253); // This cannot happen. Theoretically. } +#ifndef Q_OS_OSX closeAllFDs(); // We are in the child now. Close FDs unconditionally. +#endif setenv("KCRASH_AUTO_RESTARTED", "1", 1); execvp(argv[0], const_cast< char ** >(argv)); fprintf(stderr, "KCrash failed to exec(), errno = %d\n", errno); @@ -784,6 +799,13 @@ static int openSocket() { struct sockaddr_un server; + if (!s_kdeinit_socket_file || + strlen(s_kdeinit_socket_file) > (sizeof(server.sun_path) - 1)) + { + fprintf(stderr, "kcrash: Unable to communicate with kdeinit5, socket name is %s!", + (s_kdeinit_socket_file) ? "too long" : "undefined"); + return -1; + } /* * create the socket stream diff -Nru kcrash-5.18.0/src/kcrash.h kcrash-5.44.0/src/kcrash.h --- kcrash-5.18.0/src/kcrash.h 2016-01-01 19:52:07.000000000 +0000 +++ kcrash-5.44.0/src/kcrash.h 2018-03-03 09:52:04.000000000 +0000 @@ -53,8 +53,7 @@ * * This does nothing if $KDE_DEBUG is set. * - * You can call this in your main(). Note that the platform plugin - * does this too, so on a full KF5 installation this happens automatically. + * Call this in your main() to ensure that the crash handler is always launched. * @since 5.15 */ KCRASH_EXPORT void initialize(); @@ -107,7 +106,7 @@ * is installed to ensure the save function will be called. * @param saveFunction the handler to install */ -KCRASH_EXPORT void setEmergencySaveFunction(HandlerType saveFunction = 0); +KCRASH_EXPORT void setEmergencySaveFunction(HandlerType saveFunction = nullptr); /** * Returns the currently set emergency save function.