Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReText 8.0.0 crashes with EOFError and Segmentation fault #597

Closed
szpeter80 opened this issue Oct 22, 2022 · 5 comments
Closed

ReText 8.0.0 crashes with EOFError and Segmentation fault #597

szpeter80 opened this issue Oct 22, 2022 · 5 comments

Comments

@szpeter80
Copy link

How to reproduce?

On a given document, the app starting up with live preview enabled. Scrolling down to the very end of the markdown content with the "down arrow" cursor key (same with "pagedown" key). ReText crashes with the following message:

$ retext 
Using configuration file: /home/pete/.config/ReText project/ReText.conf
Process Process-1:
Traceback (most recent call last):
  File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/tmp/rt/lib/python3.10/site-packages/ReText/converterprocess.py", line 72, in _converter_process_func
    job = receiveObject(conn_child)
  File "/tmp/rt/lib/python3.10/site-packages/ReText/converterprocess.py", line 41, in receiveObject
    sizeBuf = recvall(sock, 4)
  File "/tmp/rt/lib/python3.10/site-packages/ReText/converterprocess.py", line 34, in recvall
    raise EOFError('Received 0 bytes from socket while more bytes were expected. Did the sender process exit unexpectedly?')
EOFError: Received 0 bytes from socket while more bytes were expected. Did the sender process exit unexpectedly?
Segmentation fault (core dumped)
  • the behaviour is possible to replicate, it happened 5 times out of 5 with the same document
  • it was tested in a new venv, venv setup: empty venv + pip install retex, output of pip freeze:
$ pip freeze
chardet==5.0.0
docutils==0.19
Markdown==3.4.1
Markups==3.1.3
Pygments==2.13.0
PyQt6==6.4.0
PyQt6-Qt6==6.4.0
PyQt6-sip==13.4.0
python-markdown-math==0.8
ReText==8.0.0

If live preview is turned off, no amount of scrolling crashes the app. Is there something i can help with troubleshooting ?

@mitya57
Copy link
Member

mitya57 commented Oct 22, 2022

I cannot reproduce this.

Does it happen with any document or only some specific one?

Can you try running PYTHONFAULTHANDLER=1 retext and paste the output?

@szpeter80
Copy link
Author

szpeter80 commented Oct 22, 2022

With the fault handler:

$ PYTHONFAULTHANDLER=1 retext
Using configuration file: /home/pete/.config/ReText project/ReText.conf
Fatal Python error: Segmentation fault

Current thread 0x00007fc09c5b0000 (most recent call first):
  File "/tmp/rt/lib/python3.10/site-packages/ReText/editor.py", line 185 in paintEvent
  File "/tmp/rt/lib/python3.10/site-packages/ReText/__main__.py", line 144 in main
  File "/tmp/rt/bin/retext", line 8 in <module>

Extension modules: PyQt6.QtCore, PyQt6.QtGui, PyQt6.QtWidgets, PyQt6.QtPrintSupport, PyQt6.QtNetwork, PyQt6.QtDBus (total: 6)
Process Process-1:
Traceback (most recent call last):
  File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/tmp/rt/lib/python3.10/site-packages/ReText/converterprocess.py", line 72, in _converter_process_func
    job = receiveObject(conn_child)
  File "/tmp/rt/lib/python3.10/site-packages/ReText/converterprocess.py", line 41, in receiveObject
    sizeBuf = recvall(sock, 4)
  File "/tmp/rt/lib/python3.10/site-packages/ReText/converterprocess.py", line 34, in recvall
    raise EOFError('Received 0 bytes from socket while more bytes were expected. Did the sender process exit unexpectedly?')
EOFError: Received 0 bytes from socket while more bytes were expected. Did the sender process exit unexpectedly?
Segmentation fault (core dumped)

It does happen with an other document as well, but they have a very similar structure (embedded css, tables, and 1-2 linked images about an a4 page each. The images are PNG files exported from draw.io desktop version and have the diagram embedded.

I'm not totally sure, but when this is happening, the markdown pane seems shorter, like the last part of the docs was not there, and when the scrolling hits the end of this, the crash comes.

@mitya57
Copy link
Member

mitya57 commented Oct 23, 2022

Thank you for the information.

Can you please test issue597 branch (commit ecc567a) and check if it fixes the issue for you?

@szpeter80
Copy link
Author

Tested just now, and it is not crashing. Seems like the change resolved the issue! Thanks !

@mitya57
Copy link
Member

mitya57 commented Oct 24, 2022

Thank you! Pushed to master.

This is some strange bug in Qt 6 which was present in as early as 6.1.0. I could not identify the change which broke it, but what I did is a workaround which seems to work.

mitya57 added a commit that referenced this issue Oct 24, 2022
They cause change of vertical scroll bar range, which makes text
at the bottom of the file unreachable.

Fixes #597.

(cherry picked from commit ecc567a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants