FS#73635 - [zettlr] Segmentation fault on Wayland

Attached to Project: Community Packages
Opened by Lucas Steinmann (mainframed) - Saturday, 05 February 2022, 09:33 GMT
Last edited by freswa (frederik) - Tuesday, 08 February 2022, 11:34 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Caleb Maclennan (alerque)
Architecture x86_64
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

After switching from the AUR package `zetler-bin` to the version in the community repository, zettlr does no longer start.


Additional info:

The package version is 2.1.3-3
I'm using GNOME on Wayland. All other packages are up-to-date.
Kernel: 5.16.5-zen1-1-zen


The following log is produced.

```
[20764:0205/101504.885776:WARNING:wayland_object.cc(93)] Binding to gtk_shell1 version 4 but version 5 is available.
[20764:0205/101504.886232:WARNING:wayland_drm.cc(96)] Failed to get drm magic
[20764:0205/101505.026074:WARNING:electron_extension_loader.cc(80)] Warnings loading extension at /home/lucas/.config/Zettlr/extensions/ljjemllljcmogpfapbkkighbhhppjdbg: Unrecognized manifest key 'browser_action'.
[20764:0205/101505.026100:WARNING:electron_extension_loader.cc(80)] Warnings loading extension at /home/lucas/.config/Zettlr/extensions/ljjemllljcmogpfapbkkighbhhppjdbg: Unrecognized manifest key 'update_url'.
(node:20764) ExtensionLoadWarning: Warnings loading extension at /home/lucas/.config/Zettlr/extensions/ljjemllljcmogpfapbkkighbhhppjdbg:
Permission 'contextMenus' is unknown or URL pattern is malformed.

(Use `electron --trace-warnings ...` to show where the warning was created)
[10:15:05] こんにちは! Booting Zettlr at Sat Feb 05 2022 10:15:05 GMT+0100 (Mitteleuropäische Normalzeit).
[10:15:05] Performing environment check ...
[10:15:05] [Application] App is unpackaged, but there was no Pandoc executable: /usr/lib/zettlr/app.asar/resources/pandoc
[10:15:05] Added DevTools extension: Vue.js devtools
[10:15:05] Cannot translate system.error.tray_not_supported, since the translations have not yet been loaded!
{}
[10:15:05] system.error.tray_not_supported
[10:15:05] Environment check complete.
[10:15:05] Registering custom protocol safe-file
[10:15:05] Log provider booting up ...
[10:15:05] Config provider booting up ...
[10:15:05] [Config Provider] Loading configuration file from /home/lucas/.config/Zettlr/config.json ...
[10:15:05] [Config Provider] Successfully loaded configuration
[10:15:05] Migrating from 2.1.2 to 2.1.3!
[20807:0205/101505.100713:ERROR:gpu_init.cc(457)] Passthrough is not supported, GL is egl, ANGLE is
[20807:0205/101505.108166:ERROR:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.
[10:15:05] Appearance provider booting up ...
[10:15:05] Assets provider starting up ...
[10:15:05] [Assets Provider] Found outdated filter links.lua; copying ...
[10:15:05] [Assets Provider] Found outdated filter tags.lua; copying ...
[10:15:05] Citeproc provider booting up ...
[10:15:05] [Citeproc Provider] Loading CSL locale file at /usr/lib/zettlr/app.asar/.webpack/main/assets/csl-locales/locales-de-DE.xml ...
[10:15:05] Dictionary provider booting up ...
[10:15:05] Recent documents provider booting up ...
[10:15:05] Menu provider booting up ...
[10:15:05] Link provider booting up ...
[10:15:05] Tag provider booting up ...
[10:15:05] Target provider booting up
[10:15:05] CSS provider booting up ...
[10:15:05] Translation provider booting up ...
[10:15:05] Update provider booting up ...
[10:15:05] Notification provider booting up ...
[10:15:05] Stats provider booting up
[10:15:05] Tray provider booting up ...
[10:15:05] FSAL booting up ...
[10:15:05] Clearing the FSAL cache ...
[10:15:05] [FSAL Cache] Cache cleared!
[10:15:05] [Window Manager] No window state information found.
[10:15:05] [Window Manager] Window Manager started.
[20764:0205/101505.256505:WARNING:wayland_surface.cc(116)] Server doesn't support zcr_alpha_compositing_v1.
[20764:0205/101505.256527:WARNING:wayland_surface.cc(127)] Server doesn't support overlay_prioritizer.
Speicherzugriffsfehler (Speicherabzug geschrieben)
```

Steps to reproduce:

I simply executed `zettlr` in the terminal.
This task depends upon

Closed by  freswa (frederik)
Tuesday, 08 February 2022, 11:34 GMT
Reason for closing:  Not a bug
Additional comments about closing:  The problem was a wrong config file in the user directory and not a packaging error.
Comment by Lucas Steinmann (mainframed) - Saturday, 05 February 2022, 10:46 GMT
The last line in the log means there is a "Segmentation fault".
Comment by Caleb Maclennan (alerque) - Tuesday, 08 February 2022, 08:44 GMT
Thanks for the report. I am unable to reproduce this as it runs fine for me, but my primary machine is still running Xorg. I have a wayland system but don't have access to it today. Is there any chance you could test this on X just to confirm my suspicion that this is Wayland specific?

Also do you have trouble with any other Electron apps? Do you have trouble launching just plain `electron` with no app inside?
Comment by Lucas Steinmann (mainframed) - Tuesday, 08 February 2022, 08:53 GMT
Hi Caleb,

thanks for your time.
I don't have Xorg installed. And I'm a bit afraid to install it and risk having other side effects.

I can run `electron12` and `electron13` without problems.

If I have time on the weekend, I'll try to build the package from sources (maybe with debug flags added).

Correction: I think I have Xorg installed, but I never ran it and I also don't have the startx script, which I used to have prior to using Wayland.
Comment by Caleb Maclennan (alerque) - Tuesday, 08 February 2022, 10:01 GMT
I just got my hands on an Arch laptop running Wayland / Sway and installed Zettlr from the community package. It ran just fine with no apparent problems, so this isn't just a Wayland thing.
Comment by Caleb Maclennan (alerque) - Tuesday, 08 February 2022, 10:02 GMT
What is with `electron12` and `electron13`? Zettlr should use the `electron` package with is 16.
Comment by Lucas Steinmann (mainframed) - Tuesday, 08 February 2022, 10:15 GMT
Ah yes, sorry.

Because I downgraded to the AUR-version, electron was automatically uninstalled, since no other packages depended on it.
I just reinstalled this package of zettlr and electron with it.

But still zettlr crashes and electron (now version 16) does not.

I've also moved the `.config/Zettlr` directory, to ensure that no incompatible config files are causing the crash.
Comment by Lucas Steinmann (mainframed) - Tuesday, 08 February 2022, 10:50 GMT
Ok, I couldn't stop it and began debugging a bit.

I tried to get a strack trace with gdb.
In search of the actual executable needed in gdb,
I found that `usr/bin/zettlr` calls
`/usr/bin/electron` which in turn executes
`/usr/lib/electron/electron /usr/lib/zettlr/app.asar --enable-features=UseOzonePlatform --ozone-platform=wayland`.

But when calling it without flags:
`/usr/lib/electron/electron /usr/lib/zettlr/app.asar`
I have no issues.

The flags seem to be sourced from my home directory in "${XDG_CONFIG_HOME:-$HOME/.config}/electron-flags.conf"
Not sure if I placed them there to fix some other program, or if some other program automatically placed them there.
They seem to control whether electron uses wayland natively instead of Xwayland.


`zettlr-bin` seems to be a packaged binary, which probably ignores those flags.

Comment by Lucas Steinmann (mainframed) - Tuesday, 08 February 2022, 10:54 GMT
By the way:

`/usr/lib/electron/electron --enable-features=UseOzonePlatform --ozone-platform=wayland`

works fine. But I guess this doesn't have to be a packaging error.

So I'd say close.

Sorry for the inconvenience. I hope maybe at least someone else, who has the same config file, finds help in this bug report.

Loading...