FD or stream not closed with tab Topic is solved

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
Lunokhod
Lunatic
Lunatic
Posts: 469
Joined: 2017-04-20, 21:25
Contact:

FD or stream not closed with tab

Unread post by Lunokhod » 2017-07-08, 20:03

I'm using Pale Moon 27.3.0 Linux 32 bit bzipped download in Void XFCE:
Mount a drive, use Pale Moon to open an HTML file on it that has .html and filedir/ (e.g. saved as webpage complete). Open another file in another tab.
Close the tab showing the file from the drive (CD or USB) and try to unmount the drive.
$ sudo umount /mnt
umount: /mnt: target is busy.
It can't be unmounted now until Pale Moon is fully shutdown. Doesn't do this with a simple HTML file with no filesdir/.
Probably it's not doing a proper cleanup of streams or file descriptors or something, and could even be related to the multi tab crashing issues.

Also:
If you upload some files to Yandex disk and open the directory with Thunar from the XFCE panel file dropdown selector while the upload popup is still showing 2 Thunars open, one after another, I had something similar while uploading photos for eBay listings too. That might be a wider desktop issue (to whatever extent) though.
Pretty funny to see though. :D
Wait, it's all Ohio? Always has been...

User avatar
adesh
Board Warrior
Board Warrior
Posts: 1277
Joined: 2017-06-06, 07:38

Re: FD or stream not closed with tab

Unread post by adesh » 2017-07-08, 20:26

vingtzwanzig wrote:Probably it's not doing a proper cleanup of streams or file descriptors or something, and could even be related to the multi tab crashing issues.
Closing a tab does not mean that all the resources used by the tab will be immediately freed. The browser might hold a few references to objects in order to speed things up (undo close tab?).
All the tabs run inside a single palemoon process and I think no guarantees can be made when a resource will be freed. Obviously everything is freed once the process exits.

User avatar
Lunokhod
Lunatic
Lunatic
Posts: 469
Joined: 2017-04-20, 21:25
Contact:

Re: FD or stream not closed with tab

Unread post by Lunokhod » 2017-07-09, 13:42

OK, I see. Usually opening and closing files is inconsequential for performance unless it was in a fast running loop, but I suppose if you had to look up the file location then it might help to leave them open, perhaps one of the peculiarities of interfacing with the web. (Although if you were going to cache the data then you probably could still clean up the references to the original locations.) And you could possibly check if the page address was a local file or online, but whether it's even worthwhile for such a rarely encountered case is another matter.
Lucky I found a spare bug then! I don't know if Pale Moon is triggering some bug elsewhere or if it is doing something itself though, when two Thunar's turn up at once instead of one. It sounds DBUS related I think.
Wait, it's all Ohio? Always has been...

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35597
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: FD or stream not closed with tab

Unread post by Moonchild » 2017-07-09, 13:56

File locking when opening is handled by the O.S.
For various reasons, Pale Moon handles document element access through resource pools (essential for performance when reading from the web) that are not directly tied to individual tabs or documents. Closing a tab doesn't necessarily mean you are releasing the resources of elements in that document as well. There are various time-outs involved for releasing resources, and it can therefore take a while (or until end of session) for an O.S. to release its lock on a resource file that has been opened as part of a document in the browser.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Lunokhod
Lunatic
Lunatic
Posts: 469
Joined: 2017-04-20, 21:25
Contact:

Re: FD or stream not closed with tab

Unread post by Lunokhod » 2017-07-15, 20:11

I have since found I could get the 2 Thunars opening a directory from the menu while copying photos to the directory from a USB device in the terminal at the same time, so that definitely isn't a Pale Moon issue.
Wait, it's all Ohio? Always has been...

Locked