Bug 329940 - KAlgebra takes a very long time to load, and uses 100% of CPU resources while loading.
Summary: KAlgebra takes a very long time to load, and uses 100% of CPU resources while...
Status: RESOLVED FIXED
Alias: None
Product: kalgebra
Classification: Applications
Component: general (show other bugs)
Version: 0.11
Platform: Mint (Ubuntu based) Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
: 329035 330339 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-01-14 01:04 UTC by skyclear242
Modified: 2014-03-11 00:49 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description skyclear242 2014-01-14 01:04:51 UTC
When I start KAlgebra, It doesn't show up on the screen right away. It loads for a very long time (about 9 minutes), and while it loads it uses 100% of resources on my first CPU core (I have AMD Athlon 2 X3 455 CPU).

Reproducible: Always

Steps to Reproduce:
1. Just start KAlgebra.
Actual Results:  
KAlgebra loaded after 9 minutes during which it used 100% of CPU resources (on the first core).

Expected Results:  
It should have loaded much faster, after like 2 seconds.

CPU: AMD Athlon 2 X3 455 3.3 GHz
GPU: NVIDIA GeForce 9500GT
Distro: Linux Mint 16 KDE (64-Bit)
Comment 1 Aleix Pol 2014-01-14 01:09:22 UTC
That shouldn't be happening, here it starts instantly.

Can you provide more information maybe?
Comment 2 skyclear242 2014-01-14 01:29:46 UTC
(In reply to comment #1)
> That shouldn't be happening, here it starts instantly.
> 
> Can you provide more information maybe?

I don't know what else to post. What other info should I post?

By the way, I just found another bug in KAlgebra:

I click on the dictionary tab, and then I click on the word "sin", and the program hangs forever.
The CPU usage also goes up to 100%.

It happens every time I do this.

Should I file this bug also?

Please let me know what other info would be helpful.
Comment 3 skyclear242 2014-01-14 07:17:01 UTC
(In reply to comment #1)
> Can you provide more information maybe?

I started the program, and while it hanged at the start, I interrupted it with Ctrl+C so I could do a backtrace. Here's the backtrace:

Starting program: /usr/bin/kalgebra 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGINT, Interrupt.
0x00007ffff36463c9 in ?? () from /lib/x86_64-linux-gnu/libc.so.6

Thread 1 (Thread 0x7ffff7fb67c0 (LWP 5468)):
#0  0x00007ffff36463c9 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff40476fb in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#2  0x00007ffff40478bd in QString::arg(QString const&, int, QChar const&) const
    () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#3  0x00007ffff5c43aab in ?? () from /usr/lib/x86_64-linux-gnu/libQtXml.so.4
#4  0x00007ffff5c4b88f in ?? () from /usr/lib/x86_64-linux-gnu/libQtXml.so.4
#5  0x00007ffff5c4cf00 in ?? () from /usr/lib/x86_64-linux-gnu/libQtXml.so.4
#6  0x00007ffff5c4d576 in ?? () from /usr/lib/x86_64-linux-gnu/libQtXml.so.4
#7  0x00007ffff5c4dd60 in ?? () from /usr/lib/x86_64-linux-gnu/libQtXml.so.4
#8  0x00007ffff5c4f945 in ?? () from /usr/lib/x86_64-linux-gnu/libQtXml.so.4
#9  0x00007ffff5c4fce8 in QXmlSimpleReader::parse(QXmlInputSource const*, bool)
    () from /usr/lib/x86_64-linux-gnu/libQtXml.so.4
#10 0x00007ffff5c39124 in ?? () from /usr/lib/x86_64-linux-gnu/libQtXml.so.4
#11 0x00007ffff5c3c834 in ?? () from /usr/lib/x86_64-linux-gnu/libQtXml.so.4
#12 0x00007ffff5c3c8cb in QDomDocument::setContent(QString const&, bool, QString*, int*, int*) () from /usr/lib/x86_64-linux-gnu/libQtXml.so.4
#13 0x000000000042deaf in MmlDocument::setContent(QString, QString*, int*, int*) ()
#14 0x000000000042e003 in QtMmlWidget::setContent(QString const&, QString*, int*, int*) ()
#15 0x000000000041b49a in Dictionary::Dictionary (this=0xcdae90, 
    p=<optimized out>) at ../../src/dictionary.cpp:85
#16 0x0000000000419fde in KAlgebra::KAlgebra (this=0x889780, 
    parent=<optimized out>) at ../../src/kalgebra.cpp:336
#17 0x0000000000415526 in main (argc=1, argv=0x7fffffffddb8)
    at ../../src/main.cpp:37
A debugging session is active.

	Inferior 1 [process 5468] will be killed.

Quit anyway? (y or n)
Comment 4 skyclear242 2014-01-15 00:06:30 UTC
Here's a backtrace with qt debufg symbols installed:

Program received signal SIGINT, Interrupt.
replaceArgEscapes (s=..., d=..., field_width=field_width@entry=0, arg=..., 
    larg=..., fillChar=...) at tools/qstring.cpp:6462
6462	tools/qstring.cpp: No such file or directory.

Thread 1 (Thread 0x7ffff7fb67c0 (LWP 12718)):
#0  replaceArgEscapes (s=..., d=..., field_width=field_width@entry=0, arg=..., 
    larg=..., fillChar=...) at tools/qstring.cpp:6462
#1  0x00007ffff40478bd in QString::arg (this=this@entry=0x7fffffffd2f0, a=..., 
    fieldWidth=fieldWidth@entry=0, fillChar=...) at tools/qstring.cpp:6585
#2  0x00007ffff5c43aab in QXmlSimpleReaderPrivate::isExpandedEntityValueTooLarge (this=this@entry=0xd355f0, errorMessage=errorMessage@entry=0x7fffffffd4d0)
    at sax/qxml.cpp:6656
#3  0x00007ffff5c4b88f in QXmlSimpleReaderPrivate::parseEntityDecl (
    this=this@entry=0xd355f0) at sax/qxml.cpp:6781
#4  0x00007ffff5c4cf00 in QXmlSimpleReaderPrivate::parseMarkupdecl (
    this=this@entry=0xd355f0) at sax/qxml.cpp:5399
#5  0x00007ffff5c4d576 in QXmlSimpleReaderPrivate::parseDoctype (
    this=this@entry=0xd355f0) at sax/qxml.cpp:5033
#6  0x00007ffff5c4dd60 in QXmlSimpleReaderPrivate::parseProlog (this=0xd355f0)
    at sax/qxml.cpp:3788
#7  0x00007ffff5c4f945 in QXmlSimpleReaderPrivate::parseBeginOrContinue (
    this=this@entry=0xd355f0, state=state@entry=0, 
    incremental=incremental@entry=false) at sax/qxml.cpp:3493
#8  0x00007ffff5c4fce8 in QXmlSimpleReader::parse (this=<optimized out>, 
    input=0x7fffffffd900, incremental=<optimized out>) at sax/qxml.cpp:3447
#9  0x00007ffff5c39124 in QDomDocumentPrivate::setContent (
    this=this@entry=0xd35400, source=source@entry=0x7fffffffd900, 
    reader=reader@entry=0x7fffffffd8a0, errorMsg=errorMsg@entry=0x0, 
    errorLine=errorLine@entry=0x0, errorColumn=errorColumn@entry=0x0)
    at dom/qdom.cpp:6248
#10 0x00007ffff5c3c834 in QDomDocumentPrivate::setContent (this=0xd35400, 
    source=source@entry=0x7fffffffd900, 
    namespaceProcessing=namespaceProcessing@entry=false, 
    errorMsg=errorMsg@entry=0x0, errorLine=errorLine@entry=0x0, 
    errorColumn=errorColumn@entry=0x0) at dom/qdom.cpp:6228
#11 0x00007ffff5c3c8cb in QDomDocument::setContent (this=0x7fffffffd9c0, 
    text=..., namespaceProcessing=<optimized out>, errorMsg=0x0, 
    errorLine=0x0, errorColumn=0x0) at dom/qdom.cpp:6680
#12 0x000000000042deaf in MmlDocument::setContent(QString, QString*, int*, int*) ()
#13 0x000000000042e003 in QtMmlWidget::setContent(QString const&, QString*, int*, int*) ()
#14 0x000000000041b49a in Dictionary::Dictionary (this=0xcdb350, 
    p=<optimized out>) at ../../src/dictionary.cpp:85
#15 0x0000000000419fde in KAlgebra::KAlgebra (this=0x88b3e0, 
    parent=<optimized out>) at ../../src/kalgebra.cpp:336
#16 0x0000000000415526 in main (argc=1, argv=0x7fffffffddb8)
    at ../../src/main.cpp:37
Comment 5 Aleix Pol 2014-01-15 00:18:18 UTC
Looks like a but in QtMmlWidget, will look into this.

Thanks for the bug report!!
Comment 6 Gauss 2014-01-15 09:37:29 UTC
I can confirm this bahaviour for Kubuntu 13.10. 
KAlgebra takes several minutes to start and produces a high CPU load while loading.
Comment 7 Georg Schlisio 2014-01-22 09:47:59 UTC
this bug has a duplicate one: https://bugs.kde.org/show_bug.cgi?id=329035.

i can confirm very slow start and 100% cpu usage in kalgebra 4.12.1 in official archlinux package.
Comment 8 Jekyll Wu 2014-01-24 08:02:42 UTC
*** Bug 330339 has been marked as a duplicate of this bug. ***
Comment 9 Jekyll Wu 2014-01-24 08:02:45 UTC
*** Bug 329035 has been marked as a duplicate of this bug. ***
Comment 10 Simon 2014-03-08 11:13:48 UTC
Confirming for mint 16 xfce 64-bit here. Fully uses 1 core and, in my case, hasn't ever started.
IMHO, importance should be changed to critical (or grave).
Comment 11 Allen Webb 2014-03-09 01:28:04 UTC
I downloaded the source for 4.11.2; and have the same problem. I commented out the dictionary tab and it seemed to fix the problem. It looks like it takes it forever to parse some xml to build the dictionary tab.
Comment 12 Aleix Pol 2014-03-11 00:49:47 UTC
Git commit f97018ef87aef2dd6e40f4d62a88aad90f2ccf38 by Aleix Pol.
Committed on 11/03/2014 at 00:37.
Pushed by apol into branch 'master'.

Stop depending on QtMMLWidget

It was a nice idea, sadly it was not maintained (AFAIK) and it ended up
deeply breaking KAlgebra startup. Not worth it, so long. :/

M  +0    -4    CMakeLists.txt
M  +0    -1    src/CMakeLists.txt
M  +0    -10   src/dictionary.cpp
M  +0    -2    src/dictionary.h

http://commits.kde.org/kalgebra/f97018ef87aef2dd6e40f4d62a88aad90f2ccf38