Bug 318683 - Opening in Dolphin an unsupported filetype associated to Dolphin by mistake, Dolphin endlessly spawns itself (for instance : unsupported archive format)
Summary: Opening in Dolphin an unsupported filetype associated to Dolphin by mistake, ...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_filetypes (show other bugs)
Version: 4.10.2
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 323531 325795 340374 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-04-21 17:00 UTC by Mahendra Tallur
Modified: 2020-12-29 08:43 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Dolphin: open archives, ignore other files given as arguments (4.29 KB, patch)
2013-10-09 16:11 UTC, erik_hahn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mahendra Tallur 2013-04-21 17:00:45 UTC
I use Dolphin to open archives instead of Ark. I noticed that, when opening RAR archives with Dolphin, a new Dolphin instance is started every second or so. I never stops and it's pretty difficult to stop the process. Sometimes when hitting ALT-F4 repeatedly after letting a couple of windows open, it stops.

All open windows are Dolphin windows, which is expected, although they are empty.

I thought it was due to a corrupt RAR archive but it also happens all the time with any .rar file I just created, containing a single PDF file. If needed I can upload an archive example if relevant.

Reproducible: Always

Steps to Reproduce:
1. Create or download any .rar archive
2. Set Dolphin to open .rar files with Dolphin instead of Ark
3. Double-click on the aforementioned archive
Actual Results:  
Dolphin spaws a new empty window every second, endlessly, until the memory is saturated. If I restart KDE and if KDE was set to re-launch started apps at startup, the process even continues after rebooting.

Expected Results:  
It should just properly open the .rar archive in Dolphin.

Using : Kubuntu 12.10, official Kubuntu KDE PPA. Tried with : unzip, unzip-free, and p7zip installed. Same behaviour with all of them.

I had a similar experience in the past when browing zip files recursively containing other zip files but that's most likely a distinct issue.
Comment 1 Christoph Feck 2013-04-21 18:52:06 UTC
Cannot reproduce, it launches a single Ark instance after opening an empty window.
Do you have third-party kio_rar installed? Dolphin can only open zip and tar.gz archives.
Comment 2 Mahendra Tallur 2013-04-21 19:13:38 UTC
Actually, I associated .rar files with Dolphin (right button, open with, dolphin, save as default). 

From what you say, it's expected those aren't supported. However, it shouldn't start an infinite number of Dolphin instances.

Cheers !
Comment 3 Mahendra Tallur 2013-04-21 19:16:44 UTC
I thnk I understood what occurs : 

when opening a RAR file with Dolphin, as Dolphin doesn't natively recognize the file format, it checks MIME files preferences and figured out .rar files are... associated with Dolphin, so it recursively starts Dolphin again and again and again !

