Hello community, here is the log from the commit of package kcrash for openSUSE:Factory checked in at 2015-10-19 22:23:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kcrash (Old) and /work/SRC/openSUSE:Factory/.kcrash.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kcrash" Changes: -------- --- /work/SRC/openSUSE:Factory/kcrash/kcrash.changes 2015-09-24 07:10:35.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.kcrash.new/kcrash.changes 2015-10-19 22:23:25.000000000 +0200 @@ -1,0 +2,12 @@ +Mon Oct 5 17:37:07 UTC 2015 - hrvoje.sen...@gmail.com + +- Update to 5.15.0 + * KCrash: pass cwd to kdeinit when auto-restarting the app via + kdeinit. (kde#337760) + * Add KCrash::initialize() so that apps and the platform plugin + can explicitly enable KCrash. + * Disable ASAN if enabled + * For more details please see: + https://www.kde.org/announcements/kde-frameworks-5.15.0.php + +------------------------------------------------------------------- Old: ---- kcrash-5.14.0.tar.xz New: ---- kcrash-5.15.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kcrash.spec ++++++ --- /var/tmp/diff_new_pack.0X4TQn/_old 2015-10-19 22:23:26.000000000 +0200 +++ /var/tmp/diff_new_pack.0X4TQn/_new 2015-10-19 22:23:26.000000000 +0200 @@ -17,9 +17,9 @@ %define lname libKF5Crash5 -%define _tar_path 5.14 +%define _tar_path 5.15 Name: kcrash -Version: 5.14.0 +Version: 5.15.0 Release: 0 %define kf5_version %{version} BuildRequires: cmake >= 2.8.12 ++++++ kcrash-5.14.0.tar.xz -> kcrash-5.15.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcrash-5.14.0/CMakeLists.txt new/kcrash-5.15.0/CMakeLists.txt --- old/kcrash-5.14.0/CMakeLists.txt 2015-09-04 22:08:26.000000000 +0200 +++ new/kcrash-5.15.0/CMakeLists.txt 2015-10-03 22:27:03.000000000 +0200 @@ -3,7 +3,7 @@ project(KCrash) include(FeatureSummary) -find_package(ECM 5.14.0 NO_MODULE) +find_package(ECM 5.15.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) @@ -26,8 +26,8 @@ include(ECMSetupVersion) include(ECMGenerateHeaders) -set(KF5_VERSION "5.14.0") # handled by release scripts -set(KF5_DEP_VERSION "5.14.0") # handled by release scripts +set(KF5_VERSION "5.15.0") # handled by release scripts +set(KF5_DEP_VERSION "5.15.0") # handled by release scripts ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KCrash VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kcrash_version.h" PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5CrashConfigVersion.cmake" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcrash-5.14.0/autotests/kcrashtest.cpp new/kcrash-5.15.0/autotests/kcrashtest.cpp --- old/kcrash-5.14.0/autotests/kcrashtest.cpp 2015-09-04 22:08:26.000000000 +0200 +++ new/kcrash-5.15.0/autotests/kcrashtest.cpp 2015-10-03 22:27:03.000000000 +0200 @@ -26,10 +26,11 @@ class KCrashTest : public QObject { Q_OBJECT -public: - KCrashTest() {} - private Q_SLOTS: + void initTestCase() { + // Don't bring up drkonqi + qputenv("KDE_DEBUG", "1"); + } void testAutoRestart(); void testEmergencySave(); @@ -60,6 +61,9 @@ processName = "./test_crasher"; #endif //qDebug() << proc.args(); + QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); + env.insert("ASAN_OPTIONS", "handle_segv=0,poison_heap=0"); // Disable ASAN + proc.setProcessEnvironment(env); proc.start(processName, QStringList() << flag); bool ok = proc.waitForFinished(); QVERIFY(ok); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcrash-5.14.0/src/kcrash.cpp new/kcrash-5.15.0/src/kcrash.cpp --- old/kcrash-5.14.0/src/kcrash.cpp 2015-09-04 22:08:26.000000000 +0200 +++ new/kcrash-5.15.0/src/kcrash.cpp 2015-10-03 22:27:03.000000000 +0200 @@ -97,17 +97,7 @@ static void kcrashInitialize() { - if (s_launchDrKonqi == 0) { // disabled by the program itself - return; - } - const QStringList args = QCoreApplication::arguments(); - if (qgetenv("KDE_DEBUG").isEmpty() - && qgetenv("KCRASH_AUTO_RESTARTED").isEmpty()) { - // enable drkonqi - KCrash::setDrKonqiEnabled(true); - } - - KCrash::setApplicationFilePath(QCoreApplication::applicationFilePath()); + KCrash::initialize(); } Q_COREAPP_STARTUP_FUNCTION(kcrashInitialize) @@ -121,6 +111,21 @@ #endif } +void KCrash::initialize() +{ + if (s_launchDrKonqi == 0) { // disabled by the program itself + return; + } + const QStringList args = QCoreApplication::arguments(); + if (!qEnvironmentVariableIsSet("KDE_DEBUG") + && !qEnvironmentVariableIsSet("KCRASH_AUTO_RESTARTED")) { + // enable drkonqi + KCrash::setDrKonqiEnabled(true); + } + + KCrash::setApplicationFilePath(QCoreApplication::applicationFilePath()); +} + void KCrash::setEmergencySaveFunction(HandlerType saveFunction) { @@ -172,7 +177,7 @@ if (s_flags & AutoRestart) { // We need at least the default crash handler for autorestart to work. if (!s_crashHandler) { - if (!qgetenv("KCRASH_AUTO_RESTARTED").isEmpty()) { + if (qEnvironmentVariableIsSet("KCRASH_AUTO_RESTARTED")) { new KCrashDelaySetHandler; } else { setCrashHandler(defaultCrashHandler); @@ -207,7 +212,11 @@ void KCrash::setDrKonqiEnabled(bool enabled) { - s_launchDrKonqi = enabled ? 1 : 0; + const int launchDrKonqi = enabled ? 1 : 0; + if (s_launchDrKonqi == launchDrKonqi) { + return; + } + s_launchDrKonqi = launchDrKonqi; if (s_launchDrKonqi && !s_drkonqiPath) { const QList<QString> paths = QFile::decodeName(qgetenv("LIBEXEC_PATH")).split(QLatin1Char(':')); const QString exec = QStandardPaths::findExecutable(QLatin1String("drkonqi"), paths); @@ -643,7 +652,8 @@ kcrash_launcher_header header; header.cmd = LAUNCHER_EXEC_NEW; const int BUFSIZE = 8192; // make sure this is big enough - char buffer[ BUFSIZE + 10 + 24 /*the env var*/ ]; + const int CWDSIZE = 2000; + char buffer[ BUFSIZE + 10 + 24 /*the env var*/ + CWDSIZE+1 ]; int pos = 0; long argcl = argc; memcpy(buffer + pos, &argcl, sizeof(argcl)); @@ -671,9 +681,18 @@ long avoid_loops = 0; memcpy(buffer + pos, &avoid_loops, sizeof(avoid_loops)); pos += sizeof(avoid_loops); + + char cwd[CWDSIZE]; + if (getcwd(cwd, CWDSIZE-1)) { + len = strlen(cwd) + 1; // include terminating \0 + memcpy(buffer + pos, cwd, len); + pos += len; + } + header.arg_length = pos; write_socket(socket, (char *) &header, sizeof(header)); write_socket(socket, buffer, pos); + if (read_socket(socket, (char *) &header, sizeof(header)) < 0 || header.cmd != LAUNCHER_OK) { return 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kcrash-5.14.0/src/kcrash.h new/kcrash-5.15.0/src/kcrash.h --- old/kcrash-5.14.0/src/kcrash.h 2015-09-04 22:08:26.000000000 +0200 +++ new/kcrash-5.15.0/src/kcrash.h 2015-10-03 22:27:03.000000000 +0200 @@ -47,6 +47,18 @@ */ namespace KCrash { + +/** + * Initialize KCrash. + * + * 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. + * @since 5.15 + */ +KCRASH_EXPORT void initialize(); + /** * The default crash handler. * Do not call this function directly. Instead, use