-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Initial workaround for Qt5.10 instability #6301
Conversation
Wow, nice catch @manisandro! I'm wondering - does calling
In the destructor avoid the hangs? I'll rework the layout tool to avoid the second issue |
Yep clearing the focus proxy in the destructor also seems to work, commit updated. |
@manisandro not for me under macos :-(, previous workaround was working pretty fine |
Oh, ok... So back to the first attempt I suppose ;) |
@slarosa what about deleting the focusProxy() in the destructor? |
@nyalldawson the following does not work for me. QgsCollapsibleGroupBoxBasic::~QgsCollapsibleGroupBoxBasic()
{
delete focusProxy();
} |
Ok, next check Remove the parent from mCollapseButton, and in the destructor call mCollapseButton->deleteLater() Also try with just
|
I had already tried that :-) |
wait...I tried the |
And having no parent changes nothing? |
I'm testing with a bottle of coffee, it's one at night :-) |
Yeah, this has worked! |
This is such a relief to see this being addressed. Keep up the great work. |
So no parent, and the deleteLater? |
@nyalldawson just using no parent it works fine, it seems like the deleting is not necessary. There is only a problem: the So, under macOS:
|
Damn. No parent no delete would be a leak, so it's not an option anyway. New test:
|
the crash is there yet :-( |
@slarosa Can you get a valgrind output of |
@manisandro I will do, not matter if on destructor or closeEvent, right? |
at the moment I am struggle with this valgrind issue https://bugs.kde.org/show_bug.cgi?id=382998 |
also....why would main options and vector properties are freezing while raster properties not??? |
Judging from valgrind there are lots of reads to freed memory going on (without the workaround of disabling the focus proxy). That is undefined behaviour, what happens depends on what memory you have close to the blocks being read etc. If the memory segment is in a block not assigned to the application, the OS will terminate the application with a SIGSEGV, but if the access is still in a block assigned to the application, then the application can very well continue working, with potentially random side effects. I'd still be interested in a valgrind trace of "setFocusProxy( nullptr )" in the destructor, since on my machine this makes valgrind happy, so I wonder if people still experiencing crashes with that fix are hitting a different issue. In general, I'd recomment fixes for this issue to be tested with valgrind. |
thanks for your explanations. I will give a try at valgrind on mac but I have no experience there. |
I have it in place, but I would need some guidelines how to use. Or I could share my screen if one ants to do it directly. |
Just
then trigger what you want to investigate, and if memory errors occur, the log file will contain corresponding warnings. You'll need a qgis build with debug infos to have a readable output. Note that valgrind measurably slows down the application - this is normal. Another memory debugging tool is Address Sanitizer, which is built into recentish gcc and clang compilers. To use it, recompile the entire code with |
Thanks, I have no luck with build type.
It's a
|
Hmm any luck with |
There was an ancient attempt to get asan on the Travis builds by @m-kuhn. I usually cherry-pick some of the commits from https://github.com/nyalldawson/QGIS/commits/asan2 When testing with it (ignore the failed Travis clang commits) |
Our release is fast approaching (Feb 23), if we can't come with a perfect solution by then, could we push something temporary targeting qt 5.10, #if QT_VERSION..., to prevent crash until we have a better solution? |
+1 : I guess we don't loose much leaving out |
Since QGIS OSX is served through homebrew and it runs Qt 5.10, let's temporarily loose this bit to keep mac users happy. |
Added corresponding |
Travis failure unrelated. @nyalldawson , @3nids , should we merge this now? |
would be great to add a link to this discussion too in the comment. |
…inst Qt5.10+, it causes crashes
FWIW, issue is also present with 5.10.1. I've added a reference to this ticket as a comment. |
Issue is also present in 5.11.0 |
After staring at valgrind a bit I noticed that QgsCollapsibleGroupBox was always involved in all those crashes when closing dialogs when compiled against Qt5.10. Gradually expanding from a valilla QGroupBox to the QgsCollapsibleGroupBox revealed that
is somehow responsible for all those crashes when closing dialogs. I'd say for a start we can just comment it out.
@nyalldawson There is a second source of crashes which I believe affects Qt5 in general:
All
QgsLayoutViewTool
are constructed withQgsLayoutView
as parent, and in their destructor havewith
mView
being aQPointer<QgsLayoutView>
. WhenQgsLayoutView
is destroyed, all the childQgsLayoutViewTool
get destroyed as well, as per standardQObject
behaviour. The problem is that at the time~QgsLayoutViewTool
is called, themView
isn't yet reset to null becase, according to theQPointer
documentation, starting with Qt5+:So this means that in
~QgsLayoutViewTool
,mView->unsetTool
is called on a half-destroyedmView
.