Hi,

This bug is only present on Linux!

In the attachment is an example of the error. How to reproduce it:
Without changing any text inside the QScintilla editor, set the cursor to the 
beginning of the first line, press and hold the CTRL key and drag the mouse to 
the end of the first line. After selecting a few characters, usually more than 
5 or 6, the example throws a exception, something like:

*** Error in `/usr/bin/python3': free(): invalid next size (fast): 0x01e8d3e8 
***
Aborted

The error appears to happen when calling the selectedText method, while the 
CTRL key is pressed and changing the selected text with the mouse.
The returned string from selectedText is not correct, which is visible in the 
console window in the example just before the exception is thrown.

This error was found and reproduced in multiple editors, including: ExCo, 
mu-editor and meditor.
Probably every editor based on QScintilla has this issue.

Tested on:

  *   Lubuntu x64, PyQt 5.11.2, QScintilla 2.11.4
  *   Raspbian RaspberryPI 3 (arm), PyQt 5.7, QScintilla 2.9.3

Regards,
Matic
import PyQt5.QtWidgets
import PyQt5.Qsci
import sys
    

# Create the main PyQt application object
application = PyQt5.QtWidgets.QApplication(sys.argv)

# Create a QScintila editor instance
editor = PyQt5.Qsci.QsciScintilla()
editor.setText(" " * 64)
def test(*args):
    print("'", editor.selectedText(), "'")
editor.selectionChanged.connect(test)

# For the QScintilla editor to properly process events we need to add it to
# a QMainWindow object.
main_window = PyQt5.QtWidgets.QMainWindow()
# Set the central widget of the main window to be the editor
main_window.setCentralWidget(editor)
# Resize the main window and show it on the screen
main_window.resize(800, 600)
main_window.show()

# Execute the application
application.exec_()
_______________________________________________
QScintilla mailing list
[email protected]
https://www.riverbankcomputing.com/mailman/listinfo/qscintilla

Reply via email to