Hello community,

here is the log from the commit of package kcrash for openSUSE:Leap:15.2 
checked in at 2020-06-17 11:35:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/kcrash (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.kcrash.new.3606 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kcrash"

Wed Jun 17 11:35:09 2020 rev:64 rq:814428 version:5.71.0

Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/kcrash/kcrash.changes  2020-05-12 
11:38:55.324566358 +0200
+++ /work/SRC/openSUSE:Leap:15.2/.kcrash.new.3606/kcrash.changes        
2020-06-17 11:36:21.643855087 +0200
@@ -1,0 +2,12 @@
+Sun Jun  7 08:06:27 UTC 2020 - Christophe Giboudeaux <[email protected]>
+
+- Update to 5.71.0
+  * New feature release
+  * For more details please see:
+  * https://kde.org/announcements/kde-frameworks-5.71.0
+- Changes since 5.70.0:
+  * Don't invoke qstring localized stuff in critical section
+  * KCrash: remove debug output which breaks unittests
+    from using ~/.qttest/config for categorized logging
+
+-------------------------------------------------------------------

Old:
----
  kcrash-5.70.0.tar.xz
  kcrash-5.70.0.tar.xz.sig

New:
----
  kcrash-5.71.0.tar.xz
  kcrash-5.71.0.tar.xz.sig

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kcrash.spec ++++++
--- /var/tmp/diff_new_pack.iqDfzh/_old  2020-06-17 11:36:22.015856191 +0200
+++ /var/tmp/diff_new_pack.iqDfzh/_new  2020-06-17 11:36:22.015856191 +0200
@@ -17,7 +17,7 @@
 
 
 %define lname   libKF5Crash5
-%define _tar_path 5.70
+%define _tar_path 5.71
 # Full KF5 version (e.g. 5.33.0)
 %{!?_kf5_version: %global _kf5_version %{version}}
 # Last major and minor KF5 version (e.g. 5.33)
@@ -25,7 +25,7 @@
 # Only needed for the package signature condition
 %bcond_without lang
 Name:           kcrash
-Version:        5.70.0
+Version:        5.71.0
 Release:        0
 Summary:        An application crash handler
 License:        LGPL-2.1-or-later


++++++ kcrash-5.70.0.tar.xz -> kcrash-5.71.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcrash-5.70.0/.arcconfig new/kcrash-5.71.0/.arcconfig
--- old/kcrash-5.70.0/.arcconfig        2020-05-02 23:56:31.000000000 +0200
+++ new/kcrash-5.71.0/.arcconfig        1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-{
-  "phabricator.uri" : "https://phabricator.kde.org/";
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcrash-5.70.0/CMakeLists.txt 
new/kcrash-5.71.0/CMakeLists.txt
--- old/kcrash-5.70.0/CMakeLists.txt    2020-05-02 23:56:31.000000000 +0200
+++ new/kcrash-5.71.0/CMakeLists.txt    2020-06-07 11:24:34.000000000 +0200
@@ -1,11 +1,11 @@
 cmake_minimum_required(VERSION 3.5)
 
-set(KF5_VERSION "5.70.0") # handled by release scripts
-set(KF5_DEP_VERSION "5.70.0") # handled by release scripts
+set(KF5_VERSION "5.71.0") # handled by release scripts
+set(KF5_DEP_VERSION "5.71.0") # handled by release scripts
 project(KCrash VERSION ${KF5_VERSION})
 
 include(FeatureSummary)
-find_package(ECM 5.70.0  NO_MODULE)
+find_package(ECM 5.71.0  NO_MODULE)
 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake 
Modules." URL "https://commits.kde.org/extra-cmake-modules";)
 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND 
FATAL_ON_MISSING_REQUIRED_PACKAGES)
 
@@ -57,7 +57,7 @@
 
 
 add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00)
-add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054400)
+add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054700)
 add_definitions(-DQT_NO_FOREACH)
 add_subdirectory(src)
 if (BUILD_TESTING)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcrash-5.70.0/src/kcrash.cpp 
new/kcrash-5.71.0/src/kcrash.cpp
--- old/kcrash-5.70.0/src/kcrash.cpp    2020-05-02 23:56:31.000000000 +0200
+++ new/kcrash-5.71.0/src/kcrash.cpp    2020-06-07 11:24:34.000000000 +0200
@@ -47,6 +47,9 @@
 #include <kaboutdata.h>
 #include <kstartupinfo.h>
 
+#include <array>
+#include <algorithm>
+
 #include <QDebug>
 #include <QGuiApplication>
 #include <QStandardPaths>
@@ -90,7 +93,11 @@
 {
 KCRASH_EXPORT bool loadedByKdeinit = false;
 void setApplicationFilePath(const QString &filePath);
+        // Create socket path to transfer ptrace scope and open connection
 }
+#ifdef Q_OS_LINUX
+static QByteArray s_socketpath;
+#endif
 
 static KCrash::HandlerType s_emergencySaveFunction = nullptr;
 static KCrash::HandlerType s_crashHandler = nullptr;
@@ -98,7 +105,7 @@
 static char *s_autoRestartCommand = nullptr;
 static char *s_appPath = nullptr;
 static int s_autoRestartArgc = 0;
-static char **s_autoRestartCommandLine = nullptr;
+static char **s_autoRestartCommandLine = new char*[1]{ nullptr };
 static char *s_drkonqiPath = nullptr;
 static KCrash::CrashFlags s_flags = KCrash::CrashFlags();
 static int s_launchDrKonqi = -1; // -1=initial value 0=disabled 1=enabled
@@ -167,7 +174,8 @@
         // enable drkonqi
         KCrash::setDrKonqiEnabled(true);
     } else {
-        qCDebug(LOG_KCRASH) << "KCrash disabled through environment.";
+        // This loads qtlogging.ini very early which prevents unittests from 
doing QStandardPaths::setTestModeEnabled(true) in initTestCase()
+        //qCDebug(LOG_KCRASH) << "KCrash disabled through environment.";
     }
 
     if (QCoreApplication::instance()) {
@@ -176,6 +184,13 @@
         qWarning() << "This process needs a QCoreApplication instance in order 
to use KCrash";
     }
 
+#ifdef Q_OS_LINUX
+    // Create socket path to transfer ptrace scope and open connection
+    s_socketpath = QFile::encodeName(
+            
QStringLiteral("%1/kcrash_%2").arg(QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation))
+                                          .arg(getpid()));
+#endif
+
     s_coreConfig(); // Initialize.
 }
 
@@ -253,16 +268,22 @@
     s_autoRestartCommand = qstrdup(QFile::encodeName(filePath).constData());
 
     QStringList args = QCoreApplication::arguments();
-    if (!args.isEmpty()) { // edge case: tst_QX11Info::startupId does 
QApplication app(argc, nullptr)...
+    if (args.isEmpty()) { // edge case: tst_QX11Info::startupId does 
QApplication app(argc, nullptr)...
+        args.append(filePath);
+    } else {
         args[0] = filePath; // replace argv[0] with full path above
-        delete[] s_autoRestartCommandLine;
-        s_autoRestartArgc = args.count();
-        s_autoRestartCommandLine = new char *[args.count() + 1];
-        for (int i = 0; i < args.count(); ++i) {
-            s_autoRestartCommandLine[i] = 
qstrdup(QFile::encodeName(args.at(i)).constData());
-        }
-        s_autoRestartCommandLine[args.count()] = nullptr;
     }
+    for (int arg = 0; arg < s_autoRestartArgc; arg++) {
+        delete [] s_autoRestartCommandLine[arg];
+    }
+
+    delete[] s_autoRestartCommandLine;
+    s_autoRestartArgc = args.count();
+    s_autoRestartCommandLine = new char *[args.count() + 1];
+    for (int i = 0; i < args.count(); ++i) {
+        s_autoRestartCommandLine[i] = 
qstrdup(QFile::encodeName(args.at(i)).constData());
+    }
+    s_autoRestartCommandLine[args.count()] = nullptr;
 }
 
 void KCrash::setDrKonqiEnabled(bool enabled)
@@ -647,18 +668,14 @@
 #endif
         prctl(PR_SET_PTRACER, pid, 0, 0, 0);
 
-        // Create socket path to transfer ptrace scope and open connection
-        const QByteArray socketpath = QFile::encodeName(
-            
QStringLiteral("%1/kcrash_%2").arg(QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation))
-                                          .arg(getpid()));
-        int sockfd = openDrKonqiSocket(socketpath);
+        int sockfd = openDrKonqiSocket(s_socketpath);
 
         if (sockfd >= 0) {
             // Wait while DrKonqi is running and the socket connection exists
             // If the process was started directly, use waitpid(), as it's a 
child...
             while ((running = waitpid(pid, nullptr, WNOHANG) != pid) && 
pollDrKonqiSocket(pid, sockfd) >= 0) {}
             close(sockfd);
-            unlink(socketpath.constData());
+            unlink(s_socketpath.constData());
         }
 #endif
         if (running) {
@@ -674,6 +691,21 @@
 
 static pid_t startDirectly(const char *argv[])
 {
+    char** environ_end;
+    for(environ_end = environ; *environ_end; ++environ_end) {}
+
+    std::array<const char*, 1024> environ_data; //hope it's big enough
+    if((unsigned)(environ_end - environ) +2 >= environ_data.size()) {
+        fprintf(stderr, "environ_data in KCrash not big enough!\n");
+        return 0;
+    }
+    auto end = std::copy_if(environ, environ_end, environ_data.begin(),
+                            [](const char* s) {
+                              static const char envvar[] = 
"KCRASH_AUTO_RESTARTED=";
+                              return strncmp(envvar, s, sizeof(envvar)-1) != 0;
+                            });
+    *end++ = "KCRASH_AUTO_RESTARTED=1";
+    *end++ = nullptr;
     pid_t pid = fork();
     switch (pid) {
     case -1:
@@ -687,8 +719,7 @@
 #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));
+        execvpe(argv[0], const_cast< char ** >(argv), const_cast<char**> 
(environ_data.data()));
         fprintf(stderr, "KCrash failed to exec(), errno = %d\n", errno);
         _exit(253);
     default:


Reply via email to