[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file [QmlJS::NodeJS::moduleDirectories]

2017-05-30 Thread Milian Wolff
https://bugs.kde.org/show_bug.cgi?id=369573

Milian Wolff  changed:

   What|Removed |Added

 Status|CONFIRMED   |RESOLVED
   Version Fixed In||5.1.2
 Resolution|--- |FIXED
  Latest Commit||https://commits.kde.org/kde
   ||velop/dcba8a49900cdddf3d569
   ||7f2d6aeabe5cef39a19

--- Comment #20 from Milian Wolff  ---
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-1languages/qmljs/duchain/frameworks/nodejs.cpp

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

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

[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file [QmlJS::NodeJS::moduleDirectories]

2017-05-30 Thread Milian Wolff
https://bugs.kde.org/show_bug.cgi?id=369573

Milian Wolff  changed:

   What|Removed |Added

 Status|REOPENED|CONFIRMED

--- Comment #19 from Milian Wolff  ---
confirmed, the following is a backtrace obtained with gdb:

#0  0x7752078e in QtPrivate::RefCount::deref() (this=0x77520a0e
) at /usr/include/qt/QtCore/qrefcount.h:65
#1  0x77544bfe in QVector::reallocData(int, int,
QFlags) (this=0x7fff76ffbce0, asize=2, aalloc=5,
options=...) at /usr/include/qt/QtCore/qvector.h:600
#2  0x77544f66 in QVector::detach() (this=0x7fff76ffbce0) at
/usr/include/qt/QtCore/qvector.h:390
#3  0x77543712 in
QVector::end(QTypedArrayData::iterator) (this=0x7fff76ffbce0)
at /usr/include/qt/QtCore/qvector.h:217
#4  0x77543610 in QVector::last() (this=0x7fff76ffbce0) at
/usr/include/qt/QtCore/qvector.h:238
#5  0x775422fb 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  0x77541087 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  0x775425a2 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  0x7fff756ef903 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  0x7fff756efcd1 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 0x7fff756ef1b3 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 0x7fff756f3373 in
QmlJS::CodeCompletionContext::completionsFromNodeModule(QFlags,
QString const&) (this=0x7fff68003af0, flags=..., module="__builtin_ecmascript")
at
/home/milian/projects/kf5/src/extragear/kdevelop/kdevelop/languages/qmljs/codecompletion/context.cpp:333
#12 0x7fff756f22ec in QmlJS::CodeCompletionContext::normalCompletion()
(this=0x7fff68003af0) at
/home/milian/projects/kf5/src/extragear/kdevelop/kdevelop/languages/qmljs/codecompletion/context.cpp:181
#13 0x7fff756f1c3f 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 0x7268bb87 in
KDevelop::CodeCompletionWorker::computeCompletions(KDevelop::DUChainPointer,
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 0x7268b75c in
KDevelop::CodeCompletionWorker::computeCompletions(KDevelop::DUChainPointer,
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 0x726935c8 in QtPrivate::FunctorCall, QtPrivate::List, void, void
(KDevelop::CodeCompletionWorker::*)(KDevelop::DUChainPointer,
KTextEditor::Cursor const&, KTextEditor::View*)>::call(void
(KDevelop::CodeCompletionWorker::*)(KDevelop::DUChainPointer,
KTextEditor::Cursor const&, KTextEditor::View*),
KDevelop::CodeCompletionWorker*, void**) (f=
(void (KDevelop::CodeCompletionWorker::*)(KDevelop::CodeCompletionWorker *
const, KDevelop::DUChainPointer, const KTextEditor::Cursor
&, KTextEditor::View *)) 0x7268b132
, o=0x4806910, arg=0x4a3ec00)
at /usr/include/qt/QtCore/qobjectdefs_impl.h:143
#17 0x72693053 in QtPrivate::FunctionPointer,
KTextEditor::Cursor const&,

[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file [QmlJS::NodeJS::moduleDirectories]

2017-05-29 Thread Martin Riethmayer
https://bugs.kde.org/show_bug.cgi?id=369573

--- Comment #18 from Martin Riethmayer  ---
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.

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

[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file [QmlJS::NodeJS::moduleDirectories]

2017-05-29 Thread Milian Wolff
https://bugs.kde.org/show_bug.cgi?id=369573

--- Comment #17 from Milian Wolff  ---
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

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

[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file [QmlJS::NodeJS::moduleDirectories]

2017-05-24 Thread Martin Riethmayer
https://bugs.kde.org/show_bug.cgi?id=369573

--- Comment #16 from Martin Riethmayer  ---
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.

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

[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file [QmlJS::NodeJS::moduleDirectories]

2017-05-24 Thread Milian Wolff
https://bugs.kde.org/show_bug.cgi?id=369573

--- Comment #15 from Milian Wolff  ---
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.

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

[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file [QmlJS::NodeJS::moduleDirectories]

2017-05-24 Thread Martin Riethmayer
https://bugs.kde.org/show_bug.cgi?id=369573

--- Comment #14 from Martin Riethmayer  ---
Created attachment 105695
  --> https://bugs.kde.org/attachment.cgi?id=105695=edit
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.

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

[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file [QmlJS::NodeJS::moduleDirectories]

2017-05-24 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=369573

--- Comment #13 from pyrk...@go2.pl ---
After upgrading to 5.1.0 (4:5.1.0-0ubuntu1~ubuntu17.04~ppa2) from PPA problem
still exists.

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

[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file [QmlJS::NodeJS::moduleDirectories]

2017-05-24 Thread Martin Riethmayer
https://bugs.kde.org/show_bug.cgi?id=369573

Martin Riethmayer  changed:

   What|Removed |Added

 CC||rip...@freakmail.de

--- Comment #12 from Martin Riethmayer  ---
*** Bug 367893 has been marked as a duplicate of this bug. ***

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

[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file [QmlJS::NodeJS::moduleDirectories]

2017-05-24 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=369573

pyrk...@go2.pl changed:

   What|Removed |Added

 CC||pyrk...@go2.pl

--- Comment #11 from pyrk...@go2.pl ---
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.

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

[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file [QmlJS::NodeJS::moduleDirectories]

2017-03-23 Thread Francis Herne
https://bugs.kde.org/show_bug.cgi?id=369573

Francis Herne  changed:

   What|Removed |Added

 CC||m...@flherne.uk

--- Comment #10 from Francis Herne  ---
*** Bug 377973 has been marked as a duplicate of this bug. ***

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

[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file [QmlJS::NodeJS::moduleDirectories]

2017-03-16 Thread bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=369573

sla...@glamocanin.net changed:

   What|Removed |Added

 CC||sla...@glamocanin.net

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

[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file [QmlJS::NodeJS::moduleDirectories]

2017-03-07 Thread Fabian
https://bugs.kde.org/show_bug.cgi?id=369573

--- Comment #9 from Fabian  ---
Yes, it happens when editing on a remote file system.

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

[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file [QmlJS::NodeJS::moduleDirectories]

2017-03-07 Thread Kevin Funk
https://bugs.kde.org/show_bug.cgi?id=369573

Kevin Funk  changed:

   What|Removed |Added

Summary|kdevelop consumes all   |kdevelop consumes all
   |available memory when   |available memory when
   |editing js file |editing js file
   ||[QmlJS::NodeJS::moduleDirec
   ||tories]

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

[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file

2017-03-07 Thread Kevin Funk
https://bugs.kde.org/show_bug.cgi?id=369573

--- Comment #8 from Kevin Funk  ---
@Fabian: So the interesting thing is that this JS file is on a remote file
system, correct?

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

[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file

2017-03-07 Thread Kevin Funk
https://bugs.kde.org/show_bug.cgi?id=369573

Kevin Funk  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|RESOLVED|REOPENED
 Resolution|DUPLICATE   |---

--- Comment #7 from Kevin Funk  ---
This is not a duplicate of bug 36912

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

[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file

2016-10-15 Thread Sven Brauch via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=369573

Sven Brauch  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|UNCONFIRMED |RESOLVED

--- Comment #6 from Sven Brauch  ---


*** This bug has been marked as a duplicate of bug 369182 ***

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


[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file

2016-10-11 Thread Fabian via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=369573

--- Comment #5 from Fabian  ---
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.

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


[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file

2016-10-10 Thread Sven Brauch via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=369573

--- Comment #4 from Sven Brauch  ---
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 ...

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


[kdevelop] [Bug 369573] kdevelop consumes all available memory when editing js file

2016-10-10 Thread Sven Brauch via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=369573

Sven Brauch  changed:

   What|Removed |Added

Summary|kdevelop consumes all   |kdevelop consumes all
   |available memory when   |available memory when
   |editing larger js file  |editing js file
 CC||m...@svenbrauch.de

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