andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 38 forks source link

Segment violation and memory leak when opening big file #142

Closed yajo closed 10 years ago

yajo commented 10 years ago

Hello.

Today I have been stressing Enki a bit, opening a big database script (193684 lines of autogenerated SQL code).

Enki displayed the file quickly, but as I scrolled down I noticed that it was not fully colored (syntax highlighting). Suddenly it got colours, but again further down it was all black. This happened several times, showing that Enki was coloring it.

In the mean time, Enki was eating all the memory it could, until ~2.1 GiB. Then it crashed (segment violation) and closed.

Opening Enki again showed again the wicked file, so I closed it quickly before the memory leak happened. However, in the background, it kept on leaking and crashed again. It seems like it stills tries to give color to an already-closed file.

Testing the same file with Gedit showed that, while it was quite slower, it made it work with only ~420 MiB of RAM. It also was loading and painting the file progressively.

Doing the same test with mysql-workbench gave the best results, opening it almost instantly with full syntax highlight, from start to end.

I'm trying to get a stack trace with ABRT, but I cannot guarantee I get it.

yajo commented 10 years ago

I hope this backtrace is useful:

warning: core file may not match specified executable file.
[New LWP 3928]
[New LWP 3931]
[New LWP 3932]
[New LWP 3935]
[New LWP 3936]
[New LWP 3937]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/usr/bin/python /usr/bin/enki'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007ff881b7e2c8 in keyword_tryMatch () from /usr/lib64/python2.7/site-packages/qutepart/syntax/cParser.so

Thread 6 (Thread 0x7ff868b5a700 (LWP 3937)):
#0  0x00000038fc4eb7fd in poll () from /lib64/libc.so.6
No symbol table info available.
#1  0x000000307c0480e4 in g_main_context_iterate.isra.22 () from /lib64/libglib-2.0.so.0
No symbol table info available.
#2  0x000000307c0481ec in g_main_context_iteration () from /lib64/libglib-2.0.so.0
No symbol table info available.
#3  0x000000307d5a7166 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
No symbol table info available.
#4  0x000000307d578ecf in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
No symbol table info available.
#5  0x000000307d5791c5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
No symbol table info available.
#6  0x000000307d47866f in QThread::exec() () from /lib64/libQtCore.so.4
No symbol table info available.
#7  0x000000307d55a733 in QInotifyFileSystemWatcherEngine::run() () from /lib64/libQtCore.so.4
No symbol table info available.
#8  0x000000307d47ad0f in QThreadPrivate::start(void*) () from /lib64/libQtCore.so.4
No symbol table info available.
#9  0x00000038fcc07c53 in start_thread () from /lib64/libpthread.so.0
No symbol table info available.
#10 0x00000038fc4f5dbd in clone () from /lib64/libc.so.6
No symbol table info available.

Thread 5 (Thread 0x7ff8745f9700 (LWP 3936)):
#0  0x00000038fcc0b565 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
No symbol table info available.
#1  0x000000307d47b1e6 in QWaitCondition::wait(QMutex*, unsigned long) () from /lib64/libQtCore.so.4
No symbol table info available.
#2  0x000000307e09e876 in QFileInfoGatherer::run() () from /lib64/libQtGui.so.4
No symbol table info available.
#3  0x000000307d47ad0f in QThreadPrivate::start(void*) () from /lib64/libQtCore.so.4
No symbol table info available.
#4  0x00000038fcc07c53 in start_thread () from /lib64/libpthread.so.0
No symbol table info available.
#5  0x00000038fc4f5dbd in clone () from /lib64/libc.so.6
No symbol table info available.

Thread 4 (Thread 0x7ff874dfa700 (LWP 3935)):
#0  0x00000038fc4eb7fd in poll () from /lib64/libc.so.6
No symbol table info available.
#1  0x000000307c0480e4 in g_main_context_iterate.isra.22 () from /lib64/libglib-2.0.so.0
No symbol table info available.
#2  0x000000307c0481ec in g_main_context_iteration () from /lib64/libglib-2.0.so.0
No symbol table info available.
#3  0x000000307d5a7166 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
No symbol table info available.
#4  0x000000307d578ecf in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
No symbol table info available.
#5  0x000000307d5791c5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
No symbol table info available.
#6  0x000000307d47866f in QThread::exec() () from /lib64/libQtCore.so.4
No symbol table info available.
#7  0x000000307d55a733 in QInotifyFileSystemWatcherEngine::run() () from /lib64/libQtCore.so.4
No symbol table info available.
#8  0x000000307d47ad0f in QThreadPrivate::start(void*) () from /lib64/libQtCore.so.4
No symbol table info available.
#9  0x00000038fcc07c53 in start_thread () from /lib64/libpthread.so.0
No symbol table info available.
#10 0x00000038fc4f5dbd in clone () from /lib64/libc.so.6
No symbol table info available.

Thread 3 (Thread 0x7ff889d83700 (LWP 3932)):
#0  0x00000038fc4eb7fd in poll () from /lib64/libc.so.6
No symbol table info available.
#1  0x000000307c0480e4 in g_main_context_iterate.isra.22 () from /lib64/libglib-2.0.so.0
No symbol table info available.
#2  0x000000307c0481ec in g_main_context_iteration () from /lib64/libglib-2.0.so.0
No symbol table info available.
#3  0x000000307d5a7166 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
No symbol table info available.
#4  0x000000307d578ecf in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
No symbol table info available.
#5  0x000000307d5791c5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
No symbol table info available.
#6  0x000000307d47866f in QThread::exec() () from /lib64/libQtCore.so.4
No symbol table info available.
#7  0x000000307d55a733 in QInotifyFileSystemWatcherEngine::run() () from /lib64/libQtCore.so.4
No symbol table info available.
#8  0x000000307d47ad0f in QThreadPrivate::start(void*) () from /lib64/libQtCore.so.4
No symbol table info available.
#9  0x00000038fcc07c53 in start_thread () from /lib64/libpthread.so.0
No symbol table info available.
#10 0x00000038fc4f5dbd in clone () from /lib64/libc.so.6
No symbol table info available.

Thread 2 (Thread 0x7ff88a584700 (LWP 3931)):
#0  0x00000038fcc0b565 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
No symbol table info available.
#1  0x000000307d47b1e6 in QWaitCondition::wait(QMutex*, unsigned long) () from /lib64/libQtCore.so.4
No symbol table info available.
#2  0x000000307e09e876 in QFileInfoGatherer::run() () from /lib64/libQtGui.so.4
No symbol table info available.
#3  0x000000307d47ad0f in QThreadPrivate::start(void*) () from /lib64/libQtCore.so.4
No symbol table info available.
#4  0x00000038fcc07c53 in start_thread () from /lib64/libpthread.so.0
No symbol table info available.
#5  0x00000038fc4f5dbd in clone () from /lib64/libc.so.6
No symbol table info available.

Thread 1 (Thread 0x7ff897c71740 (LWP 3928)):
#0  0x00007ff881b7e2c8 in keyword_tryMatch () from /usr/lib64/python2.7/site-packages/qutepart/syntax/cParser.so
No symbol table info available.
#1  0x00007ff881b7cdea in AbstractRule_tryMatch_internal () from /usr/lib64/python2.7/site-packages/qutepart/syntax/cParser.so
No symbol table info available.
#2  0x00007ff881b7d683 in Context_parseBlock () from /usr/lib64/python2.7/site-packages/qutepart/syntax/cParser.so
No symbol table info available.
#3  0x00007ff881b7da6e in Parser_parseBlock_internal () from /usr/lib64/python2.7/site-packages/qutepart/syntax/cParser.so
No symbol table info available.
#4  0x00000030800ddcee in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
No symbol table info available.
#5  0x00000030800dd80c in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
No symbol table info available.
#6  0x00000030800dd80c in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
No symbol table info available.
#7  0x00000030800dec7d in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
No symbol table info available.
#8  0x000000308006dca0 in ?? () from /lib64/libpython2.7.so.1.0
No symbol table info available.
#9  0x0000003080049dd3 in PyObject_Call () from /lib64/libpython2.7.so.1.0
No symbol table info available.
#10 0x0000003080058555 in ?? () from /lib64/libpython2.7.so.1.0
No symbol table info available.
#11 0x0000003080049dd3 in PyObject_Call () from /lib64/libpython2.7.so.1.0
No symbol table info available.
#12 0x00000030800d8af7 in PyEval_CallObjectWithKeywords () from /lib64/libpython2.7.so.1.0
No symbol table info available.
#13 0x00007ff88f84e7e0 in sip_api_invoke_slot () from /usr/lib64/python2.7/site-packages/sip.so
No symbol table info available.
#14 0x00007ff88f55d256 in PyQtProxy::invokeSlot(qpycore_slot const&, void**) () from /usr/lib64/python2.7/site-packages/PyQt4/QtCore.so
No symbol table info available.
#15 0x00007ff88f55d570 in PyQtProxy::unislot(void**) () from /usr/lib64/python2.7/site-packages/PyQt4/QtCore.so
No symbol table info available.
#16 0x00007ff88f55e10d in PyQtProxy::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib64/python2.7/site-packages/PyQt4/QtCore.so
No symbol table info available.
#17 0x000000307d58e172 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /lib64/libQtCore.so.4
No symbol table info available.
#18 0x00007ff88f4793ab in sipQTimer::timerEvent(QTimerEvent*) () from /usr/lib64/python2.7/site-packages/PyQt4/QtCore.so
No symbol table info available.
#19 0x000000307d592141 in QObject::event(QEvent*) () from /lib64/libQtCore.so.4
No symbol table info available.
#20 0x00007ff88f47954b in sipQTimer::event(QEvent*) () from /usr/lib64/python2.7/site-packages/PyQt4/QtCore.so
No symbol table info available.
#21 0x000000307dbc84dc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQtGui.so.4
No symbol table info available.
#22 0x000000307dbceaa0 in QApplication::notify(QObject*, QEvent*) () from /lib64/libQtGui.so.4
No symbol table info available.
#23 0x00007ff88eef4b16 in sipQApplication::notify(QObject*, QEvent*) () from /usr/lib64/python2.7/site-packages/PyQt4/QtGui.so
No symbol table info available.
#24 0x000000307d57a26d in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /lib64/libQtCore.so.4
No symbol table info available.
#25 0x000000307d5a9c13 in QTimerInfoList::activateTimers() () from /lib64/libQtCore.so.4
No symbol table info available.
#26 0x000000307d5a6f49 in idleTimerSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQtCore.so.4
No symbol table info available.
#27 0x000000307c047df6 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
No symbol table info available.
#28 0x000000307c048148 in g_main_context_iterate.isra.22 () from /lib64/libglib-2.0.so.0
No symbol table info available.
#29 0x000000307c0481ec in g_main_context_iteration () from /lib64/libglib-2.0.so.0
No symbol table info available.
#30 0x000000307d5a7145 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
No symbol table info available.
#31 0x000000307dc64fc6 in QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtGui.so.4
No symbol table info available.
#32 0x000000307d578ecf in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
No symbol table info available.
#33 0x000000307d5791c5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
No symbol table info available.
#34 0x000000307d57e45b in QCoreApplication::exec() () from /lib64/libQtCore.so.4
No symbol table info available.
#35 0x00007ff88eef3230 in meth_QApplication_exec_ () from /usr/lib64/python2.7/site-packages/PyQt4/QtGui.so
No symbol table info available.
#36 0x00000030800ddcee in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
No symbol table info available.
#37 0x00000030800dd80c in PyEval_EvalFrameEx () from /lib64/libpython2.7.so.1.0
No symbol table info available.
#38 0x00000030800dec7d in PyEval_EvalCodeEx () from /lib64/libpython2.7.so.1.0
No symbol table info available.
#39 0x00000030800ded82 in PyEval_EvalCode () from /lib64/libpython2.7.so.1.0
No symbol table info available.
#40 0x00000030800f78af in ?? () from /lib64/libpython2.7.so.1.0
No symbol table info available.
#41 0x00000030800f89ce in PyRun_FileExFlags () from /lib64/libpython2.7.so.1.0
No symbol table info available.
#42 0x00000030800f9b39 in PyRun_SimpleFileExFlags () from /lib64/libpython2.7.so.1.0
No symbol table info available.
#43 0x000000308010a66f in Py_Main () from /lib64/libpython2.7.so.1.0
No symbol table info available.
#44 0x00000038fc421b45 in __libc_start_main () from /lib64/libc.so.6
No symbol table info available.
#45 0x0000000000400721 in _start ()
No symbol table info available.
From                To                  Syms Read   Shared Object Library
0x000000308003f370  0x0000003080120330  Yes (*)     /lib64/libpython2.7.so.1.0
0x00000038fcc05790  0x00000038fcc103b4  Yes (*)     /lib64/libpthread.so.0
0x00000038fc800ed0  0x00000038fc8019d0  Yes (*)     /lib64/libdl.so.2
0x0000003916400f10  0x0000003916401804  Yes (*)     /lib64/libutil.so.1
0x00000038fd4054b0  0x00000038fd46fbb8  Yes (*)     /lib64/libm.so.6
0x00000038fc41f410  0x00000038fc562740  Yes (*)     /lib64/libc.so.6
0x00000038fc000ae0  0x00000038fc01ac0a  Yes (*)     /lib64/ld-linux-x86-64.so.2
0x00007ff891390b20  0x00007ff891391ba8  Yes (*)     /usr/lib64/python2.7/lib-dynload/timemodule.so
0x00007ff89118ab80  0x00007ff89118bb2c  Yes (*)     /usr/lib64/python2.7/lib-dynload/cStringIO.so
0x00007ff890f834b0  0x00007ff890f85b4c  Yes (*)     /usr/lib64/python2.7/lib-dynload/_collectionsmodule.so
0x00007ff890d7b070  0x00007ff890d7cb44  Yes (*)     /usr/lib64/python2.7/lib-dynload/operator.so
0x00007ff890b6af10  0x00007ff890b6fa48  Yes (*)     /usr/lib64/python2.7/lib-dynload/itertoolsmodule.so
0x00007ff890963de0  0x00007ff890964e64  Yes (*)     /usr/lib64/python2.7/lib-dynload/_heapq.so
0x00007ff890753150  0x00007ff890759ed8  Yes (*)     /usr/lib64/python2.7/lib-dynload/_socketmodule.so
0x00007ff89054c110  0x00007ff89054cbac  Yes (*)     /usr/lib64/python2.7/lib-dynload/_functoolsmodule.so
0x00007ff8903454d0  0x00007ff890348194  Yes (*)     /usr/lib64/python2.7/lib-dynload/_ssl.so
0x00000039170181b0  0x00000039170515d0  Yes (*)     /lib64/libssl.so.10
0x000000390f465d00  0x000000390f5521d8  Yes (*)     /lib64/libcrypto.so.10
0x0000003914c0bbb0  0x0000003914c3bb44  Yes (*)     /lib64/libgssapi_krb5.so.2
0x0000003913c24530  0x0000003913c8547c  Yes (*)     /lib64/libkrb5.so.3
0x0000003912801510  0x00000039128020d4  Yes (*)     /lib64/libcom_err.so.2
0x0000003915004750  0x00000039150246c0  Yes (*)     /lib64/libk5crypto.so.3
0x00000038fd002170  0x00000038fd00e5f0  Yes (*)     /lib64/libz.so.1
0x00000039140035e0  0x0000003914009f3c  Yes (*)     /lib64/libkrb5support.so.0
0x00000039130011c0  0x0000003913001b1c  Yes (*)     /lib64/libkeyutils.so.1
0x00000038fec03a40  0x00000038fec1271c  Yes (*)     /lib64/libresolv.so.2
0x00000038fe006260  0x00000038fe017e9c  Yes (*)     /lib64/libselinux.so.1
0x00000038fdc015f0  0x00000038fdc49cc8  Yes (*)     /lib64/libpcre.so.1
0x00007ff890132a30  0x00007ff89013db70  Yes (*)     /usr/lib64/python2.7/lib-dynload/cPickle.so
0x00007ff88ff28900  0x00007ff88ff2b16c  Yes (*)     /usr/lib64/python2.7/lib-dynload/_struct.so
0x00007ff88fd20750  0x00007ff88fd22ec4  Yes (*)     /usr/lib64/python2.7/lib-dynload/stropmodule.so
0x00007ff88fa5ab50  0x00007ff88fa5bf54  Yes (*)     /usr/lib64/python2.7/lib-dynload/_localemodule.so
0x00007ff88f840820  0x00007ff88f8508c8  Yes (*)     /usr/lib64/python2.7/site-packages/sip.so
0x000000390445b510  0x00000039044be5ba  Yes (*)     /lib64/libstdc++.so.6
0x00000038fe402af0  0x00000038fe4121f8  Yes (*)     /lib64/libgcc_s.so.1
0x00007ff88f4465d0  0x00007ff88f5694e8  Yes (*)     /usr/lib64/python2.7/site-packages/PyQt4/QtCore.so
0x000000307d45dbb0  0x000000307d5d9ce0  Yes (*)     /lib64/libQtCore.so.4
0x000000307d0006b0  0x000000307d00081c  Yes (*)     /lib64/libgthread-2.0.so.0
0x000000307c01a260  0x000000307c0af89c  Yes (*)     /lib64/libglib-2.0.so.0
0x00000038fd8022c0  0x00000038fd8050bc  Yes (*)     /lib64/librt.so.1
0x00007ff88ebaebb0  0x00007ff88ef3d098  Yes (*)     /usr/lib64/python2.7/site-packages/PyQt4/QtGui.so
0x000000307dbb63b0  0x000000307e218f00  Yes (*)     /lib64/libQtGui.so.4
0x0000003901003760  0x000000390100ce70  Yes (*)     /lib64/libXext.so.6
0x000000390081df60  0x00000039008a15ac  Yes (*)     /lib64/libX11.so.6
0x0000003903804f50  0x00000039038200b0  Yes (*)     /lib64/libpng15.so.15
0x000000390240cec0  0x0000003902475db0  Yes (*)     /lib64/libfreetype.so.6
0x000000307c80aad0  0x000000307c837b60  Yes (*)     /lib64/libgobject-2.0.so.0
0x0000003916c01c20  0x0000003916c05b40  Yes (*)     /lib64/libSM.so.6
0x0000003916804f30  0x0000003916811e8c  Yes (*)     /lib64/libICE.so.6
0x0000003904002230  0x000000390400bf54  Yes (*)     /lib64/libXi.so.6
0x0000003902001b00  0x00000039020077c8  Yes (*)     /lib64/libXrender.so.1
0x0000003903001ba0  0x00000039030070c8  Yes (*)     /lib64/libXrandr.so.2
0x000000390d801580  0x000000390d8037c8  Yes (*)     /lib64/libXfixes.so.3
0x000000390d002ab0  0x000000390d0074b0  Yes (*)     /lib64/libXcursor.so.1
0x0000003903c00b40  0x0000003903c01424  Yes (*)     /lib64/libXinerama.so.1
0x0000003903406ae0  0x000000390342313c  Yes (*)     /lib64/libfontconfig.so.1
0x0000003900009a00  0x00000039000150a8  Yes (*)     /lib64/libxcb.so.1
0x00000038ff001870  0x00000038ff005f58  Yes (*)     /lib64/libffi.so.6
0x0000003904801510  0x0000003904802ad0  Yes (*)     /lib64/libuuid.so.1
0x0000003902803e00  0x000000390281cc1c  Yes (*)     /lib64/libexpat.so.1
0x0000003900400ec0  0x0000003900401b3c  Yes (*)     /lib64/libXau.so.6
0x00007ff88e7e8f60  0x00007ff88e7ed764  Yes (*)     /usr/lib64/python2.7/lib-dynload/_json.so
0x00007ff88e5e21d0  0x00007ff88e5e424c  Yes (*)     /usr/lib64/python2.7/lib-dynload/binascii.so
0x00007ff88e3dd680  0x00007ff88e3ded7c  Yes (*)     /usr/lib64/gconv/UTF-16.so
0x0000003922498520  0x0000003922596c94  Yes (*)     /lib64/libicui18n.so.50
0x00007ff88e0b91a0  0x00007ff88e167e78  Yes (*)     /lib64/libicuuc.so.50
0x000000391a400570  0x000000391a400658  Yes (*)     /lib64/libicudata.so.50
0x000000308080b680  0x0000003080822b30  Yes (*)     /lib64/libgconf-2.so.4
0x000000307c401120  0x000000307c401fd8  Yes (*)     /lib64/libgmodule-2.0.so.0
0x000000307f00a570  0x000000307f01bbb4  Yes (*)     /lib64/libdbus-glib-1.so.2
0x0000003aa6607840  0x0000003aa662fc64  Yes (*)     /lib64/libdbus-1.so.3
0x000000307cc30970  0x000000307cce8ccc  Yes (*)     /lib64/libgio-2.0.so.0
0x000000307f469130  0x000000307f6ebec0  Yes (*)     /lib64/libgtk-x11-2.0.so.0
0x000000307ec1e570  0x000000307ec7c694  Yes (*)     /lib64/libgdk-x11-2.0.so.0
0x000000307e804800  0x000000307e809108  Yes (*)     /lib64/libpangocairo-1.0.so.0
0x00007ff88de0d160  0x00007ff88de18764  Yes (*)     /lib64/libatk-1.0.so.0
0x0000003aa7a13480  0x0000003aa7ada528  Yes (*)     /lib64/libcairo.so.2
0x00007ff88dbe67f0  0x00007ff88dbf9970  Yes (*)     /lib64/libgdk_pixbuf-2.0.so.0
0x00007ff88d9d2260  0x00007ff88d9da2dc  Yes (*)     /lib64/libpangoft2-1.0.so.0
0x00007ff88d78dde0  0x00007ff88d7ac1d8  Yes (*)     /lib64/libpango-1.0.so.0
0x0000003906800c60  0x0000003906801638  Yes (*)     /lib64/libXcomposite.so.1
0x000000390dc00bd0  0x000000390dc014ec  Yes (*)     /lib64/libXdamage.so.1
0x00007ff88d5350d0  0x00007ff88d567bdc  Yes (*)     /lib64/libharfbuzz.so.0
0x000000390c80a4e0  0x000000390c8905cc  Yes (*)     /lib64/libpixman-1.so.0
0x0000003aa72059f0  0x0000003aa7216fbc  Yes (*)     /lib64/libEGL.so.1
0x000000390e000b10  0x000000390e0011d4  Yes (*)     /lib64/libxcb-shm.so.0
0x0000003909403590  0x0000003909406050  Yes (*)     /lib64/libxcb-render.so.0
0x0000003aa7655590  0x0000003aa76c14c4  Yes (*)     /usr/lib64/nvidia/libGL.so.1
0x0000003908c02760  0x0000003908c14958  Yes (*)     /lib64/libgraphite2.so.3
0x0000003905000600  0x000000390500070c  Yes (*)     /lib64/libX11-xcb.so.1
0x00000039064018b0  0x00000039064025c8  Yes (*)     /lib64/libxcb-dri2.so.0
0x000000390d4025a0  0x000000390d403dd0  Yes (*)     /lib64/libxcb-xfixes.so.0
0x0000003909c00fb0  0x0000003909c01868  Yes (*)     /lib64/libxcb-shape.so.0
0x0000003aaac02140  0x0000003aaac03bf8  Yes (*)     /lib64/libgbm.so.1
0x0000003907004920  0x0000003907008440  Yes (*)     /lib64/libwayland-client.so.0
0x0000003909805930  0x000000390980a700  Yes (*)     /lib64/libwayland-server.so.0
0x0000003aa6e08e20  0x0000003aa6e118d0  Yes (*)     /lib64/libglapi.so.0
0x0000003901803590  0x000000390180bca0  Yes (*)     /lib64/libudev.so.1
0x0000003dd4803210  0x0000003dd4808014  Yes (*)     /lib64/libdrm.so.2
0x0000003aaa800990  0x0000003aaa8023b3  Yes (*)     /usr/lib64/nvidia/tls/libnvidia-tls.so.331.20
0x0000003aa87e0060  0x0000003aa9649d08  Yes (*)     /usr/lib64/nvidia/libnvidia-glcore.so.331.20
0x00007ff88d2923e0  0x00007ff88d2d4c90  Yes (*)     /lib64/libgnomeui-2.so.0
0x00007ff88d01ced0  0x00007ff88d04f7a0  Yes (*)     /lib64/libbonoboui-2.so.0
0x00007ff88cdd4dc0  0x00007ff88cdf22d0  Yes (*)     /lib64/libgnomecanvas-2.so.0
0x00007ff88cbb91b0  0x00007ff88cbc2b58  Yes (*)     /lib64/libgnome-2.so.0
0x00007ff88c99c080  0x00007ff88c9ad824  Yes (*)     /lib64/libart_lgpl_2.so.2
0x000000307fc17e30  0x000000307fc48ef0  Yes (*)     /lib64/libgnomevfs-2.so.0
0x0000003081007a30  0x0000003081018dc4  Yes (*)     /lib64/libgnome-keyring.so.0
0x00007ff88c74c170  0x00007ff88c773f78  Yes (*)     /lib64/libbonobo-2.so.0
0x00007ff88c513180  0x00007ff88c51ab50  Yes (*)     /lib64/libbonobo-activation.so.4
0x00007ff88c2c0e30  0x00007ff88c2e1a94  Yes (*)     /lib64/libORBit-2.so.0
0x0000003901c2e870  0x0000003901d15060  Yes (*)     /lib64/libxml2.so.2
0x000000390e801cf0  0x000000390e807144  Yes (*)     /lib64/libpopt.so.0
0x00007ff88c093ad0  0x00007ff88c0971e0  Yes (*)     /lib64/libgailutil.so.18
0x00000039230033f0  0x000000392300bfac  Yes (*)     /lib64/libcanberra.so.0
0x0000003082c00de0  0x0000003082c01be4  Yes (*)     /lib64/libavahi-glib.so.1
0x000000391f003530  0x000000391f00867c  Yes (*)     /lib64/libavahi-common.so.3
0x0000003aad4039d0  0x0000003aad40bc38  Yes (*)     /lib64/libavahi-client.so.3
0x000000390ec07700  0x000000390ec55148  Yes (*)     /lib64/libgcrypt.so.11
0x00007ff88be8d240  0x00007ff88be8dbe8  Yes (*)     /lib64/libORBitCosNaming-2.so.0
0x0000003900c02f30  0x0000003900c187a0  Yes (*)     /lib64/liblzma.so.5
0x000000391e2020f0  0x000000391e20626c  Yes (*)     /lib64/libvorbisfile.so.3
0x0000003918803850  0x000000391881afc0  Yes (*)     /lib64/libvorbis.so.0
0x0000003918401aa0  0x0000003918404078  Yes (*)     /lib64/libogg.so.0
0x0000003920c02590  0x0000003920c0c334  Yes (*)     /lib64/libtdb.so.1
0x0000003917c024b0  0x0000003917c06668  Yes (*)     /lib64/libltdl.so.7
0x000000390e4009c0  0x000000390e401018  Yes (*)     /lib64/libgpg-error.so.0
0x0000003914400ec0  0x0000003914405b1c  Yes (*)     /lib64/libcrypt.so.1
0x0000003904c03600  0x0000003904c55cf0  Yes (*)     /lib64/libfreebl3.so
0x00007ff88bc81540  0x00007ff88bc8656c  Yes (*)     /usr/lib64/gtk-2.0/2.10.0/engines/libpixmap.so
0x00007ff88ba7c3a0  0x00007ff88ba7cc5c  Yes (*)     /usr/lib64/gtk-2.0/2.10.0/engines/libadwaita.so
0x00007ff88b8796e0  0x00007ff88b8797e4  Yes (*)     /usr/lib64/gtk-2.0/modules/libpk-gtk-module.so
0x00007ff88b6751d0  0x00007ff88b677190  Yes (*)     /usr/lib64/gtk-2.0/modules/libcanberra-gtk-module.so
0x00007ff88b44ed80  0x00007ff88b4501a0  Yes (*)     /lib64/libcanberra-gtk.so.0
0x00007ff88b1dbe00  0x00007ff88b1dc2e8  Yes (*)     /usr/lib64/python2.7/lib-dynload/grpmodule.so
0x00007ff88afa8d20  0x00007ff88afb7c6c  Yes (*)     /usr/lib64/python2.7/lib-dynload/_io.so
0x00007ff88ad9a500  0x00007ff88ad9d73c  Yes (*)     /usr/lib64/python2.7/lib-dynload/math.so
0x00007ff88ab95910  0x00007ff88ab96468  Yes (*)     /usr/lib64/python2.7/lib-dynload/_hashlib.so
0x00007ff88a9912a0  0x00007ff88a991ef8  Yes (*)     /usr/lib64/python2.7/lib-dynload/_randommodule.so
0x00007ff88a78ce60  0x00007ff88a78db74  Yes (*)     /usr/lib64/python2.7/lib-dynload/fcntlmodule.so
0x00007ff88a586d40  0x00007ff88a588588  Yes (*)     /usr/lib64/python2.7/lib-dynload/selectmodule.so
0x00007ff8893754d0  0x00007ff889378494  Yes (*)     /usr/lib64/qt4/plugins/imageformats/libqgif.so
0x00007ff88916d8c0  0x00007ff8891705e0  Yes (*)     /usr/lib64/qt4/plugins/imageformats/libqico.so
0x00007ff888f66190  0x00007ff888f68a84  Yes (*)     /usr/lib64/qt4/plugins/imageformats/libqjpeg.so
0x0000003912c03c90  0x0000003912c3a100  Yes (*)     /lib64/libjpeg.so.62
0x00007ff888d5eca0  0x00007ff888d60094  Yes (*)     /usr/lib64/qt4/plugins/imageformats/libqmng.so
0x00007ff888ae05b0  0x00007ff888b24cf4  Yes (*)     /lib64/libmng.so.1
0x0000003910807670  0x000000391082aea0  Yes (*)     /lib64/liblcms.so.1
0x00007ff8888c49d0  0x00007ff8888c5da8  Yes (*)     /usr/lib64/qt4/plugins/imageformats/libqsvg.so
0x00007ff88867e350  0x00007ff8886af8c8  Yes (*)     /lib64/libQtSvg.so.4
0x00007ff888438530  0x00007ff888459cc0  Yes (*)     /lib64/libQtXml.so.4
0x00007ff8882244c0  0x00007ff888225930  Yes (*)     /usr/lib64/qt4/plugins/imageformats/libqtga.so
0x00007ff88801cbb0  0x00007ff88801f824  Yes (*)     /usr/lib64/qt4/plugins/imageformats/libqtiff.so
0x00007ff883d95310  0x00007ff883dd0324  Yes (*)     /lib64/libtiff.so.5
0x00007ff883b82060  0x00007ff883b889e0  Yes (*)     /lib64/libjbig.so.2.0
0x00007ff881b79a90  0x00007ff881b7f744  Yes (*)     /usr/lib64/python2.7/site-packages/qutepart/syntax/cParser.so
0x00007ff88186b4d0  0x00007ff88187016c  Yes (*)     /usr/lib64/python2.7/lib-dynload/pyexpat.so
0x00007ff880460e00  0x00007ff8804667f8  Yes (*)     /usr/lib64/gnome-vfs-2.0/modules/libfile.so
0x00000039158013d0  0x000000391580341c  Yes (*)     /lib64/libattr.so.1
0x0000003aacc01f80  0x0000003aacc05cd4  Yes (*)     /lib64/libacl.so.1
0x00007ff8802558d0  0x00007ff880259058  Yes (*)     /lib64/libfam.so.0
0x00007ff8800491e0  0x00007ff8800503cc  Yes (*)     /lib64/libnss_files.so.2
(*): Shared library is missing debugging information.
$1 = 0x0
No symbol table is loaded.  Use the "file" command.
rax            0x8  8
rbx            0x700000000  30064771072
rcx            0x81 129
rdx            0x7fff959882a0   140735703188128
rsi            0x80 128
rdi            0x80 128
rbp            0x7fff95988220   0x7fff95988220
rsp            0x7fff95988170   0x7fff95988170
r8             0x0  0
r9             0x81 129
r10            0x0  0
r11            0x7fff95987ef0   140735703187184
r12            0x7fff95988320   140735703188256
r13            0x700000081  30064771201
r14            0x81 129
r15            0x2f2f3a7074746827   3400000498352547879
rip            0x7ff881b7e2c8   0x7ff881b7e2c8 <keyword_tryMatch+152>
eflags         0x10293  [ CF AF SF IF RF ]
cs             0x33 51
ss             0x2b 43
ds             0x0  0
es             0x0  0
fs             0x0  0
gs             0x0  0
st0            *value not available*
st1            *value not available*
st2            *value not available*
st3            *value not available*
st4            *value not available*
st5            *value not available*
st6            *value not available*
st7            *value not available*
fctrl          *value not available*
fstat          *value not available*
ftag           *value not available*
fiseg          *value not available*
fioff          *value not available*
foseg          *value not available*
fooff          *value not available*
fop            *value not available*
xmm0           *value not available*
xmm1           *value not available*
xmm2           *value not available*
xmm3           *value not available*
xmm4           *value not available*
xmm5           *value not available*
xmm6           *value not available*
xmm7           *value not available*
xmm8           *value not available*
xmm9           *value not available*
xmm10          *value not available*
xmm11          *value not available*
xmm12          *value not available*
xmm13          *value not available*
xmm14          *value not available*
xmm15          *value not available*
mxcsr          *value not available*
Dump of assembler code for function keyword_tryMatch:
   0x00007ff881b7e230 <+0>: push   %r15
   0x00007ff881b7e232 <+2>: push   %r14
   0x00007ff881b7e234 <+4>: push   %r13
   0x00007ff881b7e236 <+6>: push   %r12
   0x00007ff881b7e238 <+8>: push   %rbp
   0x00007ff881b7e239 <+9>: mov    %rdi,%rbp
   0x00007ff881b7e23c <+12>:    push   %rbx
   0x00007ff881b7e23d <+13>:    sub    $0x28,%rsp
   0x00007ff881b7e241 <+17>:    mov    0x5c(%rdx),%eax
   0x00007ff881b7e244 <+20>:    mov    %rsi,0x18(%rsp)
   0x00007ff881b7e249 <+25>:    test   %eax,%eax
   0x00007ff881b7e24b <+27>:    mov    %eax,0x14(%rsp)
   0x00007ff881b7e24f <+31>:    jle    0x7ff881b7e310 <keyword_tryMatch+224>
   0x00007ff881b7e255 <+37>:    mov    0x18(%rsp),%rcx
   0x00007ff881b7e25a <+42>:    mov    0x14(%rsp),%edi
   0x00007ff881b7e25e <+46>:    lea    0xe0(%rdx),%r12
   0x00007ff881b7e265 <+53>:    add    $0x60,%rdx
   0x00007ff881b7e269 <+57>:    movslq %edi,%rsi
   0x00007ff881b7e26c <+60>:    cmpb   $0x0,0x620(%rcx)
   0x00007ff881b7e273 <+67>:    mov    0x20(%rcx,%rsi,8),%rbx
   0x00007ff881b7e278 <+72>:    mov    %rsi,0x8(%rsp)
   0x00007ff881b7e27d <+77>:    cmove  %rdx,%r12
   0x00007ff881b7e281 <+81>:    test   %rbx,%rbx
   0x00007ff881b7e284 <+84>:    je     0x7ff881b7e310 <keyword_tryMatch+224>
   0x00007ff881b7e28a <+90>:    lea    0x1(%rdi),%r9d
   0x00007ff881b7e28e <+94>:    mov    0x420(%rcx,%rsi,4),%ecx
   0x00007ff881b7e295 <+101>:   mov    $0x8,%eax
   0x00007ff881b7e29a <+106>:   cmp    $0x7,%r9d
   0x00007ff881b7e29e <+110>:   cmovbe %eax,%r9d
   0x00007ff881b7e2a2 <+114>:   imul   %r9d,%ecx
   0x00007ff881b7e2a6 <+118>:   movslq %ecx,%rcx
   0x00007ff881b7e2a9 <+121>:   lea    (%rbx,%rcx,1),%r13
   0x00007ff881b7e2ad <+125>:   cmp    %r13,%rbx
   0x00007ff881b7e2b0 <+128>:   je     0x7ff881b7e310 <keyword_tryMatch+224>
   0x00007ff881b7e2b2 <+130>:   mov    (%r12),%r15
   0x00007ff881b7e2b6 <+134>:   movslq %r9d,%r14
   0x00007ff881b7e2b9 <+137>:   jmp    0x7ff881b7e2c8 <keyword_tryMatch+152>
   0x00007ff881b7e2bb <+139>:   nopl   0x0(%rax,%rax,1)
   0x00007ff881b7e2c0 <+144>:   add    %r14,%rbx
   0x00007ff881b7e2c3 <+147>:   cmp    %rbx,%r13
   0x00007ff881b7e2c6 <+150>:   je     0x7ff881b7e310 <keyword_tryMatch+224>
=> 0x00007ff881b7e2c8 <+152>:   cmp    %r15,(%rbx)
   0x00007ff881b7e2cb <+155>:   jne    0x7ff881b7e2c0 <keyword_tryMatch+144>
   0x00007ff881b7e2cd <+157>:   mov    0x8(%rsp),%rdx
   0x00007ff881b7e2d2 <+162>:   mov    %r12,%rsi
   0x00007ff881b7e2d5 <+165>:   mov    %rbx,%rdi
   0x00007ff881b7e2d8 <+168>:   callq  0x7ff881b79800 <strncmp@plt>
   0x00007ff881b7e2dd <+173>:   test   %eax,%eax
   0x00007ff881b7e2df <+175>:   jne    0x7ff881b7e2c0 <keyword_tryMatch+144>
   0x00007ff881b7e2e1 <+177>:   mov    0x18(%rsp),%rdi
   0x00007ff881b7e2e6 <+182>:   movq   $0x0,0x10(%rbp)
   0x00007ff881b7e2ee <+190>:   movb   $0x0,0x18(%rbp)
   0x00007ff881b7e2f2 <+194>:   mov    0x10(%rdi),%rdx
   0x00007ff881b7e2f6 <+198>:   mov    %rdi,0x0(%rbp)
   0x00007ff881b7e2fa <+202>:   cmpb   $0x0,0x38(%rdx)
   0x00007ff881b7e2fe <+206>:   cmove  0x14(%rsp),%eax
   0x00007ff881b7e303 <+211>:   mov    %eax,0x8(%rbp)
   0x00007ff881b7e306 <+214>:   jmp    0x7ff881b7e32b <keyword_tryMatch+251>
   0x00007ff881b7e308 <+216>:   nopl   0x0(%rax,%rax,1)
   0x00007ff881b7e310 <+224>:   movq   $0x0,0x0(%rbp)
   0x00007ff881b7e318 <+232>:   movl   $0x0,0x8(%rbp)
   0x00007ff881b7e31f <+239>:   movq   $0x0,0x10(%rbp)
   0x00007ff881b7e327 <+247>:   movb   $0x0,0x18(%rbp)
   0x00007ff881b7e32b <+251>:   add    $0x28,%rsp
   0x00007ff881b7e32f <+255>:   mov    %rbp,%rax
   0x00007ff881b7e332 <+258>:   pop    %rbx
   0x00007ff881b7e333 <+259>:   pop    %rbp
   0x00007ff881b7e334 <+260>:   pop    %r12
   0x00007ff881b7e336 <+262>:   pop    %r13
   0x00007ff881b7e338 <+264>:   pop    %r14
   0x00007ff881b7e33a <+266>:   pop    %r15
   0x00007ff881b7e33c <+268>:   retq   
End of assembler dump.
andreikop commented 10 years ago

Enki displayed the file quickly, but as I scrolled down I noticed that it was not fully colored (syntax highlighting). Suddenly it got colours, but again further down it was all black. This happened several times, showing that Enki was coloring it.

I'm happy. It is expected behavior.

Opening Enki again showed again the wicked file, so I closed it quickly before the memory leak happened. However, in the background, it kept on leaking and crashed again. It seems like it stills tries to give color to an already-closed file.

Yes, you are right. Fixed

In the mean time, Enki was eating all the memory it could, until ~2.1 GiB. Then it crashed (segment violation) and closed. Testing the same file with Gedit showed that, while it was quite slower, it made it work with only ~420 MiB of RAM. Doing the same test with mysql-workbench gave the best results, opening it almost instantly with full syntax highlight, from start to end.

This part is the most difficult. Being cool universal source code editor, and cool data dump editor are conflicting goals. I use PyQt, it allows be to develop GUI quicker, but, yes, Enki eats much more memory than Gedit, and is much slower, than mysql-workbench, which is specialized solution. It is unlikely will be fixed in the future. Just use Enki to edit code, and mysql-workbench to edit data dumps.

I'll think about some workaround, like disabling highlighting if file is more than 100K LOC

yajo commented 10 years ago

Opening Enki again showed again the wicked file, so I closed it quickly before the memory leak happened. However, in the background, it kept on leaking and crashed again. It seems like it stills tries to give color to an already-closed file.

Yes, you are right. Fixed

Happy to help.

This part is the most difficult. Being cool universal source code editor, and cool data dump editor are conflicting goals. I use PyQt, it allows be to develop GUI quicker, but, yes, Enki eats much more memory than Gedit, and is much slower, than mysql-workbench, which is specialized solution. It is unlikely will be fixed in the future. Just use Enki to edit code, and mysql-workbench to edit data dumps.

I imagined that it would be something like that, but I wanted you to be aware.

I'll think about some workaround, like disabling highlighting if file is more than 100K LOC

It would be a good workaround indeed.

andreikop commented 10 years ago

I imagined that it would be something like that, but I wanted you to be aware.

Thank you for the information! And for useful bugreport about closed file highlighting.

andreikop commented 10 years ago

Done. Now Enki doesn't highlight files, which are more than 100 K LOC. (But, if file was smaller, when opened, highlighting is not disabled)