Skip to content
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

Remove QT Temp Files #2854

Closed
musikBear opened this issue Jun 16, 2016 · 13 comments
Closed

Remove QT Temp Files #2854

musikBear opened this issue Jun 16, 2016 · 13 comments
Labels

Comments

@musikBear
Copy link

musikBear commented Jun 16, 2016

LMMS creates several temp qt_temp.xxxx files which don't get cleaned up.

For Windows these are created in %APPDATA%\..\Local\Temp. They are created on other OSs as well in their respective temp directories.

According to lxqt/qterminal#11, this is most likely caused by QTemporaryFile which is used by ZynAddSubFX and VSTPlugin.

Originally reported here:
http://lmms.io/forum/viewtopic.php?f=15&t=5267

(edited by @tresf, fix description, fix link, add research)


Original bug report

The user mrlmmsguy has noticed that after using LMMS for a bit, the temporary cache file (C:\Users[my name]\AppData\Local\Temp) begins to fill with little Qt files with names like qt_temp.ut1232.
Is this related to upgrade to Qt5. I believe it was just about jan t.y that Qt5 was introduced(?)
OPP:
http://lmms.io/forum/posting.php?mode=reply&f=15&t=5267

@tresf
Copy link
Member

tresf commented Jun 16, 2016

@musikBear fix your link. Our forum is public, the link should work in incognito mode. Did it for you, added research.

@tresf tresf changed the title small garbage files from qt piles up in windows-temp-cache. Remove QT Temp Files Jun 16, 2016
@tresf tresf added the bug label Jun 16, 2016
@tresf tresf added this to the 1.2.0 milestone Jun 16, 2016
@SirBothersome
Copy link

This may have something to do with ZasFX having a huge CPU footprint with multiple instruments running...

@tresf
Copy link
Member

tresf commented Aug 12, 2016

Well, the Zyn code @musikBear pointed out is ours; a wrapper we use to launch the remote process; quite different than the plugin code (the plugin doesn't use Qt at all).

It's more likely related to standard resource cleanup. We create the temp files but never remove them. Probably a relatively small fix, once identified.

@zonkmachine
Copy link
Member

We explicitly tell qt to not remove the tempfile created in ZynAddSubFxInstrument::loadSettings()

This could be related to reloadPlugin() being run when you launch the zasfx gui, press the gui button and you will get a new temp file. Wouldn't you need to explicitly remember the address to a temp file for it to be of any use later on? I see no reason for not automatically removing this file also.

@zonkmachine
Copy link
Member

The only way I can create temp files that sticks ( Qt 4.8 ) is by force quitting LMMS from the terminal while I have the zasfx gui question box open ( I can't actually test opening the gui because of the xorg-server bug )

@zonkmachine
Copy link
Member

zonkmachine commented Aug 13, 2016

How about just not trusting neither Qt nor the random OS temp file handling but using our own temp dir on some local directory we can clear on project launch like with recovery file? Like ~/.cache ?

http://doc.qt.io/qt-5/qtemporarydir.html#QTemporaryDir
Edit: qtemporarydir seem to be a Qt5 thing...

@softrabbit
Copy link
Member

Wouldn't you need to explicitly remember the address to a temp file for it to be of any use later on? I see no reason for not automatically removing this file also.

I agree. Can't figure out how and why the file could be reused.

@Umcaruje
Copy link
Member

Umcaruje commented May 9, 2017

Edit: qtemporarydir seem to be a Qt5 thing...

We're switching to QT5 for 1.2 anyways, so this should really not be an issue

@tresf
Copy link
Member

tresf commented May 10, 2017

We're switching to QT5 for 1.2 anyways, so this should really not be an issue

The releases will, but the codebase is still able to be compiled against Qt4. We haven't discussed pulling Qt4 support entirely from the codebase yet. Probably a worthy discussion, but probably a bad idea for the 1.2 release.

@zonkmachine
Copy link
Member

zonkmachine commented Jun 7, 2017

When I open a VST I get a temp file and after I delete VST track the temp file is deleted too.
If I close a project with VSTs in it the temp files are deleted. If LMMS crash or is terminated from the command line the temp files stays. After restarting the computer they are gone. This is under Linux though. It looks like Windows doesn't clear out temp files automatically on restarting.
In any case, I don't think we need to do anything else here than fixing #2633 'Crash when closing, every time' and that would prevent the temp files from cropping up in the first place.

@zonkmachine
Copy link
Member

To sum up the above. I believe that:

I think this issue can be taken off the milestone for now and if the issue clears up with crashes on exit being fixed, marked as a duplicate of #2633.

PS. My temp files don't begin with qt_temp but show up like this:

{b9e3a7ba-e2a1-45cc-af8e-73f0a16eccae}
{ce9cb762-a29a-4edb-8027-5c57e76f1388}

@tresf
Copy link
Member

tresf commented Jun 16, 2017

if the issue clears up with crashes on exit being fixed, marked as a duplicate of #2633.

All evidence points to that. Done. We can reopen if evidence proves otherwise. Thanks for the attention to detail @zonkmachine.

@PhysSong
Copy link
Member

Quoting the Qt documentation for QTemporaryFile::setAutoRemove:

On some systems, if fileName() is not called before closing the file, the temporary file may be removed regardless of the state of this property.

I think it's the reason I can reproduce this on Windows 10 but not on Ubuntu 18.04.

PS. My temp files don't begin with qt_temp but show up like this:

They look like local sockets for inter-process communication.

So I think this one was wrongly closed. Reopening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants