[SOLVED] XnViewMP does not release opened file under Linux KDE / KIO (0.98.2)

*** Please report new bugs here! ***

Moderators: XnTriq, helmut, xnview, Dreamer

Post Reply
User avatar
winnylinny
Posts: 151
Joined: Fri Apr 17, 2020 5:35 pm

[SOLVED] XnViewMP does not release opened file under Linux KDE / KIO (0.98.2)

Post by winnylinny »

SOLVED: This is an upstream bug in KDE, which will be fixed with the release of KDE Framework 5.81. Read the recent replies for more info.

If I am viewing images on a network share over KDE, once I close XnViewMP and try to disconnect / unmount the shared folder, KDE gives me an error notification that says "Target is still busy."

When I investigate to see what program still has files open from this folder, I discover it's always XnViewMP as the culprit (even though I closed the program, it's still leaves "image-name.jpg" as an open file / process.)

If I access the network share and never open anything with XnViewMP, I can unmount / disconnect the share without issues.

If at any point I open an image in this shared folder with XnViewMP, I can never unmount / disconnect the share unless I forcibly kill the stubborn process.

I can provide screenshots of this bug if that helps explain it better.
Last edited by winnylinny on Wed Mar 31, 2021 4:58 pm, edited 1 time in total.
User avatar
xnview
Author of XnView
Posts: 43328
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: XnViewMP does not release opened file under Linux KDE / KIO (0.98.2)

Post by xnview »

do you start XnView with file parameter?
Pierre.
User avatar
winnylinny
Posts: 151
Joined: Fri Apr 17, 2020 5:35 pm

Re: XnViewMP does not release opened file under Linux KDE / KIO (0.98.2)

Post by winnylinny »

xnview wrote: Wed Mar 24, 2021 7:39 amdo you start XnView with file parameter?
Good catch! Looks like we're getting close! :o

The problem does not occur if I first open up XnViewMP and then load an image. The bug only occurs if I double-click a file to open it in XnViewMP.

Let me list out a few comparisons if it helps.



Scenario 1, connect and disconnect
  1. Connect a network share in KDE (KIO, Smb4K, et. al.)
  2. Don't open any images
  3. Disconnect the network share
  4. No problems! :mrgreen:




Scenario 2, using GwenView (Qt5-based image viewer)
  1. Connect a network share in KDE (KIO, Smb4K, et. al.)
  2. Right-click to open an image with GwenView
  3. Close GwenView
  4. Disconnect the network share
  5. No problems! :mrgreen:




Scenario 3, using GPicView (GTK-based image viewer)
  1. Connect a network share in KDE (KIO, Smb4K, et. al.)
  2. Right-click to open an image with GPicView
  3. Close GPicView
  4. Disconnect the network share
  5. No problems! :mrgreen:




Scenario 4, using XnViewMP
  1. Connect a network share in KDE (KIO, Smb4K, et. al.)
  2. Right-click to open an image with XnViewMP
  3. Close XnViewMP
  4. Disconnect the network share
  5. Error! Target is busy! Cannot disconnect the network share! :!: :!: :!:
  6. Must manually kill the hanging file.so process




Scenario 5, using XnViewMP, without invoking a file parameter
  1. Connect a network share in KDE (KIO, Smb4K, et. al.)
  2. Launch XnViewMP from the menu shortcut
  3. Click-and-drag image into XnViewMP window
  4. Close XnViewMP
  5. Disconnect the network share
  6. No problems! :mrgreen:
User avatar
xnview
Author of XnView
Posts: 43328
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: XnViewMP does not release opened file under Linux KDE / KIO (0.98.2)

Post by xnview »

winnylinny wrote: Wed Mar 24, 2021 6:12 pm Scenario 4, using XnViewMP
  1. Connect a network share in KDE (KIO, Smb4K, et. al.)
  2. Right-click to open an image with XnViewMP
  3. Close XnViewMP
  4. Disconnect the network share
  5. Error! Target is busy! Cannot disconnect the network share! :!: :!: :!:
  6. Must manually kill the hanging file.so process
And XnView is not in process list?
Pierre.
User avatar
winnylinny
Posts: 151
Joined: Fri Apr 17, 2020 5:35 pm

Re: XnViewMP does not release opened file under Linux KDE / KIO (0.98.2)

Post by winnylinny »

xnview wrote: Thu Mar 25, 2021 11:25 amAnd XnView is not in process list?
Correct. Once I close XnViewMP, all such xnview processes disappear. However, the process file.so is still using the image file. For every time I open up an image with XnViewMP (from my file browser), it adds another process of file.so that will not release the file, until I kill the file.so process. Only with KDE.


