retext-project / retext

ReText: Simple but powerful editor for Markdown and reStructuredText
GNU General Public License v2.0
1.88k stars 196 forks source link

Retext crashes when synchronised scrolling is enabled #573

Closed regulartim closed 2 years ago

regulartim commented 2 years ago

Hi! :) Whenever I open retext with synchronised scrolling and webkit renderer enabled, it crashes after ~1s with the following message:

Using configuration file: /home/tim/.config/ReText project/ReText.conf
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/ReText/syncscroll.py", line 68, in _handlePreviewResized
    self._updatePreviewScrollPosition()
  File "/usr/lib/python3.10/site-packages/ReText/syncscroll.py", line 137, in _updatePreviewScrollPosition
    pos.setY(preview_scroll_offset)
TypeError: setY(self, int): argument 1 has unexpected type 'float'
Process Process-1:
Traceback (most recent call last):
  File "/usr/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.10/site-packages/ReText/converterprocess.py", line 72, in _converter_process_func
    job = receiveObject(conn_child)
  File "/usr/lib/python3.10/site-packages/ReText/converterprocess.py", line 41, in receiveObject
    sizeBuf = recvall(sock, 4)
  File "/usr/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?
fish: Job 1, 'retext' terminated by signal SIGABRT (Abbruch)

This problem occurred for quite some time, but I did not have the time to take care of it. I could resolve it today by changing line 137 in syncscroll.py to pos.setY(int(preview_scroll_offset)).

mitya57 commented 2 years ago

Hi and thank you for the report!

This bug went unnoticed because it affects only Qt WebKit (not WebEngine) and only with Python 3.10.

I fixed it in retext-7.2 branch now. And I will probably make a new release (7.2.3) when I have time for it.

mitya57 commented 2 years ago

The new release is done now.

fazlerabbi37 commented 1 year ago

It seems the issue is back. On my Ubuntu 20.04 machine, it crashes with the same error. Not sure if #515 is related or not but, trying the fix suggested there did not help as well. I have tested it for both latest 8.0.0 installed via pip, for branch version 7.2.3 (Which uses QT5) and latest commit ecc567a.

cc @mitya57

mitya57 commented 1 year ago

@fazlerabbi37 Please provide the full traceback. It cannot be the same as in this issue.

fazlerabbi37 commented 1 year ago

just did a clean install to produce the log with pip3 install -U ReText PyQt6-WebEngine --no-cache-dir and pip3 install -U markups PyQt6 PyQt6-WebEngine --no-cache-dir for master branch. Both seems to work file. Sorry for the noise! :pray: