Bug 562443 - SWT spams temp folder with innumerable folders
Summary: SWT spams temp folder with innumerable folders
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.15   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.17 M1   Edit
Assignee: Soraphol (Paul) Damrongpiriyapong CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2020-04-23 12:54 EDT by arne anka CLA
Modified: 2020-06-09 15:49 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description arne anka CLA 2020-04-23 12:54:37 EDT
Since a few days my temp folder is swamped by countless folders
SWT-GDBusServer-<username>-<alnum>/
SWT-WebExtensionGDBusServer-<username>-<alnum>/

Only today (I started Eclipse in the morning) there have been created 103 of these -- and they're not removed once Eclipse is shut down.

Is that really necessary?

- these need to go into one common sub-folder instead of filling up the temp folder
- SWT/Eclipse needs to clean up after itself
Comment 1 Andrey Loskutov CLA 2020-04-23 12:58:32 EDT
Yep. We should fix that.
Comment 2 Andrey Loskutov CLA 2020-05-12 11:05:51 EDT
Side effect of bug 540060.
Comment 3 Andrey Loskutov CLA 2020-05-12 11:37:41 EDT
Code in org.eclipse.swt.browser.WebkitGDBus.construct_server_address() constructs some pseudo-random directory name, but does not attempts to delete it on shutdown. 
See also webkitgtk_extension.c :: construct_server_address counterpart on the C side, that uses https://developer.gnome.org/glib/stable/glib-File-Utilities.html#g-dir-make-tmp.

I imagine we need to cleanup in org.eclipse.swt.browser.WebKit.WebKitExtension on shutdown.

The bad thing about it: I don't see where we can get that *two different* random paths, which we could use to cleanup on shutdown, and if we *can* do that without crashing started native process that might still use this directory.

One possibility would be to not use g-dir-make-tmp, but use plain Java to create one temp directory and pass this to native code, and on shutdown delete the root dir with all the content.
Comment 4 Alexander Kurtakov CLA 2020-05-26 08:26:52 EDT
I don't have time for this one so move away from 4.16.
Comment 5 arne anka CLA 2020-05-26 08:31:44 EDT
Any chance to at least create all those folders in a common subfolder in tmp?
Is there maybe a variable to be set?
Comment 6 Eclipse Genie CLA 2020-05-26 17:28:43 EDT
New Gerrit change created: https://git.eclipse.org/r/163641
Comment 8 Soraphol (Paul) Damrongpiriyapong CLA 2020-06-09 12:34:51 EDT
Verified for I20200609-0150
Comment 9 Andrey Loskutov CLA 2020-06-09 15:49:16 EDT
Thanks Paul!