So, there is definitely a bug, but I think the description should be expressed in a different way...
Comment 4 Christoph Feck 2013-04-21 19:20:08 UTC
Ah okey, that makes sense. We probably need a warning, if you associate applications to file types they do not support.
Comment 5 Mahendra Tallur 2013-04-21 21:06:36 UTC
Thanks ! I modified the bugreport description accordingly. (I'm not sure whether Dolphin or systemsettings is at fault, though).
Comment 6 Frank Reininghaus 2013-04-22 08:19:43 UTC
(In reply to comment #5)
> Thanks ! I modified the bugreport description accordingly. (I'm not sure
> whether Dolphin or systemsettings is at fault, though).

To be honest, I'm not really sure if this should be considered a bug at all. There will always be ways to mess up your system badly by tweaking the settings, and it's impossible to provide perfect protection against that.
Comment 7 Mahendra Tallur 2013-08-18 07:22:35 UTC
Hi ! I'm coming back with a new use case that could justify a "fix", maybe :-)

->  I just encountered a case where the unexpected behaviour can be triggered even when opening a supposedly supported file : for instance, it's not that uncommon to download a corrupt file or a file with the bad extension.

If, like me, you associated zip files with Dolphin : you'll fall into the loop I mentioned before. Which is annoying because if you are not an "educated user" you have to reboot the computer when it happens because of the infinite Dolphin instances being spawned :-)

[Also, since KDE 4.11, if like me you use the FoldView widget and open zip files from there with Dolphin, double clicking such a file will open 2 windows : an empty Dolphin window then a window containing the content of the zip file]
Comment 8 BryanFRitt 2013-09-24 17:41:47 UTC
*** Bug 323531 has been marked as a duplicate of this bug. ***
Comment 9 Christoph Feck 2013-10-08 23:10:48 UTC
*** Bug 325795 has been marked as a duplicate of this bug. ***
Comment 10 erik_hahn 2013-10-09 16:11:06 UTC
Created attachment 82753 [details]
Dolphin: open archives, ignore other files given as arguments

With this patch, Dolphin ignores all files passed to it that it can't handle instead of opening them externally. I assume that it wasn't actually intended to be usable as a xdg-open replacement.

Also, archives are now opened inside Dolphin so it can be used as an archive manager at least for local files. If the user tries to open a remote archive Dolphin still opens it externally; I have observed that if it receives one as an argument, it will display a pseudo-folder that contains only said archive. So having it set as the archive handler is still broken, but in a less annoying way.
Comment 11 BryanFRitt 2013-10-09 21:48:21 UTC
This bug also affected Konqueror, but it looks like the patch is only for dolphin.
Perhaps there could be a more generalized solution?, or a patch for Konqueror too.
Comment 12 Frank Reininghaus 2013-10-10 10:32:01 UTC
(In reply to comment #10)
> Created attachment 82753 [details]
> Dolphin: open archives, ignore other files given as arguments

Thanks for the patch! Could you please submit it to https://git.reviewboard.kde.org/ ? On ReviewBoard, it's much easier to see the changes in context, and it also enables other people to comment on the patch.

(In reply to comment #11)
> This bug also affected Konqueror, but it looks like the patch is only for
> dolphin.
> Perhaps there could be a more generalized solution?, or a patch for
> Konqueror too.

I think it's probably not possible to extend the patch to a more general solution.

Moreover, I think that the situation for Konqueror is different. Dolphin can really only show folders and archives, but Konqueror can actually open lots of different file types if a matching KPart is installed. 

Just one example for a use case where it makes sense to open files inside Konqueror: When editing large LaTeX documents, I sometimes open the resulting PDF with "konqueror somefile.pdf" and then split the view such that I can see not only the page that I'm currently working on, but also another page that the current one refers to.

Therefore, I don't think that the suggested patch can simply be transferred to Konqueror.
Comment 13 erik_hahn 2013-10-10 10:57:59 UTC
(In reply to comment #12)
> (In reply to comment #10)
> > Created attachment 82753 [details]
> > Dolphin: open archives, ignore other files given as arguments
> 
> Thanks for the patch! Could you please submit it to
> https://git.reviewboard.kde.org/ ? On ReviewBoard, it's much easier to see
> the changes in context, and it also enables other people to comment on the
> patch.
> 
https://git.reviewboard.kde.org/r/113191/
Comment 14 Frank Reininghaus 2013-10-13 08:51:14 UTC
Git commit cd9e50ae4f3ded5a78d0cfb09a67684a9c15d726 by Frank Reininghaus, on behalf of Erik Hahn.
Committed on 13/10/2013 at 08:44.
Pushed by freininghaus into branch 'KDE/4.11'.

Files passed as arguments: Ignore unsupported files

With this patch, Dolphin ignores all files passed to it that it can't

Also, archives are now opened inside Dolphin so it can be used as an
archive manager at least for local files. If the user tries to open a
remote archive Dolphin still opens it externally; I have observed that
if it receives one as an argument, it will display a pseudo-folder that
contains only said archive. So having it set as the archive handler is
still broken, but in a less annoying way.
REVIEW: 113191
FIXED-IN: 4.11.3

M  +18   -5    dolphin/src/dolphinmainwindow.cpp

http://commits.kde.org/kde-baseapps/cd9e50ae4f3ded5a78d0cfb09a67684a9c15d726
Comment 15 Frank Reininghaus 2013-11-07 07:51:07 UTC
(In reply to comment #14)
> Git commit cd9e50ae4f3ded5a78d0cfb09a67684a9c15d726 by Frank Reininghaus, on
> behalf of Erik Hahn.
> Committed on 13/10/2013 at 08:44.
> Pushed by freininghaus into branch 'KDE/4.11'.

Unfortunately, it turned out yesterday that this patch caused a regression: opening the "Trash" by clicking the icon on the desktop does not work any more (bug 327224). Because the regression has the potential to cause trouble for everyone, in contrast to the present bug, which requires some unusual settings to reproduce, the safest solution was to revert the commit and tell the packagers about the problem.

@Erik: if you could modify your patch such that "dolphin trash:/" and similar things still work fine (I also completely overlooked this issue when I tested the patch), this would be awesome!
Comment 16 Pol 2014-04-24 14:55:35 UTC
Hello,

I've upgraded to KDE 4.13.0 on Gentoo and this bug is still there.
When opening an archive from chrome into Dolphin, Dolphin endlessly spawns itself, I have to kill Chrome and all the Dolphin windows.

Is there a workaround for this?

How to reproduce the bug:

If you open an archive in Dolphin, the url will be:
zip://path/to/the/archive.zip or tar://path/to/the/archive.tar.gz 

When you open an archive from Chrome (or Chromium), the path is:
file://path/to/the/archive.zip (and the same with .tar.gz)

Chrome is using file:// instead of zip:// or tar:// and when you use file:// you can easily reproduce the problem in Dolphin.
Comment 17 Pol 2014-09-01 10:23:30 UTC
Same bug with KDE 4.14.0 too.
Comment 18 Kai Krakow 2014-09-07 13:55:00 UTC
How about adding a confirmation dialog if a parameter passed via command line would spawn another dolphin instance?
Comment 19 dmitriy 2014-11-03 11:16:17 UTC
See also this bug:
https://bugs.kde.org/show_bug.cgi?id=340374

Maybe they have some common reason.

The users unable to open even ZIP archives in KDE. I think this is critical issue, could anybody fix it?
Comment 20 Frank Reininghaus 2014-11-04 22:32:52 UTC
*** Bug 340374 has been marked as a duplicate of this bug. ***
Comment 21 dmitriy 2014-11-25 18:33:41 UTC
Any solution? Currently there is no chance to open archive from Chrome at all. Beginner users will need to make hard reset of there PC if they try to open downloaded ZIP. I just have a pain when working with archives in KDE.
Comment 22 Christoph Feck 2014-11-25 19:05:22 UTC
> Beginner users will need to make hard reset of there PC

Are you saying this bug is happening, even if you did not "misconfigure" the file associations to launch Dolphin for archives (the default should be "ark")?
Comment 23 dmitriy 2014-11-25 19:16:38 UTC
(In reply to Christoph Feck from comment #22)
> > Beginner users will need to make hard reset of there PC
> 
> Are you saying this bug is happening, even if you did not "misconfigure" the
> file associations to launch Dolphin for archives (the default should be
> "ark")?

My file association is set to Dolphin. Setting it to Ark solves the problem but I want to use all power of Dolphin: Ark is very primitive (especially if user worked with WinRAR before - he will unable to work with unusable Ark).
The problem is that Dolphin CAN open ZIP, but brakes anything in KDE when called from another app asking to open an archive.
Maybe the solution can be in adding just one "if" construction to process this situation in special way? Also Dolphin must check that is was called from Dolphin with the same parameters to at least prevent infinite spawning.
I think the problem is rather popular and annoying and deserves to have quick fix before Dolphin will be (maybe) refactored in next KDE version.
Comment 24 Justin Zobel 2020-11-11 08:17:48 UTC
I've just tested a rar file on dolphin from git master and it can now open them.

Can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved. I'm setting status to "needsinfo" pending your response, please change back to "reported" when you respond, thanks.
Comment 25 Bug Janitor Service 2020-11-26 04:33:44 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 26 Bug Janitor Service 2020-12-11 04:34:04 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!
Comment 27 Mahendra Tallur 2020-12-29 08:43:08 UTC
Hi ! Just tested on the current KDE stack (KDE Neon), 7.5 years later :-) 

The bug doesn't occur anymore.
What happens when opening an unsupported or broken file with Dolphin -- even when mistakenly associated the filetype to it -- is that an empty tab is created. 

No more endless loop.
Thank you !