<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/118238/">https://git.reviewboard.kde.org/r/118238/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On May 22nd, 2014, 11:34 a.m. UTC, <b>Sven Brauch</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I don't have an immediate idea, but can you try to set a breakpoint to where this message is printed? The backtrace from there should tell you what deletes the context. It feels like a bug in the JSON tests.
Also, can you put the whole (although non-working) patch here? ;)
Greetings!</pre>
</blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Here is the backtrace of where KDevelop prints the message (sorry for the long filenames, I develop on an external HDD and its UUID is quite long) :
#0 KDevelop::DUChainPrivate::removeDocumentChainFromMemory (this=this@entry=0x1042c30, context=0x7fffd0005110)
at /run/media/steckdenis/22bf9818-cf8f-40f9-948d-9ab473a158c2/kdevplatform/language/duchain/duchain.cpp:391
#1 0x00007ffff72e7b43 in KDevelop::DUChainPrivate::clear (this=0x1042c30)
at /run/media/steckdenis/22bf9818-cf8f-40f9-948d-9ab473a158c2/kdevplatform/language/duchain/duchain.cpp:372
#2 0x00007ffff72d1fda in KDevelop::DUChain::shutdown (this=0x1045720)
at /run/media/steckdenis/22bf9818-cf8f-40f9-948d-9ab473a158c2/kdevplatform/language/duchain/duchain.cpp:1586
#3 0x00007ffff714179b in KDevelop::Core::cleanup (this=0x579140) at /run/media/steckdenis/22bf9818-cf8f-40f9-948d-9ab473a158c2/kdevplatform/shell/core.cpp:416
#4 0x00007ffff71417c6 in KDevelop::Core::shutdown (this=0x579140) at /run/media/steckdenis/22bf9818-cf8f-40f9-948d-9ab473a158c2/kdevplatform/shell/core.cpp:377
#5 0x00007ffff7856ed8 in QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const () from /usr/lib64/libQtCore.so.4
#6 0x00007ffff7bc00ae in ?? () from /usr/lib64/libQtTest.so.4
#7 0x00007ffff7bc3c4e in QTest::qExec(QObject*, int, char**) () from /usr/lib64/libQtTest.so.4
#8 0x0000000000409b64 in main (argc=1, argv=0x7fffffffd928) at /run/media/steckdenis/22bf9818-cf8f-40f9-948d-9ab473a158c2/kdev-qmljs/tests/test_files.cpp:44
By looking at KDevelop::Core, I guess that the signal that is launched by QMetaMethod is QApplication::aboutToQuit. Note that TestFiles::cleanupTestCase (containing a call to TestCore::shutdown) has not yet been called when the message is printed, and is not called either before the crash.</pre>
<br />
<p>- Denis</p>
<br />
<p>On May 21st, 2014, 2:40 p.m. UTC, Denis Steckelmacher wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for KDevelop.</div>
<div>By Denis Steckelmacher.</div>
<p style="color: grey;"><i>Updated May 21, 2014, 2:40 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kdev-qmljs
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This patch adds a method that returns the top-level DUContext associated with a QML plugin. It uses KStandardDirs to get the plugin.qmltypes file associated with the module (these files are installed by the plugin in KDE_DATA/kdevqmljssupport/qmlplugins/Module.qml), and then schedules a parse job for the file. If the file has already been parsed, then its top level context is returned. This method will be used to implement import statements. The module files and the complete support for import statements can be found in the "import_statements" of kde:scratch/dsteckelmacher.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This patch cannot be tested as the method is not yet called, but the support for import statements is already implemented in my kde:scratch/dsteckelmacher repository. Import statements work right in KDevelop, but the unit tests segfault when they have to parse a file containing an import. The crash always happens in an openDeclaration() or currentDeclaration() call, and if I comment the faulting call, another one will crash. The crash does not happen anymore if I remove the calls to "bgparser->addDocument" added in this patch, and does not happen in a complete KDevelop instance.
I'm therefore wondering how the background parser can interact with openDeclaration(). I've checked and a DUChainReadLock or a DUChainWriteLock is always held when openDeclaration() is called, but maybe there are other locks that may be needed. I turn to more advanced KDevelop developers on this matter.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>duchain/parsesession.h <span style="color: grey">(0facef4)</span></li>
<li>duchain/parsesession.cpp <span style="color: grey">(998e5b0)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/118238/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>