https://bugs.kde.org/show_bug.cgi?id=403644
RJVB changed:
What|Removed |Added
Assignee|kdevelop-bugs-n...@kde.org |rjvber...@gmail.com
--- Comment #1 from RJVB ---
1). Doesn't happen on Linux
2) I think I have identified the stale QObject instance. It seems to be
CMakeServer::m_process .
Here's a fresh bit of backtrace:
```
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS
(code=EXC_I386_GPFLT)
frame #0: 0x0001096d7ad4
QtQml`QQmlData::isSignalConnected(d=0xe4c1490467634d38,
(null)=0x078b480774ff8548, index=) at qqmlengine.cpp:869 [opt]
frame #1: 0x00010ba4f6aa QtCore`QMetaObject::activate(QObject*, int,
int, void**) [inlined]
QObjectPrivate::isDeclarativeSignalConnected(signal_index=) const
at qobject_p.h:266 [opt]
* frame #2: 0x00010ba4f68c
QtCore`QMetaObject::activate(sender=0x7f9c465272c0,
signalOffset=, local_signal_index=,
argv=0x7fff585b0a90) at qobject.cpp:3647 [opt]
frame #3: 0x00010b9a8772 QtCore`QProcessPrivate::_q_processDied()
[inlined] QProcess::finished(_t1=1, _t1=, _t2=NormalExit,
_t2=) at moc_qprocess.cpp:334 [opt]
frame #4: 0x00010b9a8746
QtCore`QProcessPrivate::_q_processDied(this=0x7f9c46527ac0) at
qprocess.cpp:1181 [opt]
```
and here is the corresponding terminal output after adding a few trace qWarning
calls to cmakemanager.cpp and cmakeserver.cpp:
```
kdevplatform.serialization: version mismatch or no version hint; expected
version: 84082945
kdevplatform.serialization: "The data-repository at
/Users/bertin/.cache/kdevduchain/kdevelop-{b9a8d6dc-6d10-4bc1-955f-831c48d4ae34}
has to be cleared."
kdevplatform.shell: Starting project import timer
CMakeServer::CMakeServer(KDevelop::IProject *) cmake server process:
QProcess(0x7f9c465272c0)
virtual void ChooseCMakeInterfaceJob::start() CMakeServer:
CMakeServer(0x7f9c465272a0)
CMake Error: cmake version 3.0.1 (faked to avoid server mode)
Usage: /opt/local/bin/cmake -E [command] [arguments ...]
void ChooseCMakeInterfaceJob::failedConnection(int) disconnecting
CMakeServer(0x7f9c465272a0)
virtual CMakeServer::~CMakeServer() CMakeServer(0x7f9c465272a0)
QProcess(0x7f9c465272c0)
kdevelop.plugins.cmake: CMake server not available, using compile_commands.json
to import "lzvn (MP)"
```
The error here appears to be deleting the QProcess for cmake before that
process has had a chance to terminate on its own. Killing a cmake subprocess
has always been more likely to crash on Mac than on Linux, IIRC.
Here, there are 2 lines in ChooseCMakeInterfaceJob::failedConnection() that
have been carried over from the pre-QSharedPointer implementation which lead to
deleting the CMakeServer:
1) server->deleteLater(), which is apparently executed immediately here (the
cmake server availability warning is printed just after the server instance
reset)
2) server = nullptr, which deletes the QSharedPointer's pointer if not shared
Deleting both lines resolve the crash, and as mentioned in the 7a16881 commit
message, "QSharedPointer will try to delete it [the CMakeServer instance]
eventually".
If there are no objections I will push the fix soon (say by tomorrow).
--
You are receiving this mail because:
You are watching all bug changes.