Bug 369573 - kdevelop consumes all available memory when editing js file [QmlJS::NodeJS::moduleDirectories]
Summary: kdevelop consumes all available memory when editing js file [QmlJS::NodeJS::m...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: QML/JavaScript (show other bugs)
Version: 5.0.0
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
: 367893 377973 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-09-30 14:47 UTC by Fabian
Modified: 2017-05-30 14:14 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.1.2


Attachments
Backtrace when kdevelop starts to consume all memory (21.68 KB, text/plain)
2016-09-30 14:47 UTC, Fabian
Details
js file (37.35 KB, text/javascript)
2016-10-10 07:59 UTC, Fabian
Details
Heaptrack of KDevelop with remote JS file (21 bytes, text/plain)
2017-05-24 10:00 UTC, Martin Riethmayer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian 2016-09-30 14:47:21 UTC
Created attachment 101362 [details]
Backtrace when kdevelop starts to consume all memory

When editing a larger js file, kdevelop starts to consume all available memory very rapidly (like 1 Gb / sec) until it is killed (SIGKILL) by the system.
Comment 1 Kevin Funk 2016-09-30 15:11:53 UTC
Can you disclose that JS file so we can attempt to reproduce the issue?
Comment 2 Fabian 2016-10-10 07:59:12 UTC
Created attachment 101500 [details]
js file

To reproduce, edit function browse() in line 812.
Comment 3 Fabian 2016-10-10 08:00:08 UTC
Triyed it again with Kdevelop 5.0.1 , still crashing.
Comment 4 Sven Brauch 2016-10-10 23:05:32 UTC
I removed the "larger" from the title; whatever the problem is, it is not that the file is so large, that file is only ~1000 lines, which is very small.

Unfortunately I cannot reproduce your crash, what do you edit exactly?

Also, what language is this? It's not plain JavaScript, and KDevelop's JS parser immediately chokes on it ...
Comment 5 Fabian 2016-10-11 06:24:31 UTC
It seems to only happen if I open the file with sftp. If I open the same file from the local hard disk, I can not reproduce the crash.

It is plain javascript es6 standard.
Comment 6 Sven Brauch 2016-10-15 12:34:19 UTC

*** This bug has been marked as a duplicate of bug 369182 ***
Comment 7 Kevin Funk 2017-03-07 15:10:28 UTC
This is not a duplicate of bug 36912
Comment 8 Kevin Funk 2017-03-07 15:11:52 UTC
@Fabian: So the interesting thing is that this JS file is on a remote file system, correct?
Comment 9 Fabian 2017-03-07 15:14:49 UTC
Yes, it happens when editing on a remote file system.
Comment 10 Francis Herne 2017-03-23 13:49:05 UTC
*** Bug 377973 has been marked as a duplicate of this bug. ***
Comment 11 pyrkosz 2017-05-24 09:00:49 UTC
I have same problem - opening js file from KIO sftp makes KDevelop use all available memory and then crash. Opening from local file system works correctly.

KDevelop 5.0.4 on KDE 5.33.0 / Qt 5.7.1 / Kubuntu 17.04 with KDE backports.
Comment 12 Martin Riethmayer 2017-05-24 09:07:57 UTC
*** Bug 367893 has been marked as a duplicate of this bug. ***
Comment 13 pyrkosz 2017-05-24 09:23:07 UTC
After upgrading to 5.1.0 (4:5.1.0-0ubuntu1~ubuntu17.04~ppa2) from PPA problem still exists.
Comment 14 Martin Riethmayer 2017-05-24 10:00:04 UTC
Created attachment 105695 [details]
Heaptrack of KDevelop with remote JS file

As requested by Milian Wolff on https://bugs.kde.org/show_bug.cgi?id=367893 I've added a heaptrack. Hope this helps?

This is a very small JS file, it seems the background parser seems to run wild again after clicking here and there.
Comment 15 Milian Wolff 2017-05-24 12:10:43 UTC
Thanks, can you install debug information for kdevelop and rerun heaptrack please? Many interesting locations could not be resolved in your trace. We now only know that /something/ in kdevqmljs seems to run Path::cd repeatedly, apparently leading to an ever increasing path that eventually consumes all memory. The question now is what part of our code base is triggering this, and why.
Comment 16 Martin Riethmayer 2017-05-24 14:04:05 UTC
Here's the heaptrack with debug symbols:

http://bit.ly/2qP7Otc

The increase in memory usage did not start until I made the first change to the JS file (increased a timeout from 2500 to 25000). I did not press "Save", just as soon as I hit the "0" the memory increase seemed to start.
Comment 17 Milian Wolff 2017-05-29 08:18:02 UTC
hm this didn't change anything - is there maybe a debug package for kdevqmljs? If so, can you install that one please? Otherwise, could you give us clear steps to reproduce the issue? Is the following enough?

- download file to some server
- open it in kdevelop via sftp kioslave
- edit function browse() in line 812

If so, then I'll try to reproduce it later
Comment 18 Martin Riethmayer 2017-05-29 09:01:21 UTC
Sorry, no debug symbols for kdevqmljs seem to be available on KDE Neon DEV stable.

Most simple steps to reproduce:
1.) Create a file "test.js" on a remote server
2.) Enter the text "var tmp = 2500;" (without the quotes) (or any other text)
3.) Open KDevelop
4.) Via SFTP or FISH, open that file
5.) Insert a "0" (so change 2500 => 25000) (or make any other change)