This issue does not happen if I open up an image using the file paramter with other image viewers (eg, GwenView, GPicView, Ristretto). The file.so process gracefully disappears.


This issue does not happen if I first open up XnViewMP and then load an image either by click-and-drag or File > Open



This issue always happens if I open up an image with XnViewMP with my file browser (under KDE), and it doesn't matter if I am using a network shared folder. The only reason I believed this was related to network shares was because it was obvious that I cannot disconnect the share. This issue also happens when opening an image file from an external USB drive.


This issue does not happen on Cinnamon desktop (only KDE for some reason.)
User avatar
xnview
Author of XnView
Posts: 43328
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: XnViewMP does not release opened file under Linux KDE / KIO (0.98.2)

Post by xnview »

winnylinny wrote: Thu Mar 25, 2021 4:31 pm This issue does not happen on Cinnamon desktop (only KDE for some reason.)
strange :shock:
Pierre.
User avatar
winnylinny
Posts: 151
Joined: Fri Apr 17, 2020 5:35 pm

Re: XnViewMP does not release opened file under Linux KDE / KIO (0.98.2)

Post by winnylinny »

It is. But XnViewMP is the only application under KDE that does this.

No other image viewer does this. No other program of any kind does this, even when opening a file from the file manager (or file parameter).

There's something about XnViewMP + KDE that triggers this bug, when opening a file from the file manager or file parameter. It keeps the file.so process hanging onto an image that has been "closed", and thus you are unable to unmount or disconnect a USB drive or network share.
User avatar
winnylinny
Posts: 151
Joined: Fri Apr 17, 2020 5:35 pm

Re: XnViewMP does not release opened file under Linux KDE / KIO (0.98.2)

Post by winnylinny »

Looks like this is a bug with KDE / KIO. Certain applications, when using the file parameter, cause a hanging "file.so" process that will prevent you from unmounting an external drive or network share.

I was able to reproduce this bug with: Kate text editor, Google Chrome browser, XnViewMP, and a few other programs.

XnViewMP is fine! I am afraid the KDE developers are unaware of this issue.
Friedrich
Posts: 27
Joined: Tue Jul 09, 2013 2:36 am

Re: XnViewMP does not release opened file under Linux KDE / KIO (0.98.2)

Post by Friedrich »

winnylinny wrote: Mon Mar 29, 2021 3:18 pm Looks like this is a bug with KDE / KIO
Which distribution and/or version of KDE are you using?
(Having minor problems using XnViewMP only with the latest KDE versions)
MP 1.5.0 x64: Debian 12 (KDE); Manjaro (KDE); Windows 10 x64
User avatar
winnylinny
Posts: 151
Joined: Fri Apr 17, 2020 5:35 pm

Re: XnViewMP does not release opened file under Linux KDE / KIO (0.98.2)

Post by winnylinny »

Friedrich wrote: Tue Mar 30, 2021 2:04 pm Which distribution and/or version of KDE are you using?
(Having minor problems using XnViewMP only with the latest KDE versions)
That's why I no longer believe this is an issue with XnViewMP. The same thing happens with Kate, Google Chrome / Chromium, and some other applications under the latest KDE / KIO. This is also reported by other users on the Manjaro forums, and a bug report on KDE Bug Tracker. Unfortunately, they are giving poor advice on the Manjaro forums, as they inaccurately assume the problem is with Kate (text editor) or perhaps the user is "doing something incorrect." The real issue is with KDE / KIO, and it will leave a hanging "file.so" process if you open up a file from the file browser for certain applications. This is why you cannot safely eject an external USB or safely disconnect a network share. It will error out "Target is busy!"

You can get around this issue by opening the application first, then dragging a file into its window. Now you will not have a hanging "file.so" process after you close the application, and you can safely eject or disconnect the device or network share.

I'm using Manjaro with the latest stable updates.
User avatar
winnylinny
Posts: 151
Joined: Fri Apr 17, 2020 5:35 pm

Re: XnViewMP does not release opened file under Linux KDE / KIO (0.98.2)

Post by winnylinny »

Here's some system info:

Operating System: Manjaro Linux

KDE Plasma Version: 5.21.3

KDE Frameworks Version: 5.80.0

Qt Version: 5.15.2

Kernel Version: 5.10.23-1-MANJARO

Dolphin Version 20.12.3
User avatar
winnylinny
Posts: 151
Joined: Fri Apr 17, 2020 5:35 pm

Re: XnViewMP does not release opened file under Linux KDE / KIO (0.98.2)

Post by winnylinny »

UPDATE: The KDE developers are aware of this issue and the the bug has been fixed! The fix will be released with KDE Framework 5.81. :D
Post Reply