https://bugs.kde.org/show_bug.cgi?id=403644

            Bug ID: 403644
           Summary: kdev-cmake : commit
                    7a16881ec33f4af2028593c2b3da7c1e20bf53c6 breaks
                    fallback to non-server mode
           Product: kdevelop
           Version: 5.3.1
          Platform: Compiled Sources
                OS: OS X
            Status: REPORTED
          Severity: crash
          Priority: NOR
         Component: Build tools: CMake
          Assignee: kdevelop-bugs-n...@kde.org
          Reporter: rjvber...@gmail.com
  Target Milestone: ---

Created attachment 117668
  --> https://bugs.kde.org/attachment.cgi?id=117668&action=edit
backtrace

SUMMARY
Commit 7a16881ec33f4af2028593c2b3da7c1e20bf53c6 seems to break the cmake
project import fallback to non-server mode.

STEPS TO REPRODUCE
1. configure a project that uses an older cmake version (e.g. 3.0.1). This will
be detected by the importer which will then fall back to using legacy import
mode.
2. close the session
3. restart KDevelop with that session

OBSERVED RESULT
KDevelop crashes very early in the import process. The crash is deep in Qt,
usually under KJob::exec() but not always. QMetaObject::activate() attempts to
access an invalid QObject ("sender"). This reeks of a missing initialisation.

EXPECTED RESULT
No crashing. Reverting the incriminated commit restores that expectation.

SOFTWARE/OS VERSIONS
Windows: 
MacOS: 10.9.5
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 5.52.0
Qt Version: 5.9.7

ADDITIONAL INFORMATION

Starting KDevelop with a session that does not contain CMake projects is still
possible, and one can then import CMake-based projects into the running
session.

Import also completes successfully if one clears the cache directory first.

Note : I use the legacy mode for large projects esp. when on a slower machine,
via a cmake wrapper that pretends to be an older version that lacks server
mode. Legacy mode is some 4-5x faster.
This kind of wrapper is easy to write:

```
#!/bin/sh

if [ "${1}" = "-E" - a "$2" = "server" -a "`basename $0`" = "cmake_noserver" ]
;then
    # emulate the error message from an older CMake version
    (   echo "CMake Error: cmake version 3.0.1 (faked to avoid server mode)"
        echo "Usage: ${PREFIX}/bin/cmake -E [command] [arguments ...]"
    ) 1>&2
    exit 1
fi

exec /usr/bin/cmake "$@"
```

I will check tomorrow if this happens on Linux too.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to