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

element-desktop creates /tmp/.org.chromium.Chromium.xxxxxx files when started, which are not deleted upon exit #17188

Closed
PF4Public opened this issue May 6, 2021 · 13 comments · Fixed by element-hq/element-desktop#337
Assignees
Labels
A-Electron S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Z-Platform-Specific Z-Upstream

Comments

@PF4Public
Copy link

Description

Every time I start element-desktop there are /tmp/.org.chromium.Chromium.xxxxxx created and not deleted afterwards.

Steps to reproduce

  • Start element-desktop
  • Quit element-desktop
  • See the contents of a /tmp folder

Electron always creates 2 files with ever changing names, but I suppose that they are essentially the same files every start, so I inspected them in a hex editor and to me it looks like electron unpacks keytar and seshat node modules. I also inspected the files generated during the build of element-desktop and only the gifwrap resides in app.asar.unpacked/node_modules/ everything else seems to be packed into app.asar. I also compare this to vscode, which keeps all the native modules outside app.asar. Could it be, that those modules should also be unpacked? And my suspicion is that if they are not, electron needs to unpack them every time it starts. Therefore I'm filling a bug here as it could be an issue with element-desktop build system. It could also happen to be electron issue. Anyway it would be nice not to generate extra temporary files.

Logs being sent: no

Version information

  • Platform: desktop

For the desktop app:

  • OS: Gentoo Linux
  • Version: v1.7.26

Related issues I could find, but they didn't help solve this issue: zulip/zulip-desktop#601 electron/electron#16097

@PF4Public
Copy link
Author

PF4Public commented Jun 8, 2021

I have rebuilt element-desktop without native modules and no more /tmp/.org.chromium.Chromium.xxxxxx. This makes it clear, that it definitely has something to do with how element handles (packages) native modules.

@kittykat
Copy link
Contributor

kittykat commented Oct 1, 2021

@PF4Public I cannot reproduce this on Arch - my /tmp/.org.chromium.Chromium.xxxxxx do get cleared. I will update this comment later to confirm what triggers the clearing.

FYI, I am using
Electron v14.0.1 / Chromium v93.0.4577.63 / Node v14.17.0
Element version: 1.8.5 / Olm version: 3.2.3

@PF4Public
Copy link
Author

@kittykat Did you find the trigger?

I've just rebuilt element from develop and the issue still persists.
BTW, I'm using electron-13.5.0

Version von Element: 1.9.0
Version von Olm: 3.2.3

@kittykat
Copy link
Contributor

kittykat commented Oct 3, 2021

@PF4Public They clear with time for me. The files that were added on Friday when I used Element were still there yesterday and are gone today.

Please try with a newer Electron and I will try with a newer Element, but I suspect this may be a platform or setup issue rather than a bug in Element.

@PF4Public
Copy link
Author

@PF4Public They clear with time for me.

but I suspect this may be a platform or setup issue rather than a bug in Element

If some script on your platform is clearing leftovers of Element (by cleaning /tmp or something like that) it does not automatically fix a bug in Element. Why does vscode with the same version of Electron not leave unpacked modules behind, even though it does use native modules?

Like I've already stated:

This makes it clear, that it definitely has something to do with how element handles (packages) native modules.

@PF4Public
Copy link
Author

Just FYI
I've rebuilt element with electron-16:

# ps ax | grep element
13968 ?        SLsl   0:18 /usr/lib64/electron-16/electron --enable-crashpad /usr/lib64/element-desktop/app.asar

And as expected element still leaves two binaries in /tmp upon exit because those binaries are still packed into app.asar:

 * Searching for element-desktop ...
 * Contents of net-im/element-desktop-9999:
/usr
/usr/lib64
/usr/lib64/element-desktop
/usr/lib64/element-desktop/app.asar
/usr/lib64/element-desktop/img
/usr/lib64/element-desktop/img/element.ico
/usr/lib64/element-desktop/img/element.png
/usr/lib64/element-desktop/webapp -> ../../share/element-web
/usr/share
/usr/share/applications
/usr/share/applications/electron-16-element-desktop.desktop

@SimonBrandner SimonBrandner added S-Minor Impairs non-critical functionality or suitable workarounds exist and removed P3 labels Dec 23, 2021
@G2G2G2G
Copy link

G2G2G2G commented Jan 24, 2022

1
1
ty electron (I use arch btw)

@PF4Public
Copy link
Author

Still the same with electron-18

@G2G2G2G
Copy link

G2G2G2G commented Apr 12, 2022

I mounted /tmp to a ramfs and bought another stick of ram just for element

@PF4Public
Copy link
Author

PF4Public commented Apr 12, 2022

Enough! I've submitted a PR.

@G2G2G2G it would be awesome if you could try building that PR and testing whether it solves the issue.

PS: It does for me. I no longer see those files.

@G2G2G2G
Copy link

G2G2G2G commented Apr 12, 2022

I build this https://aur.archlinux.org/packages/element-desktop-nightly-bin I avoid electron & npm like the plague. (the dev packages)
IDK where to add your thing, I see it's just 1 line..
nothing is in the build dir, I think cuz this AUR uses the .deb package

I believe in your pull request though

@PF4Public
Copy link
Author

I think cuz this AUR uses the .deb package

Yep, with pre-built packages you have to wait for the next release.

@G2G2G2G
Copy link

G2G2G2G commented Apr 27, 2022

yea been watching it past week, looks great