Expected result:
Nothing really should happen

Actual result:
Memory usage goes through the roof until KDevelop crashes

System info:
KDE Neon DEV stable (updated 2017-05-29)
KDevelop 5.1.1 
KDE Frameworks 5.35
Qt 5.7.1

Additional info:
This has happened to me also on older versions of KDevelop and other distros.

I've not yet encountered this problem with other file-types (e.g. php, css...).

Workaround: disable background-parser.
Comment 19 Milian Wolff 2017-05-30 14:07:21 UTC
confirmed, the following is a backtrace obtained with gdb:

#0  0x00007ffff752078e in QtPrivate::RefCount::deref() (this=0x7ffff7520a0e <QString::QString(QString const&)+84>) at /usr/include/qt/QtCore/qrefcount.h:65
#1  0x00007ffff7544bfe in QVector<QString>::reallocData(int, int, QFlags<QArrayData::AllocationOption>) (this=0x7fff76ffbce0, asize=2, aalloc=5, options=...) at /usr/include/qt/QtCore/qvector.h:600
#2  0x00007ffff7544f66 in QVector<QString>::detach() (this=0x7fff76ffbce0) at /usr/include/qt/QtCore/qvector.h:390
#3  0x00007ffff7543712 in QVector<QString>::end(QTypedArrayData<QString>::iterator) (this=0x7fff76ffbce0) at /usr/include/qt/QtCore/qvector.h:217
#4  0x00007ffff7543610 in QVector<QString>::last() (this=0x7fff76ffbce0) at /usr/include/qt/QtCore/qvector.h:238
#5  0x00007ffff75422fb in KDevelop::Path::addPath(QString const&) (this=0x7fff76ffbce0, path="node_modules") at /home/milian/projects/kf5/src/extragear/kdevelop/kdevplatform/util/path.cpp:416
#6  0x00007ffff7541087 in KDevelop::Path::Path(KDevelop::Path const&, QString const&) (this=0x7fff76ffbce0, other=("fish://kdab@192.168.149.9", ""), child="node_modules")
    at /home/milian/projects/kf5/src/extragear/kdevelop/kdevplatform/util/path.cpp:135
#7  0x00007ffff75425a2 in KDevelop::Path::cd(QString const&) const (this=0x7fff76ffbc70, dir="node_modules") at /home/milian/projects/kf5/src/extragear/kdevelop/kdevplatform/util/path.cpp:462
#8  0x00007fff756ef903 in QmlJS::NodeJS::moduleDirectories(QString const&) (this=0x7fff9404ff00, url="fish://kdab@192.168.149.9/tmp/test.js")
    at /home/milian/projects/kf5/src/extragear/kdevelop/kdevelop/languages/qmljs/duchain/frameworks/nodejs.cpp:162
#9  0x00007fff756efcd1 in QmlJS::NodeJS::moduleFileName(QString const&, QString const&) (this=0x7fff9404ff00, moduleName="__builtin_ecmascript", url="fish://kdab@192.168.149.9/tmp/test.js")
    at /home/milian/projects/kf5/src/extragear/kdevelop/kdevelop/languages/qmljs/duchain/frameworks/nodejs.cpp:189
#10 0x00007fff756ef1b3 in QmlJS::NodeJS::moduleExports(QString const&, KDevelop::IndexedString const&) (this=0x7fff9404ff00, moduleName="__builtin_ecmascript", url=...)
    at /home/milian/projects/kf5/src/extragear/kdevelop/kdevelop/languages/qmljs/duchain/frameworks/nodejs.cpp:92
#11 0x00007fff756f3373 in QmlJS::CodeCompletionContext::completionsFromNodeModule(QFlags<QmlJS::CodeCompletionContext::CompletionInContextFlag>, QString const&) (this=0x7fff68003af0, flags=..., module="__builtin_ecmascript") at /home/milian/projects/kf5/src/extragear/kdevelop/kdevelop/languages/qmljs/codecompletion/context.cpp:333
#12 0x00007fff756f22ec in QmlJS::CodeCompletionContext::normalCompletion() (this=0x7fff68003af0) at /home/milian/projects/kf5/src/extragear/kdevelop/kdevelop/languages/qmljs/codecompletion/context.cpp:181
#13 0x00007fff756f1c3f in QmlJS::CodeCompletionContext::completionItems(bool&, bool) (this=0x7fff68003af0, abort=@0x4806930: false, fullCompletion=false)
    at /home/milian/projects/kf5/src/extragear/kdevelop/kdevelop/languages/qmljs/codecompletion/context.cpp:121
#14 0x00007ffff268bb87 in KDevelop::CodeCompletionWorker::computeCompletions(KDevelop::DUChainPointer<KDevelop::DUContext>, KTextEditor::Cursor const&, QString, KTextEditor::Range const&, QString const&) (this=0x4806910, context=..., position=[0, 10], followingText="25000", contextRange=[(0, 0) -> (0, 10)], contextText="var tmp = ")
    at /home/milian/projects/kf5/src/extragear/kdevelop/kdevplatform/language/codecompletion/codecompletionworker.cpp:167
#15 0x00007ffff268b75c in KDevelop::CodeCompletionWorker::computeCompletions(KDevelop::DUChainPointer<KDevelop::DUContext>, KTextEditor::Cursor const&, KTextEditor::View*) (this=0x4806910, context=..., position=[0, 10], view=0x1700fd0) at /home/milian/projects/kf5/src/extragear/kdevelop/kdevplatform/language/codecompletion/codecompletionworker.cpp:129
#16 0x00007ffff26935c8 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<KDevelop::DUChainPointer<KDevelop::DUContext>, KTextEditor::Cursor const&, KTextEditor::View*>, void, void (KDevelop::CodeCompletionWorker::*)(KDevelop::DUChainPointer<KDevelop::DUContext>, KTextEditor::Cursor const&, KTextEditor::View*)>::call(void (KDevelop::CodeCompletionWorker::*)(KDevelop::DUChainPointer<KDevelop::DUContext>, KTextEditor::Cursor const&, KTextEditor::View*), KDevelop::CodeCompletionWorker*, void**) (f=
    (void (KDevelop::CodeCompletionWorker::*)(KDevelop::CodeCompletionWorker * const, KDevelop::DUChainPointer<KDevelop::DUContext>, const KTextEditor::Cursor &, KTextEditor::View *)) 0x7ffff268b132 <KDevelop::CodeCompletionWorker::computeCompletions(KDevelop::DUChainPointer<KDevelop::DUContext>, KTextEditor::Cursor const&, KTextEditor::View*)>, o=0x4806910, arg=0x4a3ec00)
    at /usr/include/qt/QtCore/qobjectdefs_impl.h:143
#17 0x00007ffff2693053 in QtPrivate::FunctionPointer<void (KDevelop::CodeCompletionWorker::*)(KDevelop::DUChainPointer<KDevelop::DUContext>, KTextEditor::Cursor const&, KTextEditor::View*)>::call<QtPrivate::List<KDevelop::DUChainPointer<KDevelop::DUContext>, KTextEditor::Cursor const&, KTextEditor::View*>, void>(void (KDevelop::CodeCompletionWorker::*)(KDevelop::DUChainPointer<KDevelop::DUContext>, KTextEditor::Cursor const&, KTextEditor::View*), KDevelop::CodeCompletionWorker*, void**) (f=
    (void (KDevelop::CodeCompletionWorker::*)(KDevelop::CodeCompletionWorker * const, KDevelop::DUChainPointer<KDevelop::DUContext>, const KTextEditor::Cursor &, KTextEditor::View *)) 0x7ffff268b132 <KDevelop::CodeCompletionWorker::computeCompletions(KDevelop::DUChainPointer<KDevelop::DUContext>, KTextEditor::Cursor const&, KTextEditor::View*)>, o=0x4806910, arg=0x4a3ec00)
    at /usr/include/qt/QtCore/qobjectdefs_impl.h:162
#18 0x00007ffff26928cf in QtPrivate::QSlotObject<void (KDevelop::CodeCompletionWorker::*)(KDevelop::DUChainPointer<KDevelop::DUContext>, KTextEditor::Cursor const&, KTextEditor::View*), QtPrivate::List<KDevelop::DUChainPointer<KDevelop::DUContext>, KTextEditor::Cursor const&, KTextEditor::View*>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x7fff68002190, r=0x4806910, a=0x4a3ec00, ret=0x0) at /usr/include/qt/QtCore/qobject_impl.h:120
#19 0x00007ffff47e5bd9 in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#20 0x00007ffff549b34c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#21 0x00007ffff54a2b61 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#22 0x00007ffff47b9470 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#23 0x00007ffff47bbbfd in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/libQt5Core.so.5
#24 0x00007ffff480dc73 in  () at /usr/lib/libQt5Core.so.5
#25 0x00007fffecd7f7b7 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#26 0x00007fffecd7fa20 in  () at /usr/lib/libglib-2.0.so.0
#27 0x00007fffecd7facc in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#28 0x00007ffff480e07f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#29 0x00007ffff47b78ca in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#30 0x00007ffff45d9a73 in QThread::exec() () at /usr/lib/libQt5Core.so.5
#31 0x00007ffff26910c3 in KDevelop::CompletionWorkerThread::run() (this=0x4465dd0) at /home/milian/projects/kf5/src/extragear/kdevelop/kdevplatform/language/codecompletion/codecompletionmodel.cpp:79
#32 0x00007ffff45de6d8 in  () at /usr/lib/libQt5Core.so.5

I also see this:


(gdb) 
#8  0x00007fff756ef903 in QmlJS::NodeJS::moduleDirectories (this=0x7fff9404ff00, url="fish://kdab@192.168.149.9/tmp/test.js")
    at /home/milian/projects/kf5/src/extragear/kdevelop/kdevelop/languages/qmljs/duchain/frameworks/nodejs.cpp:162
162             paths.append(path.cd(QStringLiteral("node_modules")));
(gdb) print paths
$3 = QVector<KDevelop::Path> = {[0] = ("ssd2", "milian", "projects", "compiled", "kf5", "share", "kdevqmljssupport", "nodejsmodules"), 
  [1] = ("home", "milian", "projects", "compiled", "kf5", "share", "kdevqmljssupport", "nodejsmodules"), [2] = ("fish://kdab@192.168.149.9", "tmp", "node_modules"), 
  [3] = ("fish://kdab@192.168.149.9", "node_modules"), [4] = ("fish://kdab@192.168.149.9", "node_modules"), [5] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [6] = ("fish://kdab@192.168.149.9", "node_modules"), [7] = ("fish://kdab@192.168.149.9", "node_modules"), [8] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [9] = ("fish://kdab@192.168.149.9", "node_modules"), [10] = ("fish://kdab@192.168.149.9", "node_modules"), [11] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [12] = ("fish://kdab@192.168.149.9", "node_modules"), [13] = ("fish://kdab@192.168.149.9", "node_modules"), [14] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [15] = ("fish://kdab@192.168.149.9", "node_modules"), [16] = ("fish://kdab@192.168.149.9", "node_modules"), [17] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [18] = ("fish://kdab@192.168.149.9", "node_modules"), [19] = ("fish://kdab@192.168.149.9", "node_modules"), [20] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [21] = ("fish://kdab@192.168.149.9", "node_modules"), [22] = ("fish://kdab@192.168.149.9", "node_modules"), [23] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [24] = ("fish://kdab@192.168.149.9", "node_modules"), [25] = ("fish://kdab@192.168.149.9", "node_modules"), [26] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [27] = ("fish://kdab@192.168.149.9", "node_modules"), [28] = ("fish://kdab@192.168.149.9", "node_modules"), [29] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [30] = ("fish://kdab@192.168.149.9", "node_modules"), [31] = ("fish://kdab@192.168.149.9", "node_modules"), [32] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [33] = ("fish://kdab@192.168.149.9", "node_modules"), [34] = ("fish://kdab@192.168.149.9", "node_modules"), [35] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [36] = ("fish://kdab@192.168.149.9", "node_modules"), [37] = ("fish://kdab@192.168.149.9", "node_modules"), [38] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [39] = ("fish://kdab@192.168.149.9", "node_modules"), [40] = ("fish://kdab@192.168.149.9", "node_modules"), [41] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [42] = ("fish://kdab@192.168.149.9", "node_modules"), [43] = ("fish://kdab@192.168.149.9", "node_modules"), [44] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [45] = ("fish://kdab@192.168.149.9", "node_modules"), [46] = ("fish://kdab@192.168.149.9", "node_modules"), [47] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [48] = ("fish://kdab@192.168.149.9", "node_modules"), [49] = ("fish://kdab@192.168.149.9", "node_modules"), [50] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [51] = ("fish://kdab@192.168.149.9", "node_modules"), [52] = ("fish://kdab@192.168.149.9", "node_modules"), [53] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [54] = ("fish://kdab@192.168.149.9", "node_modules"), [55] = ("fish://kdab@192.168.149.9", "node_modules"), [56] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [57] = ("fish://kdab@192.168.149.9", "node_modules"), [58] = ("fish://kdab@192.168.149.9", "node_modules"), [59] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [60] = ("fish://kdab@192.168.149.9", "node_modules"), [61] = ("fish://kdab@192.168.149.9", "node_modules"), [62] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [63] = ("fish://kdab@192.168.149.9", "node_modules"), [64] = ("fish://kdab@192.168.149.9", "node_modules"), [65] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [66] = ("fish://kdab@192.168.149.9", "node_modules"), [67] = ("fish://kdab@192.168.149.9", "node_modules"), [68] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [69] = ("fish://kdab@192.168.149.9", "node_modules"), [70] = ("fish://kdab@192.168.149.9", "node_modules"), [71] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [72] = ("fish://kdab@192.168.149.9", "node_modules"), [73] = ("fish://kdab@192.168.149.9", "node_modules"), [74] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [75] = ("fish://kdab@192.168.149.9", "node_modules"), [76] = ("fish://kdab@192.168.149.9", "node_modules"), [77] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [78] = ("fish://kdab@192.168.149.9", "node_modules"), [79] = ("fish://kdab@192.168.149.9", "node_modules"), [80] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [81] = ("fish://kdab@192.168.149.9", "node_modules"), [82] = ("fish://kdab@192.168.149.9", "node_modules"), [83] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [84] = ("fish://kdab@192.168.149.9", "node_modules"), [85] = ("fish://kdab@192.168.149.9", "node_modules"), [86] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [87] = ("fish://kdab@192.168.149.9", "node_modules"), [88] = ("fish://kdab@192.168.149.9", "node_modules"), [89] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [90] = ("fish://kdab@192.168.149.9", "node_modules"), [91] = ("fish://kdab@192.168.149.9", "node_modules"), [92] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [93] = ("fish://kdab@192.168.149.9", "node_modules"), [94] = ("fish://kdab@192.168.149.9", "node_modules"), [95] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [96] = ("fish://kdab@192.168.149.9", "node_modules"), [97] = ("fish://kdab@192.168.149.9", "node_modules"), [98] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [99] = ("fish://kdab@192.168.149.9", "node_modules"), [100] = ("fish://kdab@192.168.149.9", "node_modules"), [101] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [102] = ("fish://kdab@192.168.149.9", "node_modules"), [103] = ("fish://kdab@192.168.149.9", "node_modules"), [104] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [105] = ("fish://kdab@192.168.149.9", "node_modules"), [106] = ("fish://kdab@192.168.149.9", "node_modules"), [107] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [108] = ("fish://kdab@192.168.149.9", "node_modules"), [109] = ("fish://kdab@192.168.149.9", "node_modules"), [110] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [111] = ("fish://kdab@192.168.149.9", "node_modules"), [112] = ("fish://kdab@192.168.149.9", "node_modules"), [113] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [114] = ("fish://kdab@192.168.149.9", "node_modules"), [115] = ("fish://kdab@192.168.149.9", "node_modules"), [116] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [117] = ("fish://kdab@192.168.149.9", "node_modules"), [118] = ("fish://kdab@192.168.149.9", "node_modules"), [119] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [120] = ("fish://kdab@192.168.149.9", "node_modules"), [121] = ("fish://kdab@192.168.149.9", "node_modules"), [122] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [123] = ("fish://kdab@192.168.149.9", "node_modules"), [124] = ("fish://kdab@192.168.149.9", "node_modules"), [125] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [126] = ("fish://kdab@192.168.149.9", "node_modules"), [127] = ("fish://kdab@192.168.149.9", "node_modules"), [128] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [129] = ("fish://kdab@192.168.149.9", "node_modules"), [130] = ("fish://kdab@192.168.149.9", "node_modules"), [131] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [132] = ("fish://kdab@192.168.149.9", "node_modules"), [133] = ("fish://kdab@192.168.149.9", "node_modules"), [134] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [135] = ("fish://kdab@192.168.149.9", "node_modules"), [136] = ("fish://kdab@192.168.149.9", "node_modules"), [137] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [138] = ("fish://kdab@192.168.149.9", "node_modules"), [139] = ("fish://kdab@192.168.149.9", "node_modules"), [140] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [141] = ("fish://kdab@192.168.149.9", "node_modules"), [142] = ("fish://kdab@192.168.149.9", "node_modules"), [143] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [144] = ("fish://kdab@192.168.149.9", "node_modules"), [145] = ("fish://kdab@192.168.149.9", "node_modules"), [146] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [147] = ("fish://kdab@192.168.149.9", "node_modules"), [148] = ("fish://kdab@192.168.149.9", "node_modules"), [149] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [150] = ("fish://kdab@192.168.149.9", "node_modules"), [151] = ("fish://kdab@192.168.149.9", "node_modules"), [152] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [153] = ("fish://kdab@192.168.149.9", "node_modules"), [154] = ("fish://kdab@192.168.149.9", "node_modules"), [155] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [156] = ("fish://kdab@192.168.149.9", "node_modules"), [157] = ("fish://kdab@192.168.149.9", "node_modules"), [158] = ("fish://kdab@192.168.149.9", "node_modules"), 
---Type <return> to continue, or q <return> to quit---
  [159] = ("fish://kdab@192.168.149.9", "node_modules"), [160] = ("fish://kdab@192.168.149.9", "node_modules"), [161] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [162] = ("fish://kdab@192.168.149.9", "node_modules"), [163] = ("fish://kdab@192.168.149.9", "node_modules"), [164] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [165] = ("fish://kdab@192.168.149.9", "node_modules"), [166] = ("fish://kdab@192.168.149.9", "node_modules"), [167] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [168] = ("fish://kdab@192.168.149.9", "node_modules"), [169] = ("fish://kdab@192.168.149.9", "node_modules"), [170] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [171] = ("fish://kdab@192.168.149.9", "node_modules"), [172] = ("fish://kdab@192.168.149.9", "node_modules"), [173] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [174] = ("fish://kdab@192.168.149.9", "node_modules"), [175] = ("fish://kdab@192.168.149.9", "node_modules"), [176] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [177] = ("fish://kdab@192.168.149.9", "node_modules"), [178] = ("fish://kdab@192.168.149.9", "node_modules"), [179] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [180] = ("fish://kdab@192.168.149.9", "node_modules"), [181] = ("fish://kdab@192.168.149.9", "node_modules"), [182] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [183] = ("fish://kdab@192.168.149.9", "node_modules"), [184] = ("fish://kdab@192.168.149.9", "node_modules"), [185] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [186] = ("fish://kdab@192.168.149.9", "node_modules"), [187] = ("fish://kdab@192.168.149.9", "node_modules"), [188] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [189] = ("fish://kdab@192.168.149.9", "node_modules"), [190] = ("fish://kdab@192.168.149.9", "node_modules"), [191] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [192] = ("fish://kdab@192.168.149.9", "node_modules"), [193] = ("fish://kdab@192.168.149.9", "node_modules"), [194] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [195] = ("fish://kdab@192.168.149.9", "node_modules"), [196] = ("fish://kdab@192.168.149.9", "node_modules"), [197] = ("fish://kdab@192.168.149.9", "node_modules"), 
  [198] = ("fish://kdab@192.168.149.9", "node_modules"), [199] = ("fish://kdab@192.168.149.9", "node_modules")...}
(gdb) list
157         // url/../node_modules, then url/../../node_modules, etc
158         Path path(url);
159         path.addPath(QStringLiteral(".."));
160
161         while (path.segments().size() > 1) {
162             paths.append(path.cd(QStringLiteral("node_modules")));
163             path.addPath(QStringLiteral(".."));
164         }
165
166         return paths;
(gdb)
Comment 20 Milian Wolff 2017-05-30 14:14:30 UTC
Git commit dcba8a49900cdddf3d5697f2d6aeabe5cef39a19 by Milian Wolff.
Committed on 30/05/2017 at 14:12.
Pushed by mwolff into branch '5.1'.

Properly handle remote paths when creating nodejd module directories

When we open a remote path, we get one more segment for the host,
user and related information. As such, we always will have at least
two segments. Previously, we looped indefinitely and consumed a lot
of memory until that was exhausted and kdevelop crashed. Now we
handle this situation gracefully and users can again edit JS files
via fish/sftp remotely.
FIXED-IN: 5.1.2

M  +2    -1    languages/qmljs/duchain/frameworks/nodejs.cpp

https://commits.kde.org/kdevelop/dcba8a49900cdddf3d5697f2d6aeabe5cef39a19