-
Notifications
You must be signed in to change notification settings - Fork 42
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
QTBUG-69204 - Upstream Qt stylesheet bug causes segmentation faults #273
Comments
woops let's leave this one open while we track upstream |
Debian Buster comes with pyqt 5.11.3 which does not have the fix (fix first available in |
I think this was closed by accident. I'm going to reopen and provide notes about this upstream bug and how it affects the client. |
DescriptionThis upstream qt bug can cause a segfault in the client. The fix was added to pyqt 5.12.4, but since we install the system library for pyqt using How it's affected usWe became aware of QTBUG-69204 in February 2019 while looking into an issue where the application would segfault with the latest version of pyqt (5.12 at the time) whenever a source was selected from the source list. We were on stretch and the system pyqt library was 5.7.x, so it wasn't a major concern at the time, however, we developed a workaround and started tracking the upstream bug. The fix was released in pyqt 5.12.4 a month after we learned about it but we continued to use the system library for pyqt on stretch. Then, in November 2019, we hit another segfault while upgrading sd-app to buster with pyqt 5.11.3 (also installed using Understanding QTBUG-69204Here's my understanding so far about why we've been seeing segfaults around setting stylesheets and how it was caused by this upstream bug. A widget's stylesheet has a repolish method that calls For instance, the following causes a segfault due to this bug: w = QMainWindow()
s1 = QSplitter()
s2 = QSplitter()
s1.addWidget(s2)
label = QLabel()
label.setTextFormat(Qt.RichText)
s2.addWidget(label)
s1.setStyleSheet('a { b:c; }')
label.setText('hey')
w.setCentralWidget(s1)
w.show() Here's what's happening in this code:
QTBUG-69204 WorkaroundsOur workaround for the February 2019 segfault was to no longer set the stylesheet on the
Here's the workaround:
Here's an alternative workaround:
For the November 2019 segfault workaround, we changed SecureQLabel from RichText to PlainText so that it no longer had a QTextFrame to delete. And last month's workaround was to no longer set the stylesheet on the What's next?One of the goals of #1082 is to move all the CSS into one place and set up a StyleSheet in the application's start method. This makes it much easier for us to know which widgets have StyleSheets that could call the repolish method and trigger the bug. I still think it's a good idea to install a newer version of pyqt in the If anyone has time to investigate further, here is another way you can reproduce this upstream bug: app = QApplication(qt_args)
w = QMainWindow()
conversation = QWidget()
conversation_layout = QVBoxLayout()
conversation.setLayout(conversation_layout)
scroll_widget = QWidget()
scroll_widget_layout = QVBoxLayout()
scroll_widget.setLayout(scroll_widget_layout)
scroll = QScrollArea()
scroll.setWidget(scroll_widget)
conversation_layout.addWidget(scroll)
message = QLabel('hey')
message.setTextInteractionFlags(Qt.TextSelectableByMouse)
conversation.setStyleSheet('a { b:c; }')
scroll_widget_layout.addWidget(message)
w.setCentralWidget(conversation)
w.show()
sys.exit(app.exec_()) |
Update: After having a chat with @redshiftzero I suddenly realized that my knowledge on how PyQt5 gets distributed is old. We can just start using the upstream wheel (importing it to our mirror). We will have to figure out all the library dependencies: I will write a script tomorrow which can find out all the dependencies.
|
To @creviera's point, to install a later version of pyqt5 in
Thoughts? |
I was wondering about how - if we no longer use the buster pyqt5 package - we'd distribute |
We are in luck, it seems the |
For PyQt5.11.3 The dependencies look like:
For PyQt5.14.2 it looks like:
Even though they show dependencies to I used the following script https://gist.github.com/kushaldas/d1e639d58eb86191d2485de0c6a59a0a |
I came across this issue during backlog grooming, and had to reread to jog my memory. Here's what we're waiting on and why this issue is still open:
|
In today's Debian Buster, we don't see any more segfault. Some magic happened somewhere in the last few months. |
Description
See https://bugreports.qt.io/browse/QTBUG-69204
For more info on how we reproduced this bug on the client and our temporary fix, see:
The text was updated successfully, but these errors were encountered: