mattermost / desktop

Mattermost Desktop application for Windows, Mac and Linux
Apache License 2.0
2.03k stars 829 forks source link

[Bug]: Mattermost App freezes when opening a file from downloads dialog (Linux/wlroots) #3125

Closed pmkap closed 2 months ago

pmkap commented 3 months ago

Checks before filing an issue

Mattermost Desktop Version

5.7.0

Operating System

Arch Linux

Mattermost Server Version

No response

Steps to reproduce

Download an attachment and open from the download dialogue (see image below) image

Expected behavior

The file opens in the default application for this filetype.

Observed behavior

The file opens in the default application for this filetype (e.g. libreoffie) and the mattermost app freezes. Once libreoffice is closed again, mattermost unfreezes and continues to work as excpected. Sometimes mattermost exits together with libreoffice.

Log Output

12:11:56.442 › [ServerDropdownView] updateDropdown
12:11:56.442 › [App] [ServerViewState] getCurrentServer
12:11:56.442 › [DownloadsDropdown...] updateWindowBounds
12:11:56.442 › [DownloadsDropdown...] updateDownloadsDropdownMenu
12:11:56.442 › [DownloadsDropdown...] updateDownloadsDropdownMenuItem {}
12:11:56.443 › [DownloadsDropdown...] updateDownloadsDropdown
12:11:56.443 › [DownloadsDropdown...] updateWindowBounds
12:11:56.443 › [DownloadsDropdown...] updateDownloadsDropdown
12:11:56.443 › [ViewManager] focusCurrentView
12:11:56.443 › [DownloadsDropdown...] handleReceivedDownloadsDropdownSize { width: 328, height: 384 }
12:11:56.444 › [DownloadsDropdown...] handleReceivedDownloadsDropdownSize { width: 328, height: 384 }
12:11:56.444 › [ServerDropdownView] handleReceivedMenuSize { width: 301, height: 240 }
12:11:56.445 › [ServerDropdownView] handleReceivedMenuSize { width: 301, height: 240 }
12:11:56.445 › [DownloadsDropdown...] handleReceivedDownloadsDropdownSize { width: 328, height: 384 }
12:11:56.445 › [DownloadsDropdown...] handleReceivedDownloadsDropdownSize { width: 328, height: 384 }
12:11:56.446 › [DownloadsDropdown...] handleReceivedDownloadsDropdownSize { width: 328, height: 384 }
12:11:56.446 › [DownloadsDropdown...] handleReceivedDownloadsDropdownSize { width: 328, height: 384 }
12:11:56.446 › [ServerDropdownView] handleReceivedMenuSize { width: 301, height: 240 }
12:11:56.446 › [DownloadsDropdown...] handleReceivedDownloadsDropdownSize { width: 328, height: 384 }
12:11:56.447 › [ServerDropdownView] handleReceivedMenuSize { width: 301, height: 240 }
12:11:56.447 › [DownloadsDropdown...] handleReceivedDownloadsDropdownSize { width: 328, height: 384 }
12:11:56.447 › [DownloadsDropdown...] handleReceivedDownloadsDropdownSize { width: 328, height: 384 }
12:11:56.448 › [DownloadsDropdown...] handleReceivedDownloadsDropdownSize { width: 328, height: 384 }
12:11:56.459 › [MainWindow] main window closed
12:11:56.460 › [App.App] handleAppWindowAllClosed
12:11:56.460 › [App.App] handleAppBeforeQuit
12:11:56.460 › [App.Utils] flushCookiesStore

Additional Information

wlroots-based wayland compositor, happens with both the native wayland electron client and Xwayland.

devinbinnie commented 3 months ago

@pmkap Does this reproduce on v5.9 as well? If so, can you run from the command line so that we get Node/Chromium logging as well and see if anything else pops up in the logs?

pmkap commented 2 months ago

@devinbinnie I just tested with the 5.9.0 tarball from here: https://github.com/mattermost/desktop/releases/tag/v5.9.0

I can still reproduce the issue. This is the stdout/stderr

 /tmp/mattermost-desktop-5.9.0-linux-x64 ❯ ./mattermost-desktop
11:44:06.177 › Logger Log level set to: info
[macos-notification-state] failed to load 'notificationstate' addon Error: Module did not self-register: '/tmp/mattermost-desktop-5.9.0-linux-x64/resources/app.asar.unpacked/node_modules/macos-notification-state/build/Release/notificationstate.node'.
    at process.func [as dlopen] (node:electron/js2c/node_init:2:2559)
    at Module._extensions..node (node:internal/modules/cjs/loader:1470:18)
    at Object.func [as .node] (node:electron/js2c/node_init:2:2786)
    at Module.load (node:internal/modules/cjs/loader:1215:32)
    at Module._load (node:internal/modules/cjs/loader:1031:12)
    at c._load (node:electron/js2c/node_init:2:17025)
    at Module.require (node:internal/modules/cjs/loader:1240:19)
    at require (node:internal/modules/helpers:179:18)
    at bindings (/tmp/mattermost-desktop-5.9.0-linux-x64/resources/app.asar/node_modules/bindings/bindings.js:112:48)
    at safeLoad (/tmp/mattermost-desktop-5.9.0-linux-x64/resources/app.asar/node_modules/macos-notification-state/lib/index.js:3:31) {
  code: 'ERR_DLOPEN_FAILED'
}
11:44:06.242 › Logger Log level set to: warn
11:44:06.429 › [i18nManager] Failed to set new language en-US
11:44:06.429 › [i18nManager] Failed to set new language 
[5361:0828/114459.105499:ERROR:wayland_event_watcher.cc(68)] Fatal Wayland communication error: Broken pipe.
[5361:0828/114459.105569:FATAL:electron_browser_main_parts.cc(509)] Failed to shutdown.
zsh: trace trap (core dumped)  ./mattermost-desktop
devinbinnie commented 2 months ago

@pmkap Just looking at these two lines:

[5361:0828/114459.105499:ERROR:wayland_event_watcher.cc(68)] Fatal Wayland communication error: Broken pipe.
[5361:0828/114459.105569:FATAL:electron_browser_main_parts.cc(509)] Failed to shutdown.

Do they popup when you go to open the file?

pmkap commented 2 months ago

[5361:0828/114459.105499:ERROR:wayland_event_watcher.cc(68)] Fatal Wayland communication error: Broken pipe. [5361:0828/114459.105569:FATAL:electron_browser_main_parts.cc(509)] Failed to shutdown.



Do they popup when you go to open the file?

They popped up when mattermost closed. Or crashed in this case. This was some seconds later. The moment I closed LibreOffice. LibreOffice was the app I opened the attachment with.

pmkap commented 2 months ago

@devinbinnie There is a coredump from this crash. Let me know if you need that.

devinbinnie commented 2 months ago

@pmkap Seems like there could be a Wayland issue. Are you forcing native Wayland using ELECTRON_OZONE_PLATFORM_HINT or something similar? If so can you try turning that on/off and see if anything changes?

pmkap commented 2 months ago

I can reproduce the issue running mattermost with Xwayland.

 /tmp/mattermost-desktop-5.9.0-linux-x64 ❯ ELECTRON_OZONE_PLATFORM_HINT= ./mattermost-desktop
17:20:08.322 › Logger Log level set to: info
[macos-notification-state] failed to load 'notificationstate' addon Error: Module did not self-register: '/tmp/mattermost-desktop-5.9.0-linux-x64/resources/app.asar.unpacked/node_modules/macos-notification-state/build/Release/notificationstate.node'.
    at process.func [as dlopen] (node:electron/js2c/node_init:2:2559)
    at Module._extensions..node (node:internal/modules/cjs/loader:1470:18)
    at Object.func [as .node] (node:electron/js2c/node_init:2:2786)
    at Module.load (node:internal/modules/cjs/loader:1215:32)
    at Module._load (node:internal/modules/cjs/loader:1031:12)
    at c._load (node:electron/js2c/node_init:2:17025)
    at Module.require (node:internal/modules/cjs/loader:1240:19)
    at require (node:internal/modules/helpers:179:18)
    at bindings (/tmp/mattermost-desktop-5.9.0-linux-x64/resources/app.asar/node_modules/bindings/bindings.js:112:48)
    at safeLoad (/tmp/mattermost-desktop-5.9.0-linux-x64/resources/app.asar/node_modules/macos-notification-state/lib/index.js:3:31) {
  code: 'ERR_DLOPEN_FAILED'
}
17:20:08.387 › Logger Log level set to: warn
17:20:08.552 › [i18nManager] Failed to set new language en-US
17:20:08.552 › [i18nManager] Failed to set new language 
[30687:0828/172023.970357:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[30687:0828/172026.292624:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[30641:0828/172052.455149:ERROR:browser_main_loop.cc(278)] GLib-GObject: ../glib/gobject/gsignal.c:2685: instance '0x83002bc1400' has no handler with id '4646'
zsh: segmentation fault (core dumped)  ELECTRON_OZONE_PLATFORM_HINT= ./mattermost-desktop

This time I also got a error popup before segfaulting. image

But it seems this error does not pop up for all file types. Here I tried to download a png file when the pop-up showed.

devinbinnie commented 2 months ago

I can reproduce the issue running mattermost with Xwayland.

Sorry I'm not clear on did you have Xwayland enabled before? Are you saying it's reproducible regardless of the ELECTRON_OZONE_PLATFORM_HINT

This time I also got a error popup before segfaulting. But it seems this error does not pop up for all file types. Here I tried to download a png file when the pop-up showed.

This is a different issue for image files specifically.

pmkap commented 2 months ago

Sorry I'm not clear on did you have Xwayland enabled before? Are you saying it's reproducible regardless of the ELECTRON_OZONE_PLATFORM_HINT

Exactly. Same issue with Wayland and XWayland.

devinbinnie commented 2 months ago

@pmkap Unfortunately I am unable to reproduce this one, I am able to open a DOCX file in LibreOffice under Wayland from the MM app. It's likely this might have something to do with your specific configuration or machine.

I can only suggest at this point to maybe try uninstalling/reinstalling Mattermost, or trying a different machine and see if you get the same result.

pmkap commented 2 months ago

Thanks for trying anyway!

devinbinnie commented 2 months ago

No problem. Closing this issue as not reproducible for now. Feel free to comment if anyone else is experiencing this issue and has additional information.