su-ex added a commit to SchildiChat/element-desktop that referenced this issue Apr 30, 2022
* Handle forced disconnects from Jitsi ([\#21697](element-hq/element-web#21697)). Fixes element-hq/element-web#21517.
* Improve performance of switching to rooms with lots of servers and ACLs ([\#8347](matrix-org/matrix-react-sdk#8347)).
* Avoid a reflow when setting caret position on an empty composer ([\#8348](matrix-org/matrix-react-sdk#8348)).
* Add message right-click context menu as a labs feature ([\#5672](matrix-org/matrix-react-sdk#5672)).
* Live location sharing - basic maximised beacon map ([\#8310](matrix-org/matrix-react-sdk#8310)).
* Live location sharing - render users own beacons in timeline ([\#8296](matrix-org/matrix-react-sdk#8296)).
* Improve Threads beta around degraded mode ([\#8318](matrix-org/matrix-react-sdk#8318)).
* Live location sharing -  beacon in timeline happy path ([\#8285](matrix-org/matrix-react-sdk#8285)).
* Add copy button to View Source screen ([\#8278](matrix-org/matrix-react-sdk#8278)). Fixes element-hq/element-web#21482. Contributed by @olivialivia.
* Add heart effect ([\#6188](matrix-org/matrix-react-sdk#6188)). Contributed by @CicadaCinema.
* Update new room icon ([\#8239](matrix-org/matrix-react-sdk#8239)).
* Prevent packing of native modules ([\element-hq#337](element-hq#337)). Fixes element-hq/element-web#17188. Contributed by @PF4Public.
* Fix: "Code formatting button does not escape backticks" ([\#8181](matrix-org/matrix-react-sdk#8181)). Contributed by @yaya-usman.
* Fix beta indicator dot causing excessive CPU usage ([\#8340](matrix-org/matrix-react-sdk#8340)). Fixes element-hq/element-web#21793.
* Fix overlapping timestamps on empty messages ([\#8205](matrix-org/matrix-react-sdk#8205)). Fixes element-hq/element-web#21381. Contributed by @goelesha.
* Fix power selector not showing up in user info when state_default undefined ([\#8297](matrix-org/matrix-react-sdk#8297)). Fixes element-hq/element-web#21669.
* Avoid looking up settings during timeline rendering ([\#8313](matrix-org/matrix-react-sdk#8313)). Fixes element-hq/element-web#21740.
* Fix a soft crash with video rooms ([\#8333](matrix-org/matrix-react-sdk#8333)).
* Fixes call tiles overflow ([\#8096](matrix-org/matrix-react-sdk#8096)). Fixes element-hq/element-web#20254. Contributed by @luixxiul.
* Fix a bug with emoji autocomplete sorting where adding the final "&element-hq#58;" would cause the emoji with the typed shortcode to no longer be at the top of the autocomplete list. ([\#8086](matrix-org/matrix-react-sdk#8086)). Fixes element-hq/element-web#19302. Contributed by @commonlawfeature.
* Fix image preview sizing for edge cases ([\#8322](matrix-org/matrix-react-sdk#8322)). Fixes element-hq/element-web#20088.
* Refactor SecurityRoomSettingsTab and remove unused state ([\#8306](matrix-org/matrix-react-sdk#8306)). Fixes matrix-org/element-web-rageshakes#12002.
* Don't show the prompt to enable desktop notifications immediately after registration ([\#8274](matrix-org/matrix-react-sdk#8274)).
* Stop tracking threads if threads support is disabled ([\#8308](matrix-org/matrix-react-sdk#8308)). Fixes element-hq/element-web#21766.
* Fix some issues with threads rendering ([\#8305](matrix-org/matrix-react-sdk#8305)). Fixes element-hq/element-web#21670.
* Fix threads rendering issue in Safari ([\#8298](matrix-org/matrix-react-sdk#8298)). Fixes element-hq/element-web#21757.
* Fix space panel width change on hovering over space item ([\#8299](matrix-org/matrix-react-sdk#8299)). Fixes element-hq/element-web#19891.
* Hide the reply in thread button in deployments where beta is forcibly disabled ([\#8294](matrix-org/matrix-react-sdk#8294)). Fixes element-hq/element-web#21753.
* Prevent soft crash around room list header context menu when space changes ([\#8289](matrix-org/matrix-react-sdk#8289)). Fixes matrix-org/element-web-rageshakes#11416, matrix-org/element-web-rageshakes#11692, matrix-org/element-web-rageshakes#11739, matrix-org/element-web-rageshakes#11772, matrix-org/element-web-rageshakes#11891 matrix-org/element-web-rageshakes#11858 and matrix-org/element-web-rageshakes#11456.
* When selecting reply in thread on a thread response open existing thread ([\#8291](matrix-org/matrix-react-sdk#8291)). Fixes element-hq/element-web#21743.
* Handle thread bundled relationships coming from the server via MSC3666 ([\#8292](matrix-org/matrix-react-sdk#8292)). Fixes element-hq/element-web#21450.
* Fix: Avatar preview does not update when same file is selected repeatedly ([\#8288](matrix-org/matrix-react-sdk#8288)). Fixes element-hq/element-web#20098.
* Fix a bug where user gets a warning when changing powerlevel from **Admin** to **custom level (100)** ([\#8248](matrix-org/matrix-react-sdk#8248)). Fixes element-hq/element-web#21682. Contributed by @Jumeb.
* Use a consistent alignment for all text items in a list ([\#8276](matrix-org/matrix-react-sdk#8276)). Fixes element-hq/element-web#21731. Contributed by @luixxiul.
* Fixes button labels being collapsed per a character in CJK languages ([\#8212](matrix-org/matrix-react-sdk#8212)). Fixes element-hq/element-web#21287. Contributed by @luixxiul.
* Fix: Remove jittery timeline scrolling after jumping to an event ([\#8263](matrix-org/matrix-react-sdk#8263)).
* Fix regression of edits showing up in the timeline with hidden events shown ([\#8260](matrix-org/matrix-react-sdk#8260)). Fixes element-hq/element-web#21694.
* Fix reporting events not working ([\#8257](matrix-org/matrix-react-sdk#8257)). Fixes element-hq/element-web#21713.
* Make Jitsi widgets in video rooms immutable ([\#8244](matrix-org/matrix-react-sdk#8244)). Fixes element-hq/element-web#21647.
* Fix: Ensure links to events scroll the correct events into view ([\#8250](matrix-org/matrix-react-sdk#8250)). Fixes element-hq/element-web#19934.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Electron S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Z-Platform-Specific Z-Upstream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants