Bug 256944 - qguiplatformplugin fileDialogSetVisible segs if object is hidden before it's made visible
Summary: qguiplatformplugin fileDialogSetVisible segs if object is hidden before it's ...
Status: RESOLVED WORKSFORME
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR crash
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-15 01:12 UTC by Eckhart Wörner
Modified: 2021-01-08 04:34 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eckhart Wörner 2010-11-15 01:12:56 UTC
Version:           unspecified (using KDE 4.4.5) 
OS:                Linux

This bug has been copied over from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=603480

----

In qguiplatformplugin_kde.cpp:fileDialogSetVisible it has
        if (!kdefd && visible) {

           if(qfd->options() & QFileDialog::DontUseNativeDialog)
                return false;

            kdefd = new KFileDialogBridge(KUrl::fromPath(qfd->directory().canonicalPath()),
                                          qt2KdeFilter(qfd->nameFilters().join(";;")), qfd);

            qfd->setProperty("_k_bridge", QVariant::fromValue(kdefd));
        }

i.e. if you are making this visible and kdefd hasn't been created then create it now.
Most of the contents of the function are guarded by an if (visible) however on line 249 we have
        kdefd->setVisible(visible);

and if you make the object hidden before it's ever been made visible then kdefd will be NULL
and it seg's on line 249.

This is the underlying cause of [Debian] bug 599303 in ktoon which is marked RC.
It makes ktoon unusable for KDE users (although it works for Gnome users!)

I suggest guarding this line with an if (kdefd)  but I don't know the structure to know if that is all that is needed.

Reproducible: Didn't try
Comment 1 Christoph Feck 2010-11-15 15:09:30 UTC
Proposed patch:

Index: qguiplatformplugin_kde.cpp
===================================================================
--- qguiplatformplugin_kde.cpp  (revision 1197348)
+++ qguiplatformplugin_kde.cpp  (working copy)
@@ -214,7 +214,7 @@
     virtual bool fileDialogSetVisible(QFileDialog *qfd, bool visible)
     {
         K_FD(qfd);
-        if (!kdefd && visible) {
+        if (!kdefd) {
             if(qfd->options() & QFileDialog::DontUseNativeDialog)
                 return false;
Comment 2 Eckhart Wörner 2010-11-21 02:30:53 UTC
(In reply to comment #1)
> Proposed patch:

Doesn't that make fileDialogSetVisible(false) unnecessarily expensive? What are the reasons against the original submitter's proposal of guarding the kdefd->setVisible(visible) call?
Comment 3 Justin Zobel 2020-12-09 01:34:23 UTC
Thank you for the report, Eckhart.

As it has been a while since this was reported, can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved.

I have set the bug status to "needsinfo" pending your response, please change back to "reported" or "resolved/worksforme" when you respond, thank you.
Comment 4 Bug Janitor Service 2020-12-24 04:34:32 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Bug Janitor Service 2021-01-08 04:34:02 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!