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

Axolotl 1.5.1 Flatpak does not start on Manjaro ARM Plasma Mobile #9

Closed
kkofler opened this issue Sep 21, 2022 · 27 comments
Closed

Axolotl 1.5.1 Flatpak does not start on Manjaro ARM Plasma Mobile #9

kkofler opened this issue Sep 21, 2022 · 27 comments
Labels
bug Something isn't working

Comments

@kkofler
Copy link

kkofler commented Sep 21, 2022

I have tried the 1.5.1 Flatpak that was released a few hours ago. Unfortunately, it still does not work:

time="2022-09-21T14:11:55+02:00" level=info msg="[axolotl] Starting axolotl version 1.5.1"
time="2022-09-21T14:11:55+02:00" level=info msg="[axolotl] Setup completed"
time="2022-09-21T14:11:55+02:00" level=info msg="[axolotl] Axolotl server started"
time="2022-09-21T14:11:55+02:00" level=info msg="[axolotl] Starting axolotl ws"
time="2022-09-21T14:11:55+02:00" level=info msg="[axolotl-electron] starting astilelectron with the following switches: [--disable-dev-shm-usage --no-sandbox --ozone-platform-hint=auto]"
time="2022-09-21T14:11:55+02:00" level=info msg="astikit: starting worker..."
time="2022-09-21T14:11:55+02:00" level=info msg="[axolotl] Loading Chats"
time="2022-09-21T14:11:55+02:00" level=info msg="[axolotl] Db setup finished"
time="2022-09-21T14:11:55+02:00" level=info msg="[textsecure-crayfish] Starting crayfish-backend"
time="2022/09/21 14:11:55" level=info msg="[crayfish] starting crayfish 9a67726e4869cb63a2cfc299398c795f9162d350\n"
time="2022/09/21 14:11:55" level=info msg="[crayfish] Starting libsignal-service web socket at ws://127.0.0.1:9081/libsignal\n"
time="2022/09/21 14:11:56" level=info msg="[crayfish] establishing client connection... WebSocket\n"
time="2022-09-21T14:12:01+02:00" level=error msg="'/home/kevin/.var/app/org.nanuc.Axolotl/data/vendor/electron-linux-arm64/electron' exited with code: -1"
time="2022-09-21T14:12:01+02:00" level=info msg="astikit: stopping worker..."
time="2022/09/21 14:12:01" level=error msg="[axolotl-electron] main: creating window failed: context canceled"
time="2022-09-21T14:12:01+02:00" level=info msg="astikit: worker is now waiting..."
time="2022-09-21T14:12:01+02:00" level=error msg="accept tcp 127.0.0.1:33291: use of closed network connection while TCP accepting"
time="2022/09/21 14:12:01" level=info msg="[axolotl] ending axolotl"

The first time, I also got a message after "astikit: worker is now waiting..." saying [axolotl-electron] Electron App has crashed, and all the detailed information is unfortunately just {nil}. That message no longer appeared when retrying.

While I might be able to get server mode working (I did with 1.2.0, which also failed to start Electron), the workaround that allows registration to work does not work in server mode, it requires support from the browser and hence works only in the Electron and Qt modes (and the Qt mode is not available on Flathub, is it?).

@kkofler
Copy link
Author

kkofler commented Sep 21, 2022

In the systemd journal, I see Process 11677 (electron) of user 1002 dumped core.. The stack trace is completely useless, it contains only addresses and no symbol names nor even DSO names. And if I start .var/app/org.nanuc.Axolotl/data/vendor/electron-linux-arm64/electron with no arguments, or with the arguments Axolotl uses (--disable-dev-shm-usage --no-sandbox --ozone-platform-hint=auto), it comes up (showing only version information). Though of course that is outside of the Flatpak sandbox.

@olof-nord olof-nord added the bug Something isn't working label Sep 21, 2022
@olof-nord
Copy link
Collaborator

Thanks for filing the issue!
The device which you are running is using Wayland I would guess?

@kkofler
Copy link
Author

kkofler commented Sep 21, 2022

Yes, Plasma Mobile always uses Wayland (as does Phosh, by the way).

The device is a PinePhone.

System:
  Host: plasma-mobile Kernel: 5.19.8-1-MANJARO-ARM arch: aarch64 bits: 64
    Console: pty pts/1 Distro: Manjaro ARM
Machine:
  Type: ARM System: Pine64 PinePhone (1.2) details: N/A
    serial: 92c0a1ba515f919c
Battery:
  ID-1: axp20x-battery charge: 99% condition: N/A
CPU:
  Info: quad core Model N/A [MCP] speed (MHz): avg: 648 min/max: 648/1152
Graphics:
  Device-1: sun50i-a64-mali driver: lima v: kernel
  Device-2: sun50i-a64-dw-hdmi driver: sun8i_dw_hdmi v: N/A
  Device-3: sun50i-a64-display-engine driver: sun4i_drm v: N/A
  Device-4: sun9i-a80-hdmi-audio driver: N/A
  Display: server: X.org v: 1.21.1.4 with: Xwayland v: 22.1.3 driver: X:
    loaded: modesetting gpu: lima,sun8i_dw_hdmi,sun4i_drm tty: 80x25
  Message: Unable to show GL data. Required tool glxinfo missing.
Network:
  Device-1: mmc-pwrseq-simple driver: pwrseq_simple
  Device-2: sun50i-a64-emac driver: N/A
Drives:
  Local Storage: total: 29.12 GiB used: 22.84 GiB (78.4%)
Info:
  Processes: 190 Uptime: 2d 2h 47m Memory: 2.92 GiB used: 1.43 GiB (49.0%)
  Init: systemd Shell: Bash inxi: 3.3.20

@kkofler
Copy link
Author

kkofler commented Sep 21, 2022

(The inxi tool that I used above apparently does not natively support Wayland, it reports the Xwayland compatibility layer.)

@olof-nord
Copy link
Collaborator

That "use of closed network connection while TCP accepting" error message is an error message which I have seen coming back in many different ways.
Looking at this go-astilectron issue and this electron issue - is libgconf-2-4 installed?

@olof-nord
Copy link
Collaborator

This issue is definitely also related to this one: axolotl-chat/axolotl#433 - the question is if it actually is the same issue even.

@kkofler
Copy link
Author

kkofler commented Sep 21, 2022

Is it the same issue? Probably, assuming the linked issue is actually one issue and not several with the same symptoms. It is said to affect several distros, including Arch Linux ARM, which is closely related to the Manjaro ARM that I am using.

@kkofler
Copy link
Author

kkofler commented Sep 21, 2022

Looking at this asticode/go-astilectron#111 and this electron/electron#1518 - is libgconf-2-4 installed?

Is it not the Flatpak's or the Flatpak runtime's job to provide this sort of libraries? Flatpak does not normally use system libraries, does it?

@kkofler
Copy link
Author

kkofler commented Sep 21, 2022

Running:

.var/app/org.nanuc.Axolotl/data/vendor/electron-linux-arm64/electron --disable-dev-shm-usage --no-sandbox --ozone-platform-hint=auto https://github.com/nanu-c/axolotl/issues/433

works, i.e., it successfully brings up that web page. Not perfectly, the window is not entirely fullscreen (it leaves a border on the top and bottom side that should not be there, it should fill everything except the top and bottom panel, but there is extra border in addition to that) and somewhat blurred (apparently the internal size does not match the displayed size), but it works, whereas Axolotl does not.

EDIT: The "border" on the right is actually a scrollbar, it is just the top and the bottom where the windows below shine through because there is more border than required for the panels.

@kkofler
Copy link
Author

kkofler commented Sep 21, 2022

libgconf (libgconf-2.so.4) is not installed on the host, but does it need to be? It is included in your Flatpak in any case (/var/lib/flatpak/app/org.nanuc.Axolotl/aarch64/stable/active/files/lib/libgconf-2.so.4).

@kkofler
Copy link
Author

kkofler commented Sep 21, 2022

Also, gconf is no longer available in Manjaro, because Arch has demoted it to AUR for being obsolete: https://aur.archlinux.org/packages/gconf

@kkofler
Copy link
Author

kkofler commented Sep 21, 2022

(I could compile it from AUR, but I really should not have to. And I doubt that that obsolete library has anything to do with this issue to begin with. Also because a missing library would also show up when running electron directly, whereas that works here.)

@kkofler
Copy link
Author

kkofler commented Sep 21, 2022

For the border, comparing with the screenshot in axolotl-chat/axolotl#433 (comment) , it looks like Electron has hardcoded the larger Phosh panel sizes, leaving empty spaces on Plasma Mobile.

But that is not really the issue here, the issue is that Electron on its own starts up, but Electron on Axolotl crashes.

@kkofler
Copy link
Author

kkofler commented Sep 21, 2022

I have tried a lot of things to debug this:

  • set various Electron, Flatpak, and zypak flags (command-line flags and/or environment variables) → no change,
  • tried to install the org.nanuc.Axolotl.Debug extension Flatpak in the hope of getting a better backtrace for the crash → no change, still the same useless backtrace,
  • tried to get the stuff to run outside of the Flatpak sandbox, directly on the host → did not manage to set all the search paths properly to make that work, and I am not convinced the Flatpak sandbox is even the problem to begin with. (see below)

@kkofler
Copy link
Author

kkofler commented Sep 21, 2022

If I run the following:

PATH=/var/lib/flatpak/app/org.nanuc.Axolotl/aarch64/stable/active/files/bin LD_LIBRARY_PATH=/var/lib/flatpak/app/org.nanuc.Axolotl/aarch64/stable/active/files/lib XDG_DATA_HOME=/home/kevin/.var/app/org.nanuc.Axolotl/data AXOLOTL_WEB_DIR=/var/lib/flatpak/app/org.nanuc.Axolotl/aarch64/stable/active/files/lib/astibundler/bind/axolotl-web/dist /var/lib/flatpak/app/org.nanuc.Axolotl/aarch64/stable/active/files/bin/axolotl-electron-bundle

Axolotl actually comes up! Of course without any of the Flatpak sandboxing.

So it does look like the problem is due to the Flatpak sandbox.

(And by the way, Axolotl, at least when started that way, does not leave the unused borders between the panels and the window that Electron on its own leaves for some reason.)

@kkofler
Copy link
Author

kkofler commented Sep 22, 2022

So I have tried this for debugging:

flatpak run --devel --env=ZYPAK_STRACE=all --env=ZYPAK_STRACE_NO_LINE_LIMIT=1 org.nanuc.Axolotl 2>strace.log

and what leads to the segfault is this:

[pid    22] openat(AT_FDCWD, "/home/kevin/.var/app/org.nanuc.Axolotl/config/Electron/Local State", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid    22] clock_gettime(CLOCK_MONOTONIC, {tv_sec=48264, tv_nsec=951831314}) = 0
[pid    22] faccessat(AT_FDCWD, "/home/kevin/.var/app/org.nanuc.Axolotl/config/Electron/Local State", F_OK) = -1 ENOENT (No such file or directory)
[pid    22] clock_gettime(CLOCK_MONOTONIC, {tv_sec=48264, tv_nsec=952276863}) = 0
[pid    22] faccessat(AT_FDCWD, "/home/kevin/.var/app/org.nanuc.Axolotl/config/Electron", F_OK) = 0
[pid    22] gettid()                    = 22
[pid    22] socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 51
[pid    22] connect(51, {sa_family=AF_UNIX, sun_path=@"/tmp/.X11-unix/X1"}, 20) = 0
[pid    22] getpeername(51, {sa_family=AF_UNIX, sun_path=@"/tmp/.X11-unix/X1"}, [124 => 20]) = 0
[pid    22] uname({sysname="Linux", nodename="plasma-mobile", release="5.19.8-1-MANJARO-ARM", version="#1 SMP PREEMPT Fri Sep 9 22:07:40 UTC 2022", machine="aarch64", domainname="(none)"}) = 0
[pid    22] faccessat(AT_FDCWD, "/run/user/1002/xauth_OEMHJP", R_OK) = -1 ENOENT (No such file or directory)
[pid    22] fcntl(51, F_GETFL)          = 0x2 (flags O_RDWR)
[pid    22] fcntl(51, F_SETFL, O_RDWR|O_NONBLOCK) = 0
[pid    22] fcntl(51, F_SETFD, FD_CLOEXEC) = 0
[pid    22] ppoll([{fd=51, events=POLLIN|POLLOUT}], 1, NULL, NULL, 0) = 1 ([{fd=51, revents=POLLOUT}])
[pid    22] writev(51, [{iov_base="l\0\v\0\0\0\0\0\0\0\0\0", iov_len=12}, {iov_base="", iov_len=0}], 2) = 12
[pid    22] recvfrom(51, "\0@\v\0\0\0\20\0", 8, 0, NULL, NULL) = 8
[pid    22] recvfrom(51, "Authorization required, but no a"..., 64, 0, NULL, NULL) = 64
[pid    22] write(2, "Authorization required, but no a"..., 64) = 64
[pid    16] <... epoll_pwait resumed>[{events=EPOLLIN, data={u32=2756062024, u64=281473437805384}}], 128, 366, NULL, 925595970) = 1
[pid    22] shutdown(51, SHUT_RDWR)     = 0
[pid    22] close(51)                   = 0
[pid    16] futex(0x67980d8, FUTEX_WAKE_PRIVATE, 1) = 1
[pid    13] <... futex resumed>)        = 0
[pid    22] getpid( <unfinished ...>
[pid    16] read(18,  <unfinished ...>
[pid    13] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    22] <... getpid resumed>)       = 22
[pid    16] <... read resumed>"Authorization required, but no a"..., 32768) = 64
[pid    13] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=956621642}) = 0
[pid    22] gettimeofday( <unfinished ...>
[pid    13] epoll_pwait(9,  <unfinished ...>
[pid    22] <... gettimeofday resumed>{tv_sec=1663849581, tv_usec=327015}, NULL) = 0
[pid    13] <... epoll_pwait resumed>[], 128, 0, NULL, 956621642) = 0
[pid    13] nanosleep({tv_sec=0, tv_nsec=20000},  <unfinished ...>
[pid    16] read(18,  <unfinished ...>
[pid    13] <... nanosleep resumed>NULL) = 0
[pid    16] <... read resumed>0x40000c6000, 32768) = -1 EAGAIN (Resource temporarily unavailable)
[pid    13] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    22] futex(0xaaaade360ea0, FUTEX_WAKE_PRIVATE, 2147483647 <unfinished ...>
[pid    16] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    13] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=957307612}) = 0
[pid    13] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    22] <... futex resumed>)        = 0
[pid    16] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=957492490}) = 0
[pid    13] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=957486823}) = 0
[pid    16] epoll_pwait(9,  <unfinished ...>
[pid    13] nanosleep({tv_sec=0, tv_nsec=20000},  <unfinished ...>
[pid    22] write(2, "[22:0922/142621.327015:ERROR:ozo"..., 86 <unfinished ...>
[pid    16] <... epoll_pwait resumed>[], 128, 0, NULL, 1) = 0
[pid    13] <... nanosleep resumed>NULL) = 0
[pid    13] clock_gettime(CLOCK_MONOTONIC, {tv_sec=48264, tv_nsec=957956706}) = 0
[pid    22] <... write resumed>)        = 86
[pid    16] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    13] clock_gettime(CLOCK_MONOTONIC, {tv_sec=48264, tv_nsec=958106583}) = 0
[pid    13] futex(0x67980d8, FUTEX_WAIT_PRIVATE, 0, {tv_sec=0, tv_nsec=333930801} <unfinished ...>
[pid    16] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=958236085}) = 0
[pid    22] getpid()                    = 22
[pid    16] epoll_pwait(9,  <unfinished ...>
[pid    22] gettimeofday({tv_sec=1663849581, tv_usec=328705}, NULL) = 0
[pid    16] <... epoll_pwait resumed>[{events=EPOLLIN, data={u32=2756062024, u64=281473437805384}}], 128, 333, NULL, 958236085) = 1
[pid    22] write(2, "[22:0922/142621.328705:ERROR:env"..., 87) = 87
[pid    16] futex(0x67980d8, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
[pid    22] getpid( <unfinished ...>
[pid    16] <... futex resumed>)        = 1
[pid    13] <... futex resumed>)        = 0
[pid    22] <... getpid resumed>)       = 22
[pid    16] read(18,  <unfinished ...>
[pid    13] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    22] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    16] <... read resumed>"[22:0922/142621.327015:ERROR:ozo"..., 32768) = 173
[pid    13] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=959341228}) = 0
[pid    22] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=959406105}) = 0
[pid    16] read(18,  <unfinished ...>
[pid    13] nanosleep({tv_sec=0, tv_nsec=20000},  <unfinished ...>
[pid    22] gettid( <unfinished ...>
[pid    16] <... read resumed>0x40000c6000, 32768) = -1 EAGAIN (Resource temporarily unavailable)
[pid    22] <... gettid resumed>)       = 22
[pid    16] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    13] <... nanosleep resumed>NULL) = 0
[pid    22] gettid( <unfinished ...>
[pid    13] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    16] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=960521873}) = 0
[pid    22] <... gettid resumed>)       = 22
[pid    13] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=960559082}) = 0
[pid    22] gettid( <unfinished ...>
[pid    16] epoll_pwait(9,  <unfinished ...>
[pid    13] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    22] <... gettid resumed>)       = 22
[pid    16] <... epoll_pwait resumed>[], 128, 0, NULL, 1) = 0
[pid    13] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=961060840}) = 0
[pid    22] gettid( <unfinished ...>
[pid    16] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    22] <... gettid resumed>)       = 22
[pid    13] nanosleep({tv_sec=0, tv_nsec=20000},  <unfinished ...>
[pid    16] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=961287885}) = 0
[pid    13] <... nanosleep resumed>NULL) = 0
[pid    22] write(30, "\0", 1 <unfinished ...>
[pid    16] epoll_pwait(9,  <unfinished ...>
[pid    13] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    39] <... epoll_pwait resumed>[{events=EPOLLIN, data={u32=29, u64=29}}], 32, -1, NULL, 8) = 1
[pid    22] <... write resumed>)        = 1
[pid    39] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    13] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=961780935}) = 0
[pid    39] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=961914645}) = 0
[pid    22] futex(0xffff835bec50, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, 39, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid    39] read(29,  <unfinished ...>
[pid    13] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    39] <... read resumed>"\0", 1)  = 1
[pid    39] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    13] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=962220484}) = 0
[pid    39] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=962226401}) = 0
[pid    39] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    13] futex(0x67980d8, FUTEX_WAIT_PRIVATE, 0, {tv_sec=0, tv_nsec=330106572} <unfinished ...>
[pid    39] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=962415237}) = 0
[pid    39] epoll_pwait(26, [], 32, 0, NULL, 8) = 0
[pid    39] clock_gettime(CLOCK_MONOTONIC, {tv_sec=48264, tv_nsec=962645324}) = 0
[pid    39] write(30, "\0", 1)          = 1
[pid    39] gettid()                    = 39
[pid    39] epoll_ctl(26, EPOLL_CTL_DEL, 29, 0xffff835be070) = 0
[pid    39] close(30)                   = 0
[pid    39] close(29)                   = 0
[pid    39] close(27)                   = 0
[pid    39] close(28)                   = 0
[pid    39] close(26)                   = 0
[pid    39] madvise(0xffff82db0000, 8314880, MADV_DONTNEED) = 0
[pid    39] exit(0)                     = ?
[pid    39] +++ exited with 0 +++
[pid    22] <... futex resumed>)        = 0
[pid    22] epoll_ctl(31, EPOLL_CTL_DEL, 50, 0xffffc0c292d0) = -1 ENOENT (No such file or directory)
[pid    22] close(50 <unfinished ...>
[pid    16] <... epoll_pwait resumed>[{events=EPOLLIN|EPOLLOUT|EPOLLRDHUP, data={u32=2756061544, u64=281473437804904}}], 128, 330, NULL, 961287885) = 1
[pid    22] <... close resumed>)        = 0
[pid    22] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    16] futex(0x67980d8, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
[pid    22] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=966101797}) = 0
[pid    16] <... futex resumed>)        = 1
[pid    13] <... futex resumed>)        = 0
[pid    22] epoll_ctl(31, EPOLL_CTL_ADD, 34, {events=EPOLLIN, data={u32=34, u64=34}} <unfinished ...>
[pid    16] read(28,  <unfinished ...>
[pid    13] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    22] <... epoll_ctl resumed>)    = 0
[pid    16] <... read resumed>"", 4096) = 0
[pid    22] epoll_ctl(31, EPOLL_CTL_ADD, 36, {events=EPOLLIN, data={u32=36, u64=36}} <unfinished ...>
[pid    13] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=966409302}) = 0
[pid    22] <... epoll_ctl resumed>)    = 0
[pid    16] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    22] epoll_pwait(31,  <unfinished ...>
[pid    13] nanosleep({tv_sec=0, tv_nsec=20000},  <unfinished ...>
[pid    22] <... epoll_pwait resumed>[{events=EPOLLIN, data={u32=36, u64=36}}], 1024, 0, NULL, 8) = 1
[pid    16] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=966568221}) = 0
[pid    22] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    16] epoll_pwait(9,  <unfinished ...>
[pid    13] <... nanosleep resumed>NULL) = 0
[pid    22] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=966716682}) = 0
[pid    16] <... epoll_pwait resumed>[], 128, 0, NULL, 1) = 0
[pid    13] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    22] read(36,  <unfinished ...>
[pid    16] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    13] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=966830434}) = 0
[pid    22] <... read resumed>"\2\0\0\0\0\0\0\0", 1024) = 8
[pid    16] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=966877393}) = 0
[pid    13] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    16] epoll_pwait(9,  <unfinished ...>
[pid    13] <... clock_gettime resumed>{tv_sec=48264, tv_nsec=966988937}) = 0
[pid    13] futex(0x67980d8, FUTEX_WAIT_PRIVATE, 0, {tv_sec=0, tv_nsec=325057073} <unfinished ...>
[pid    22] clock_gettime(CLOCK_MONOTONIC, {tv_sec=48264, tv_nsec=967418110}) = 0
[pid    22] clock_gettime(CLOCK_MONOTONIC, {tv_sec=48264, tv_nsec=967717032}) = 0
[pid    22] epoll_pwait(31, [], 1024, 0, NULL, 8) = 0
[pid    22] clock_gettime(CLOCK_MONOTONIC, {tv_sec=48264, tv_nsec=968188998}) = 0
[pid    22] clock_gettime(CLOCK_MONOTONIC, {tv_sec=48264, tv_nsec=968382584}) = 0
[pid    22] --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x6599b0} ---

So I see that, after loading the Electron config, it tries to connect to X11 (not Wayland), the Xauth file appears to not authorize that, then some Ozone error is produced that is unfortunately truncated in the strace and that never reaches stderr because it is filtered by other processes (the string ending with ERROR:ozo). At that point, the process (pid 22) producing that error ends up segfaulting.

@olof-nord
Copy link
Collaborator

I really appreciate your effort and time spent on this!
The ozone flags have been troublesome in the past: what I was inspired by was the way the Signal team decided to set up their Flatpak manifest.

Looking at their solution, they have since adjusted it and now seem to rely on a different flag --ozone-platform=wayland instead of --ozone-platform-hint=auto, they are also no longer specifying DISPLAY and have removed the --socket=fallback-x11 flatpak permission to pick some selected changes.

The Signal flatpak readme also provides some specific notes for Wayland.

The difficulty with coming up with the first release of axolotl packaged with Electron was really just getting Electron to start at all within the flatpak environment. As for the ozone flags and the Electron Wayland work, @Ferenc- provided the project with some excellent insights with axolotl-chat/axolotl#468.

@kkofler
Copy link
Author

kkofler commented Sep 22, 2022

So basically, they are forcing it to use Wayland to prevent errors when attempting to use X11. I guess we can try that too, though it will mean that the Flatpak will no longer run at all on X11 distros/desktops.

Where is the --ozone-platform-hint=auto flag set? I have found the places where DISPLAY is set (in the run.sh script) and where the permissions are specified (in the metadata), so I can try to manually edit those, but I have not yet found the place where the flags are configured.

@olof-nord
Copy link
Collaborator

Yes, that is a slightly convoluted way: it is set during startup by the usage of the axolotl specific electron-flag flag.

@kkofler
Copy link
Author

kkofler commented Sep 22, 2022

So I cannot really change that without recompiling the whole thing or poking around in the binary. That is unfortunate. It would be helpful to have some CLI flag and/or environment variable to pass arbitrary Electron switches. (I would have expected -electron-flag to do that, but as far as I can tell, anything other than no-ozone is completely ignored.)

I have tried commenting out the export DISPLAY=:1 in run.sh and (at the same time) removing the x11 and fallback-x11 permissions in the metadata file, but that did not fix the crash.

@kkofler
Copy link
Author

kkofler commented Sep 22, 2022

I got it to start with this hack:

cd .var/app/org.nanuc.Axolotl/data/vendor/electron-linux-arm64/
mv electron electron.orig
cat >electron <<EOF
#!/bin/sh
exec "$0.orig" "$@" --ozone-platform=wayland
EOF
chmod +x electron
flatpak run org.nanuc.Axolotl

(I actually used nano rather than cat, but the above is more reproducible.)

I did not have to touch DISPLAY or the permissions in the metadata, only add that flag. So I assume just changing the flag in axolotl/main.go:75 will likely fix it.

@kkofler
Copy link
Author

kkofler commented Sep 22, 2022

Well, it comes up, but it is not usable, because the virtual keyboard does not come up! So I cannot even enter my phone number (the first step of registration).

@kkofler
Copy link
Author

kkofler commented Sep 22, 2022

Looks like the virtual keyboard issue is not Flatpak-specific though, it also happens if I run Axolotl unsandboxed as per #9 (comment) . It happens even if I change --ozone-platform=wayland to --ozone-platform=x11 and run it unsandboxed, so it is not Wayland-specific either. (That said, the virtual keyboard on Plasma Mobile generally does not work with X11 applications, so that part is not really a surprise.)

So, since it is not Flatpak-specific, I will have to file that issue separately. Unfortunately, from what I found on the Internet, it is an upstream Chromium issue that affects Chromium and all Electron applications, and nobody seems to have solved it. The only suggested workaround is to manually open the virtual keyboard, which is not possible under Plasma Mobile. (Only Phosh has a gesture for that.) So Axolotl is still unusable for me. :-(

@kkofler
Copy link
Author

kkofler commented Sep 22, 2022

Looks like the virtual keyboard issue is: https://bugs.chromium.org/p/chromium/issues/detail?id=1039161 – looks like it will be months until this will finally get fixed in upstream Chromium, and then trickle down to Electron and from there to Axolotl. (KWin supports text-input-unstable-v2 and text-input-unstable-v3, old versions also supported text-input-unstable-v0, but Chromium implements only text-input-unstable-v1 which KWin has never supported.)

The fix (update the ozone-platform flag) in axolotl/main.go should still go in soon, but it unfortunately does not lead to a usable Axolotl on Plasma Mobile.

@kkofler
Copy link
Author

kkofler commented Nov 5, 2022

1.6.0 starts up without hacks now, i.e., this bug is fixed.

And the latest Plasma Mobile has a workaround for the keyboard issue. (It allows bringing up the keyboard manually for legacy applications that do not implement text-input-unstable-v2 nor text-input-unstable-v3.) So Axolotl is usable now. (A proper fix for the keyboard issue will have to happen in Chromium/Electron.)

@kkofler kkofler closed this as completed Nov 5, 2022
@kkofler kkofler reopened this Nov 5, 2022
@kkofler
Copy link
Author

kkofler commented Nov 5, 2022

So Axolotl is usable now.

Well, I spoke too soon. I cannot input my phone number because the input field gets other characters instead of digits. (The + character also does not work, I get a ( instead.)

@kkofler
Copy link
Author

kkofler commented Nov 5, 2022

Looks like what I am seeing now is axolotl-chat/axolotl#635.

@kkofler kkofler closed this as completed Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants