olivierkes / manuskript

A open-source tool for writers
http://www.theologeek.ch/manuskript
GNU General Public License v3.0
1.78k stars 236 forks source link

LanguageTool crashes app #1143

Closed thob closed 1 year ago

thob commented 1 year ago

playing around with spellchecking…

Fatal Python error: Segmentation fault

Thread 0x00007f93867fc640 (most recent call first):
  File "/home/theo/.local/lib/python3.10/site-packages/language_tool_python/server.py", line 348 in _consume
  File "/home/theo/.local/lib/python3.10/site-packages/language_tool_python/server.py", line 296 in <lambda>
  File "/usr/lib/python3.10/threading.py", line 953 in run
  File "/usr/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/usr/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x00007f9387fff640 (most recent call first):
  File "/home/theo/.local/lib/python3.10/site-packages/language_tool_python/server.py", line 348 in _consume
  File "/home/theo/.local/lib/python3.10/site-packages/language_tool_python/server.py", line 296 in <lambda>
  File "/usr/lib/python3.10/threading.py", line 953 in run
  File "/usr/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/usr/lib/python3.10/threading.py", line 973 in _bootstrap

Current thread 0x00007f93f14f0000 (most recent call first):
  File "/usr/share/manuskript/manuskript/main.py", line 246 in launch
  File "/usr/share/manuskript/manuskript/main.py", line 312 in run
  File "/usr/bin/manuskript", line 30 in <module>

Extension modules: PyQt5.QtCore, PyQt5.QtGui, PyQt5.QtWidgets, editdistpy.damerau_osa, editdistpy.levenshtein, PyQt5.QtNetwork, PyQt5.QtDBus, PyQt5.QtDesigner, PyQt5.QtHelp, PyQt5.QtPrintSupport, PyQt5.QtTest, PyQt5.QtWebKit, PyQt5.QtWebKitWidgets, PyQt5.QtXml, lxml._elementpath, lxml.etree (total: 16)
Segmentation fault (core dumped)
thob commented 1 year ago

here again, I edited a scene, looks identical to me

Fatal Python error: Segmentation fault

Thread 0x00007f93867fc640 (most recent call first):
  File "/home/theo/.local/lib/python3.10/site-packages/language_tool_python/server.py", line 348 in _consume
  File "/home/theo/.local/lib/python3.10/site-packages/language_tool_python/server.py", line 296 in <lambda>
  File "/usr/lib/python3.10/threading.py", line 953 in run
  File "/usr/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/usr/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x00007f9387fff640 (most recent call first):
  File "/home/theo/.local/lib/python3.10/site-packages/language_tool_python/server.py", line 348 in _consume
  File "/home/theo/.local/lib/python3.10/site-packages/language_tool_python/server.py", line 296 in <lambda>
  File "/usr/lib/python3.10/threading.py", line 953 in run
  File "/usr/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/usr/lib/python3.10/threading.py", line 973 in _bootstrap

Current thread 0x00007f93f14f0000 (most recent call first):
  File "/usr/share/manuskript/manuskript/main.py", line 246 in launch
  File "/usr/share/manuskript/manuskript/main.py", line 312 in run
  File "/usr/bin/manuskript", line 30 in <module>

Extension modules: PyQt5.QtCore, PyQt5.QtGui, PyQt5.QtWidgets, editdistpy.damerau_osa, editdistpy.levenshtein, PyQt5.QtNetwork, PyQt5.QtDBus, PyQt5.QtDesigner, PyQt5.QtHelp, PyQt5.QtPrintSupport, PyQt5.QtTest, PyQt5.QtWebKit, PyQt5.QtWebKitWidgets, PyQt5.QtXml, lxml._elementpath, lxml.etree (total: 16)
Segmentation fault (core dumped)
TheJackiMonster commented 1 year ago

Some questions I have:

thob commented 1 year ago

Also, I observed that LT consumes a lot of CPU for each checking a misspelled word image

TheJackiMonster commented 1 year ago

Okay, I recommend to disable the theme. Qt themes can actually cause segmentation faults (crashes) inside of Qt itself. We can't really fix this in any way on application level. If you can still reproduce it, let me know.

LT processes more text than theoretically necessary every time you make changes to your files. That's why it's this heavy on the CPU. There are ideas how to improve that but they still need to be implemented since it's not trivial. If it's too bad in practice (increasing loading times for example of your files), I recommend switching to a different spellchecker.